klsince commented on code in PR #15029:
URL: https://github.com/apache/pinot/pull/15029#discussion_r1953233568


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/TableRebalancer.java:
##########
@@ -186,13 +190,21 @@ private RebalanceResult doRebalance(TableConfig 
tableConfig, RebalanceConfig reb
         && 
RoutingConfig.STRICT_REPLICA_GROUP_INSTANCE_SELECTOR_TYPE.equalsIgnoreCase(
         tableConfig.getRoutingConfig().getInstanceSelectorType());
     LOGGER.info(
-        "Start rebalancing table: {} with dryRun: {}, reassignInstances: {}, 
includeConsuming: {}, bootstrap: {}, "
-            + "downtime: {}, minReplicasToKeepUpForNoDowntime: {}, 
enableStrictReplicaGroup: {}, lowDiskMode: {}, "
-            + "bestEfforts: {}, externalViewCheckIntervalInMs: {}, 
externalViewStabilizationTimeoutInMs: {}",
-        tableNameWithType, dryRun, reassignInstances, includeConsuming, 
bootstrap, downtime,
+        "Start rebalancing table: {} with dryRun: {}, preChecks: {}, 
reassignInstances: {}, includeConsuming: {}, "
+            + "bootstrap: {}, downtime: {}, minReplicasToKeepUpForNoDowntime: 
{}, enableStrictReplicaGroup: {}, "
+            + "lowDiskMode: {}, bestEfforts: {}, 
externalViewCheckIntervalInMs: {}, "
+            + "externalViewStabilizationTimeoutInMs: {}",
+        tableNameWithType, dryRun, preChecks, reassignInstances, 
includeConsuming, bootstrap, downtime,
         minReplicasToKeepUpForNoDowntime, enableStrictReplicaGroup, 
lowDiskMode, bestEfforts,
         externalViewCheckIntervalInMs, externalViewStabilizationTimeoutInMs);
 
+    // Perform pre-checks if enabled
+    Map<String, String> preChecksResult = null;
+    if (preChecks && _pinotHelixResourceManager != null) {
+      preChecksResult = 
_pinotHelixResourceManager.getRebalancePreChecker().doRebalancePreChecks(rebalanceJobId,
+          tableNameWithType, tableConfig, _pinotHelixResourceManager);

Review Comment:
   I see it was changed to do prechecks only for dryRun mode. Then should this 
if-block get moved inside the dryrun if-block; or check dryRun flag here as 
well. So we don't do the check when dryRun is false.



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to