This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new ae89d93ac70 branch-3.0: [Fix](cloud-mow) Fix invalid specified 
version. spec_version=0--1 (#51255) (#51346)
ae89d93ac70 is described below

commit ae89d93ac702576732594a35ae2d0e5657a8289b
Author: bobhan1 <[email protected]>
AuthorDate: Thu May 29 20:29:20 2025 +0800

    branch-3.0: [Fix](cloud-mow) Fix invalid specified version. 
spec_version=0--1 (#51255) (#51346)
    
    pick https://github.com/apache/doris/pull/51255
---
 be/src/olap/base_tablet.cpp    | 17 +++++++++++++++++
 be/src/olap/rowset_builder.cpp |  8 --------
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/be/src/olap/base_tablet.cpp b/be/src/olap/base_tablet.cpp
index b6ee6ff3fd0..a8748447168 100644
--- a/be/src/olap/base_tablet.cpp
+++ b/be/src/olap/base_tablet.cpp
@@ -17,11 +17,15 @@
 
 #include "olap/base_tablet.h"
 
+#include <bthread/mutex.h>
 #include <fmt/format.h>
 #include <rapidjson/prettywriter.h>
 
 #include <random>
 
+#include "cloud/cloud_tablet.h"
+#include "cloud/config.h"
+#include "common/logging.h"
 #include "common/status.h"
 #include "olap/calc_delete_bitmap_executor.h"
 #include "olap/delete_bitmap_calculator.h"
@@ -1042,7 +1046,20 @@ Status BaseTablet::commit_phase_update_delete_bitmap(
 
     std::vector<RowsetSharedPtr> specified_rowsets;
     {
+        // to prevent seeing intermediate state of a tablet
+        std::unique_lock<bthread::Mutex> sync_lock;
+        if (config::is_cloud_mode()) {
+            sync_lock = std::unique_lock<bthread::Mutex>(
+                    
std::static_pointer_cast<CloudTablet>(tablet)->get_sync_meta_lock());
+        }
         std::shared_lock meta_rlock(tablet->_meta_lock);
+        if (tablet->tablet_state() == TABLET_NOTREADY) {
+            // tablet is under alter process. The delete bitmap will be 
calculated after conversion.
+            LOG(INFO) << "tablet is under alter process, delete bitmap will be 
calculated later, "
+                         "tablet_id: "
+                      << tablet->tablet_id() << " txn_id: " << txn_id;
+            return Status::OK();
+        }
         cur_version = tablet->max_version_unlocked();
         RETURN_IF_ERROR(tablet->get_all_rs_id_unlocked(cur_version, 
&cur_rowset_ids));
         _rowset_ids_difference(cur_rowset_ids, pre_rowset_ids, 
&rowset_ids_to_add,
diff --git a/be/src/olap/rowset_builder.cpp b/be/src/olap/rowset_builder.cpp
index ecc18fbc94b..97e140748cf 100644
--- a/be/src/olap/rowset_builder.cpp
+++ b/be/src/olap/rowset_builder.cpp
@@ -277,14 +277,6 @@ Status BaseRowsetBuilder::submit_calc_delete_bitmap_task() 
{
         }
     }
 
-    // tablet is under alter process. The delete bitmap will be calculated 
after conversion.
-    if (_tablet->tablet_state() == TABLET_NOTREADY) {
-        LOG(INFO) << "tablet is under alter process, delete bitmap will be 
calculated later, "
-                     "tablet_id: "
-                  << _tablet->tablet_id() << " txn_id: " << _req.txn_id;
-        return Status::OK();
-    }
-
     // For partial update, we need to fill in the entire row of data, during 
the calculation
     // of the delete bitmap. This operation is resource-intensive, and we need 
to minimize
     // the number of times it occurs. Therefore, we skip this operation here.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to