Jackie-Jiang commented on code in PR #13863: URL: https://github.com/apache/pinot/pull/13863#discussion_r1733735193
########## pinot-controller/src/main/java/org/apache/pinot/controller/ControllerConf.java: ########## @@ -178,6 +178,17 @@ public static class ControllerPeriodicTasksConf { public static final String DEPRECATED_SEGMENT_RELOCATOR_FREQUENCY_IN_SECONDS = "controller.segment.relocator.frequencyInSeconds"; public static final String SEGMENT_RELOCATOR_FREQUENCY_PERIOD = "controller.segment.relocator.frequencyPeriod"; + + //whether segment relocator should do a best-efforts rebalance. Default is 'true' + public static final String SEGMENT_RELOCATOR_BEST_EFFORTS = "controller.segment.relocator.bestEfforts"; + //For no-downtime rebalance, minimum number of replicas to keep alive during rebalance, or maximum number of + // replicas allowed to be unavailable if value is negative. Default value is -1 Review Comment: We should explain here that `-1` stands for only allowing one replica down during rebalance ########## pinot-controller/src/main/java/org/apache/pinot/controller/ControllerConf.java: ########## @@ -178,6 +178,17 @@ public static class ControllerPeriodicTasksConf { public static final String DEPRECATED_SEGMENT_RELOCATOR_FREQUENCY_IN_SECONDS = "controller.segment.relocator.frequencyInSeconds"; public static final String SEGMENT_RELOCATOR_FREQUENCY_PERIOD = "controller.segment.relocator.frequencyPeriod"; + + //whether segment relocator should do a best-efforts rebalance. Default is 'true' + public static final String SEGMENT_RELOCATOR_BEST_EFFORTS = "controller.segment.relocator.bestEfforts"; + //For no-downtime rebalance, minimum number of replicas to keep alive during rebalance, or maximum number of + // replicas allowed to be unavailable if value is negative. Default value is -1 + public static final String SEGMENT_RELOCATOR_MIN_AVAIL_REPLICAS = Review Comment: ```suggestion public static final String SEGMENT_RELOCATOR_MIN_AVAILABLE_REPLICAS = ``` ########## pinot-controller/src/main/java/org/apache/pinot/controller/ControllerConf.java: ########## @@ -689,6 +700,31 @@ public int getSegmentRelocatorFrequencyInSeconds() { }); } + public boolean getSegmentRelocatorRebalanceConfigBestEfforts() { Review Comment: Same for other method names to match the config ```suggestion public boolean getSegmentRelocatorBestEfforts() { ``` ########## pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/relocation/SegmentRelocator.java: ########## @@ -66,6 +66,13 @@ public class SegmentRelocator extends ControllerPeriodicTask<Void> { private final boolean _enableLocalTierMigration; private final int _serverAdminRequestTimeoutMs; private final long _externalViewCheckIntervalInMs; + + private final boolean _bestEffortsRebalance; Review Comment: Let's keep the order and name the same as `RebalanceConfig` ########## pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/relocation/SegmentRelocator.java: ########## @@ -169,6 +181,12 @@ private void rebalanceTable(String tableNameWithType) { rebalanceConfig.setExternalViewCheckIntervalInMs(_externalViewCheckIntervalInMs); rebalanceConfig.setExternalViewStabilizationTimeoutInMs(_externalViewStabilizationTimeoutInMs); rebalanceConfig.setUpdateTargetTier(TierConfigUtils.shouldRelocateToTiers(tableConfig)); + //Do not fail the rebalance when the no-downtime contract cannot be achieved + rebalanceConfig.setBestEfforts(_bestEffortsRebalance); + rebalanceConfig.setReassignInstances(_reassignInstancesDuringRebalance); + rebalanceConfig.setBootstrap(_bootstrapServersDuringRebalance); + rebalanceConfig.setMinAvailableReplicas(_minAvailReplicasDuringRebalance); Review Comment: This is set twice ########## pinot-controller/src/main/java/org/apache/pinot/controller/ControllerConf.java: ########## @@ -178,6 +178,17 @@ public static class ControllerPeriodicTasksConf { public static final String DEPRECATED_SEGMENT_RELOCATOR_FREQUENCY_IN_SECONDS = "controller.segment.relocator.frequencyInSeconds"; public static final String SEGMENT_RELOCATOR_FREQUENCY_PERIOD = "controller.segment.relocator.frequencyPeriod"; + + //whether segment relocator should do a best-efforts rebalance. Default is 'true' + public static final String SEGMENT_RELOCATOR_BEST_EFFORTS = "controller.segment.relocator.bestEfforts"; + //For no-downtime rebalance, minimum number of replicas to keep alive during rebalance, or maximum number of + // replicas allowed to be unavailable if value is negative. Default value is -1 + public static final String SEGMENT_RELOCATOR_MIN_AVAIL_REPLICAS = + "controller.segment.relocator.minAvailableReplicas"; + public static final String SEGMENT_RELOCATOR_REASSIGN_INSTANCES = "controller.segment.relocator.reassignInstances"; + public static final String SEGMENT_RELOCATOR_BOOTSTRAP_SERVERS = "controller.segment.relocator.bootstrap"; Review Comment: ```suggestion public static final String SEGMENT_RELOCATOR_BOOTSTRAP = "controller.segment.relocator.bootstrap"; ``` -- 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