J-HowHuang commented on code in PR #15317:
URL: https://github.com/apache/pinot/pull/15317#discussion_r2013011691
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/OfflineClusterIntegrationTest.java:
##########
@@ -862,31 +881,45 @@ public void testRebalancePreChecks()
checkRebalancePreCheckStatus(rebalanceResult, RebalanceResult.Status.NO_OP,
"Instance assignment not allowed, no need for minimizeDataMovement",
RebalancePreCheckerResult.PreCheckStatus.PASS, "Reload needed prior to
running rebalance",
- RebalancePreCheckerResult.PreCheckStatus.WARN);
+ RebalancePreCheckerResult.PreCheckStatus.WARN, "",
RebalancePreCheckerResult.PreCheckStatus.PASS);
// Keep schema change and update table config to add minimizeDataMovement
tableConfig.setInstanceAssignmentConfigMap(createInstanceAssignmentConfigMap(true));
rebalanceResult = _tableRebalancer.rebalance(tableConfig, rebalanceConfig,
null);
checkRebalancePreCheckStatus(rebalanceResult, RebalanceResult.Status.NO_OP,
"minimizeDataMovement is enabled",
RebalancePreCheckerResult.PreCheckStatus.PASS,
- "Reload needed prior to running rebalance",
RebalancePreCheckerResult.PreCheckStatus.WARN);
+ "Reload needed prior to running rebalance",
RebalancePreCheckerResult.PreCheckStatus.WARN, "",
+ RebalancePreCheckerResult.PreCheckStatus.PASS);
// Keep schema change and update table config to add instance config map
with minimizeDataMovement = false
tableConfig.setInstanceAssignmentConfigMap(createInstanceAssignmentConfigMap(false));
rebalanceResult = _tableRebalancer.rebalance(tableConfig, rebalanceConfig,
null);
checkRebalancePreCheckStatus(rebalanceResult, RebalanceResult.Status.NO_OP,
- "minimizeDataMovement is not enabled but instance assignment is
allowed",
- RebalancePreCheckerResult.PreCheckStatus.WARN, "Reload needed prior to
running rebalance",
- RebalancePreCheckerResult.PreCheckStatus.WARN);
+ "minimizeDataMovement is enabled",
+ RebalancePreCheckerResult.PreCheckStatus.PASS, "Reload needed prior to
running rebalance",
+ RebalancePreCheckerResult.PreCheckStatus.WARN, "",
RebalancePreCheckerResult.PreCheckStatus.PASS);
// Add a new server (to force change in instance assignment) and enable
reassignInstances
- BaseServerStarter serverStarter1 = startOneServer(NUM_SERVERS);
+ BaseServerStarter serverStarter1 = startOneServer(NUM_SERVERS + 1);
rebalanceConfig.setReassignInstances(true);
+ rebalanceConfig.setMinAvailableReplicas(-1);
tableConfig.setInstanceAssignmentConfigMap(null);
rebalanceResult = _tableRebalancer.rebalance(tableConfig, rebalanceConfig,
null);
checkRebalancePreCheckStatus(rebalanceResult, RebalanceResult.Status.DONE,
"Instance assignment not allowed, no need for minimizeDataMovement",
RebalancePreCheckerResult.PreCheckStatus.PASS, "Reload needed prior to
running rebalance",
+ RebalancePreCheckerResult.PreCheckStatus.WARN,
+ "", RebalancePreCheckerResult.PreCheckStatus.PASS);
+
+ // Rebalance is expected to fail because there's one available replica.
Rebalance config check should warn
+ rebalanceConfig.setMinAvailableReplicas(getNumReplicas());
+ rebalanceResult = _tableRebalancer.rebalance(tableConfig, rebalanceConfig,
null);
+ checkRebalancePreCheckStatus(rebalanceResult, RebalanceResult.Status.DONE,
+ "Instance assignment not allowed, no need for minimizeDataMovement",
+ RebalancePreCheckerResult.PreCheckStatus.PASS, "Reload needed prior to
running rebalance",
+ RebalancePreCheckerResult.PreCheckStatus.WARN,
+ "The number of replicas (" + getNumReplicas()
Review Comment:
They're tested in `TableRebalancerClusterStatelessTest`
--
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]