J-HowHuang commented on code in PR #19176:
URL: https://github.com/apache/pinot/pull/19176#discussion_r3779151108


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/DefaultRebalancePreChecker.java:
##########
@@ -327,22 +332,51 @@ protected RebalancePreCheckerResult 
checkDiskUtilization(PreCheckContext preChec
       long diskUtilizationGain = newSegmentSet.size() * avgSegmentSize;
       long diskUtilizationLoss = removedSegmentSet.size() * avgSegmentSize;
 
-      long diskUtilizationFootprint =
-          diskUsage.getUsedSpaceBytes() + diskUtilizationGain - (worstCase ? 0 
: diskUtilizationLoss);
-      double diskUtilizationFootprintRatio =
-          (double) diskUtilizationFootprint / diskUsage.getTotalSpaceBytes();
-
-      if (diskUtilizationFootprintRatio >= threshold) {
-        isDiskUtilSafe = false;
-        message.append(sep)
-            .append(server)
-            .append(String.format(" (%d%%)", (short) 
(diskUtilizationFootprintRatio * 100)));
-        sep = ", ";
-      }
+      // While the rebalance is running, the segments being added can co-exist 
with the ones being removed
+      addIfOverThreshold(serversUnsafeDuringRebalance, server,
+          (double) (diskUsage.getUsedSpaceBytes() + diskUtilizationGain) / 
diskUsage.getTotalSpaceBytes(), threshold);

Review Comment:
   In that case it would also fall into "unsafe AFTER rebalance", and will have 
the message of that.



-- 
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