deardeng commented on code in PR #30354:
URL: https://github.com/apache/doris/pull/30354#discussion_r1465842662


##########
be/src/olap/storage_engine.cpp:
##########
@@ -489,11 +491,44 @@ void 
StorageEngine::_get_candidate_stores(TStorageMedium::type storage_medium,
                 !data_dir->reach_capacity_limit(0)) {
                 DirInfo dir_info;
                 dir_info.data_dir = data_dir;
-                dir_info.available_level = 
get_available_level(data_dir->get_usage(0));

Review Comment:
   get_available_level can remove ?



##########
be/src/olap/storage_engine.cpp:
##########
@@ -489,11 +491,44 @@ void 
StorageEngine::_get_candidate_stores(TStorageMedium::type storage_medium,
                 !data_dir->reach_capacity_limit(0)) {
                 DirInfo dir_info;
                 dir_info.data_dir = data_dir;
-                dir_info.available_level = 
get_available_level(data_dir->get_usage(0));
+                dir_info.available_level = 0;
+                usages.push_back(data_dir->get_usage(0));
                 dir_infos.push_back(dir_info);
             }
         }
     }
+
+    DBUG_EXECUTE_IF("StorageEngine.get_candidate_stores.all_disk_same_level", 
return);
+
+    if (dir_infos.size() <= 1) {
+        return;
+    }
+
+    std::sort(usages.begin(), usages.end());
+    if (usages.back() < 0.7) {
+        return;
+    }
+
+    std::vector<double> level_max_usages;
+    level_max_usages.push_back(usages[0]);
+    for (auto usage : usages) {
+        if (usage < 0.7 - (config.high_disk_avail_level_diff_usages / 2.0)) {
+            continue;
+        }
+
+        if (usage > level_max_usages.back() + 
config::high_disk_avail_level_diff_usages) {
+            level_max_usages.push_back(usage);
+        }
+    }
+    for (auto& dir_info : dir_infos) {

Review Comment:
   add some comment? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to