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

eldenmoon pushed a commit to branch branch-2.0-var
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0-var by this push:
     new 8a6c847126c [branch-2.0-var](create tablet) add config for create 
tablet chose disk #27806 (#27816)
8a6c847126c is described below

commit 8a6c847126cfee5f252a38e60fd5876c902323ef
Author: yujun <[email protected]>
AuthorDate: Thu Nov 30 21:35:50 2023 +0800

    [branch-2.0-var](create tablet) add config for create tablet chose disk 
#27806 (#27816)
    
    * add config disk_diff_usage_percentage_for_create_tablet
    
    * update
    
    * Revert "update"
    
    This reverts commit fbd99f8f20bbd17562fe6c6e225b2eba5fbf6ca2.
---
 be/src/common/config.cpp       | 7 ++++++-
 be/src/common/config.h         | 5 +++++
 be/src/olap/storage_engine.cpp | 3 ++-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index afb8cb6feab..858c94b02ba 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -1108,8 +1108,13 @@ DEFINE_Int32(download_binlog_rate_limit_kbs, "0");
 DEFINE_mInt64(threshold_rows_to_estimate_sparse_column, "1000");
 
 DEFINE_mInt32(variant_max_merged_tablet_schema_size, "2048");
-// clang-format off
 
+// if difference of two disk usage is exceed this value,
+// then the new created tablet will not locate in the high use disk.
+// range: 0 ~ 100
+DEFINE_mInt32(disk_diff_usage_percentage_for_create_tablet, "20");
+
+// clang-format off
 #ifdef BE_TEST
 // test s3
 DEFINE_String(test_s3_resource, "resource");
diff --git a/be/src/common/config.h b/be/src/common/config.h
index 56a9c82b826..6a5001bac89 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -1170,6 +1170,11 @@ DECLARE_Int32(download_binlog_rate_limit_kbs);
 // The max columns size for a tablet schema
 DECLARE_mInt32(variant_max_merged_tablet_schema_size);
 
+// if difference of two disk usage is exceed this value,
+// then the new created tablet will not locate in the high use disk.
+// range: 0 ~ 100
+DECLARE_mInt32(disk_diff_usage_percentage_for_create_tablet);
+
 #ifdef BE_TEST
 // test s3
 DECLARE_String(test_s3_resource);
diff --git a/be/src/olap/storage_engine.cpp b/be/src/olap/storage_engine.cpp
index a4ecf33a0bb..bcd6b2eca7d 100644
--- a/be/src/olap/storage_engine.cpp
+++ b/be/src/olap/storage_engine.cpp
@@ -525,7 +525,8 @@ std::vector<DataDir*> 
StorageEngine::get_stores_for_create_tablet(
     }
 
     // if two disk available diff not exceeds 20% capacity, then they are the 
same available level.
-    size_t same_level_available_diff = std::max<size_t>(max_disk_capacity / 5, 
1);
+    size_t same_level_available_diff = std::max<size_t>(
+            max_disk_capacity * 
config::disk_diff_usage_percentage_for_create_tablet / 100, 1);
     int level = 0;
     size_t level_start_available = available_levels.rbegin()->first;
     for (auto rit = available_levels.rbegin(); rit != available_levels.rend(); 
rit++) {


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

Reply via email to