Browse Source

correctly handle the case with MaxInFlight > MaxMovements

correctly handle the case with MaxInFlight > MaxMovements

Pull Request resolved: https://github.com/ydb-platform/ydb/pull/476
vporyadke 1 year ago
parent
commit
5ddac82c51
1 changed files with 2 additions and 4 deletions
  1. 2 4
      ydb/core/mind/hive/balancer.cpp

+ 2 - 4
ydb/core/mind/hive/balancer.cpp

@@ -166,7 +166,8 @@ protected:
     }
     }
 
 
     bool CanKickNextTablet() const {
     bool CanKickNextTablet() const {
-        return KickInFlight < Settings.MaxInFlight;
+        return KickInFlight < Settings.MaxInFlight
+               && (Settings.MaxMovements == 0 || Movements < Settings.MaxMovements);
     }
     }
 
 
     void UpdateProgress() {
     void UpdateProgress() {
@@ -267,9 +268,6 @@ protected:
     }
     }
 
 
     void KickNextTablet() {
     void KickNextTablet() {
-        if (!CanKickNextTablet()) {
-            return;
-        }
         if (Settings.MaxMovements != 0 && Movements >= Settings.MaxMovements) {
         if (Settings.MaxMovements != 0 && Movements >= Settings.MaxMovements) {
             if (KickInFlight > 0) {
             if (KickInFlight > 0) {
                 return;
                 return;