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

gavinchou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 25998809733 [fix](create table) Fix `test_partition_create_tablet_rr` 
docker regression case (#41012)
25998809733 is described below

commit 25998809733ae750881aa4cb664aa8c1333cab3d
Author: deardeng <565620...@qq.com>
AuthorDate: Tue Oct 22 00:23:53 2024 +0800

    [fix](create table) Fix `test_partition_create_tablet_rr` docker regression 
case (#41012)
---
 be/src/olap/storage_engine.cpp                                 |  8 ++++----
 be/src/olap/storage_engine.h                                   | 10 +++++-----
 .../suites/partition_p0/test_partition_create_tablet_rr.groovy |  3 ++-
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/be/src/olap/storage_engine.cpp b/be/src/olap/storage_engine.cpp
index ebf40c90bea..e00b5b595e2 100644
--- a/be/src/olap/storage_engine.cpp
+++ b/be/src/olap/storage_engine.cpp
@@ -209,7 +209,7 @@ StorageEngine::StorageEngine(const EngineOptions& options)
           _txn_manager(new TxnManager(*this, config::txn_map_shard_size, 
config::txn_shard_size)),
           _default_rowset_type(BETA_ROWSET),
           _create_tablet_idx_lru_cache(
-                  new 
CreateTabletIdxCache(config::partition_disk_index_lru_size)),
+                  new 
CreateTabletRRIdxCache(config::partition_disk_index_lru_size)),
           _snapshot_mgr(std::make_unique<SnapshotManager>(*this)) {
     REGISTER_HOOK_METRIC(unused_rowsets_count, [this]() {
         // std::lock_guard<std::mutex> lock(_gc_mutex);
@@ -515,7 +515,7 @@ Status StorageEngine::set_cluster_id(int32_t cluster_id) {
 
 int StorageEngine::_get_and_set_next_disk_index(int64 partition_id,
                                                 TStorageMedium::type 
storage_medium) {
-    auto key = CreateTabletIdxCache::get_key(partition_id, storage_medium);
+    auto key = CreateTabletRRIdxCache::get_key(partition_id, storage_medium);
     int curr_index = _create_tablet_idx_lru_cache->get_index(key);
     // -1, lru can't find key
     if (curr_index == -1) {
@@ -1511,7 +1511,7 @@ Status StorageEngine::_persist_broken_paths() {
     return Status::OK();
 }
 
-int CreateTabletIdxCache::get_index(const std::string& key) {
+int CreateTabletRRIdxCache::get_index(const std::string& key) {
     auto* lru_handle = lookup(key);
     if (lru_handle) {
         Defer release([cache = this, lru_handle] { cache->release(lru_handle); 
});
@@ -1522,7 +1522,7 @@ int CreateTabletIdxCache::get_index(const std::string& 
key) {
     return -1;
 }
 
-void CreateTabletIdxCache::set_index(const std::string& key, int next_idx) {
+void CreateTabletRRIdxCache::set_index(const std::string& key, int next_idx) {
     assert(next_idx >= 0);
     auto* value = new CacheValue;
     value->idx = next_idx;
diff --git a/be/src/olap/storage_engine.h b/be/src/olap/storage_engine.h
index b2a313adcdb..421c0eb352d 100644
--- a/be/src/olap/storage_engine.h
+++ b/be/src/olap/storage_engine.h
@@ -69,7 +69,7 @@ class Thread;
 class ThreadPool;
 class TxnManager;
 class ReportWorker;
-class CreateTabletIdxCache;
+class CreateTabletRRIdxCache;
 struct DirInfo;
 class SnapshotManager;
 
@@ -532,7 +532,7 @@ private:
     // next index for create tablet
     std::map<TStorageMedium::type, int> _last_use_index;
 
-    std::unique_ptr<CreateTabletIdxCache> _create_tablet_idx_lru_cache;
+    std::unique_ptr<CreateTabletRRIdxCache> _create_tablet_idx_lru_cache;
 
     std::unique_ptr<SnapshotManager> _snapshot_mgr;
 };
@@ -540,7 +540,7 @@ private:
 // lru cache for create tabelt round robin in disks
 // key: partitionId_medium
 // value: index
-class CreateTabletIdxCache : public LRUCachePolicy {
+class CreateTabletRRIdxCache : public LRUCachePolicy {
 public:
     // get key, delimiter with DELIMITER '-'
     static std::string get_key(int64_t partition_id, TStorageMedium::type 
medium) {
@@ -557,10 +557,10 @@ public:
         int idx = 0;
     };
 
-    CreateTabletIdxCache(size_t capacity)
+    CreateTabletRRIdxCache(size_t capacity)
             : 
LRUCachePolicy(CachePolicy::CacheType::CREATE_TABLET_RR_IDX_CACHE, capacity,
                              LRUCacheType::NUMBER,
-                             /*stale_sweep_time_s*/ 30 * 60) {}
+                             /*stale_sweep_time_s*/ 30 * 60, 1) {}
 };
 
 struct DirInfo {
diff --git 
a/regression-test/suites/partition_p0/test_partition_create_tablet_rr.groovy 
b/regression-test/suites/partition_p0/test_partition_create_tablet_rr.groovy
index 836dff938f8..f31322facff 100644
--- a/regression-test/suites/partition_p0/test_partition_create_tablet_rr.groovy
+++ b/regression-test/suites/partition_p0/test_partition_create_tablet_rr.groovy
@@ -26,7 +26,8 @@ suite("test_partition_create_tablet_rr", "docker") {
     options.beConfigs += [
         'report_tablet_interval_seconds=1',
         'report_disk_state_interval_seconds=1',
-        "partition_disk_index_lru_size=$partition_disk_index_lru_size"
+        "partition_disk_index_lru_size=$partition_disk_index_lru_size",
+        'sys_log_verbose_modules=*'
     ]
     options.beDisks = ['HDD=4','SSD=4']
     options.enableDebugPoints()


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

Reply via email to