From 140673d0a9287fe3c9fe47ba9ef3bc2b64082862 Mon Sep 17 00:00:00 2001 From: Napoleon Date: Tue, 24 May 2022 16:15:44 +0800 Subject: [PATCH] [cherry-pick][branch-2.1] fix if no segments, just return ok. (#6427) --- be/src/storage/rowset_update_state.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/be/src/storage/rowset_update_state.cpp b/be/src/storage/rowset_update_state.cpp index b163e0bf1c614..eca53668bbfb5 100644 --- a/be/src/storage/rowset_update_state.cpp +++ b/be/src/storage/rowset_update_state.cpp @@ -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(); } @@ -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