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

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


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new b528318a55a [branch-4.0] [fix](cloud) Fix SingleFlight deadlock in 
CloudTabletMgr::get_tablet during warmup (#60968)
b528318a55a is described below

commit b528318a55ae1eb68b0eacd89193d726087c09b2
Author: Xin Liao <[email protected]>
AuthorDate: Tue Mar 3 17:53:44 2026 +0800

    [branch-4.0] [fix](cloud) Fix SingleFlight deadlock in 
CloudTabletMgr::get_tablet during warmup (#60968)
    
    pick: #60622
---
 be/src/cloud/cloud_tablet.cpp    | 4 ++++
 be/src/olap/rowset/rowset_meta.h | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/be/src/cloud/cloud_tablet.cpp b/be/src/cloud/cloud_tablet.cpp
index 237b5187abf..223c2590211 100644
--- a/be/src/cloud/cloud_tablet.cpp
+++ b/be/src/cloud/cloud_tablet.cpp
@@ -386,6 +386,10 @@ void CloudTablet::add_rowsets(std::vector<RowsetSharedPtr> 
to_add, bool version_
         for (auto& rs : rowsets) {
             if (warmup_delta_data) {
 #ifndef BE_TEST
+                // Pre-set encryption algorithm to avoid re-entrant 
get_tablet() call
+                // inside RowsetMeta::fs() which causes SingleFlight deadlock 
when the
+                // tablet is not yet cached (during initial load_tablet).
+                
rs->rowset_meta()->set_encryption_algorithm(_tablet_meta->encryption_algorithm());
                 bool warm_up_state_updated = false;
                 // Warmup rowset data in background
                 for (int seg_id = 0; seg_id < rs->num_segments(); ++seg_id) {
diff --git a/be/src/olap/rowset/rowset_meta.h b/be/src/olap/rowset/rowset_meta.h
index edbb55e6567..9f052cf5e10 100644
--- a/be/src/olap/rowset/rowset_meta.h
+++ b/be/src/olap/rowset/rowset_meta.h
@@ -455,6 +455,13 @@ public:
 
     std::string debug_string() const { return 
_rowset_meta_pb.ShortDebugString(); }
 
+    // Pre-set the encryption algorithm to avoid re-entrant get_tablet calls
+    // that can cause SingleFlight deadlock during tablet loading.
+    void set_encryption_algorithm(EncryptionAlgorithmPB algorithm) {
+        _determine_encryption_once.call(
+                [algorithm]() -> Result<EncryptionAlgorithmPB> { return 
algorithm; });
+    }
+
 private:
     bool _deserialize_from_pb(std::string_view value);
 


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

Reply via email to