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 71112f7a2c7 branch-3.0: [fix](compaction) Add read lock for compaction 
score calculation #51387 (#51396)
71112f7a2c7 is described below

commit 71112f7a2c777820a41112c50b7e7f5f349c54e0
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sun Jun 1 21:30:54 2025 +0800

    branch-3.0: [fix](compaction) Add read lock for compaction score 
calculation #51387 (#51396)
    
    Cherry-picked from #51387
    
    Co-authored-by: Siyang Tang <tangsiy...@selectdb.com>
---
 be/src/olap/base_tablet.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/be/src/olap/base_tablet.cpp b/be/src/olap/base_tablet.cpp
index a8748447168..54fcb0edd1f 100644
--- a/be/src/olap/base_tablet.cpp
+++ b/be/src/olap/base_tablet.cpp
@@ -22,6 +22,7 @@
 #include <rapidjson/prettywriter.h>
 
 #include <random>
+#include <shared_mutex>
 
 #include "cloud/cloud_tablet.h"
 #include "cloud/config.h"
@@ -194,6 +195,7 @@ Status BaseTablet::update_by_least_common_schema(const 
TabletSchemaSPtr& update_
 }
 
 uint32_t BaseTablet::get_real_compaction_score() const {
+    std::shared_lock l(_meta_lock);
     const auto& rs_metas = _tablet_meta->all_rs_metas();
     return std::accumulate(rs_metas.begin(), rs_metas.end(), 0,
                            [](uint32_t score, const RowsetMetaSharedPtr& 
rs_meta) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to