Skip to content

Commit

Permalink
[cherry-pick][branch-2.1] fix if no segments, just return ok. (#6427)
Browse files Browse the repository at this point in the history
  • Loading branch information
Linkerist authored May 24, 2022
1 parent 0993850 commit 140673d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions be/src/storage/rowset_update_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Status RowsetUpdateState::_do_load(Tablet* tablet, Rowset* rowset) {
_memory_usage += one_delete != nullptr ? one_delete->memory_usage() : 0;
}
const auto& rowset_meta_pb = rowset->rowset_meta()->get_meta_pb();
if (!rowset_meta_pb.has_txn_meta()) {
if (!rowset_meta_pb.has_txn_meta() || rowset->num_segments() == 0) {
return Status::OK();
}

Expand Down Expand Up @@ -262,7 +262,7 @@ Status RowsetUpdateState::_prepare_partial_update_states(Tablet* tablet, Rowset*

Status RowsetUpdateState::apply(Tablet* tablet, Rowset* rowset, uint32_t rowset_id, const PrimaryIndex& index) {
const auto& rowset_meta_pb = rowset->rowset_meta()->get_meta_pb();
if (!rowset_meta_pb.has_txn_meta()) {
if (!rowset_meta_pb.has_txn_meta() || rowset->num_segments() == 0) {
return Status::OK();
}
// currently assume it's a partial update
Expand Down

0 comments on commit 140673d

Please sign in to comment.