xiaokang commented on code in PR #28716:
URL: https://github.com/apache/doris/pull/28716#discussion_r1434729549
##########
be/src/olap/tablet.cpp:
##########
@@ -457,8 +475,24 @@ Status Tablet::add_rowset(RowsetSharedPtr rowset) {
return Status::OK();
}
+Status Tablet::rowsets_in_version_map_unlocked(const
std::vector<RowsetSharedPtr>& rowsets) {
+ for (auto&& rs : rowsets) {
+ if (auto it = _rs_version_map.find(rs->version()); it ==
_rs_version_map.end()) {
+ return Status::Error<DELETE_VERSION_ERROR>("try to delete not
exist version {} from {}",
Review Comment:
error message is confusing.
##########
be/src/olap/tablet.cpp:
##########
@@ -489,23 +523,6 @@ Status
Tablet::modify_rowsets(std::vector<RowsetSharedPtr>& to_add,
same_version = false;
}
- if (check_delete) {
Review Comment:
What's the benifit of moving this logic to
rowsets_in_version_map_unlocked()? Two function call may be missed in somewhere.
##########
be/src/olap/tablet.cpp:
##########
@@ -457,8 +475,24 @@ Status Tablet::add_rowset(RowsetSharedPtr rowset) {
return Status::OK();
}
+Status Tablet::rowsets_in_version_map_unlocked(const
std::vector<RowsetSharedPtr>& rowsets) {
+ for (auto&& rs : rowsets) {
+ if (auto it = _rs_version_map.find(rs->version()); it ==
_rs_version_map.end()) {
Review Comment:
Why write `it =` and `it ==` in one line, it not easy to read.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]