wardlican commented on code in PR #3950:
URL: https://github.com/apache/amoro/pull/3950#discussion_r3007302404
##########
amoro-optimizer/amoro-optimizer-common/src/main/java/org/apache/amoro/optimizer/common/OptimizerExecutor.java:
##########
@@ -49,6 +53,112 @@ public OptimizerExecutor(OptimizerConfig config, int
threadId) {
}
public void start() {
+ // Check if in master-slave mode (node manager initialised for either ZK
or DB HA)
+ boolean isMasterSlaveMode = getConfig().isMasterSlaveMode() &&
hasAmsNodeManager();
+
+ if (isMasterSlaveMode) {
+ // Master-slave mode: get node list and process tasks from each node
+ startMasterSlaveMode();
+ } else {
+ // Active-standby mode: use original logic
+ startSingleNodeMode();
+ }
+ }
+
+ /** Start in master-slave mode: get node list and process tasks from each
AMS node. */
+ private void startMasterSlaveMode() {
+ // Dynamic polling interval control
+ long basePollInterval = TimeUnit.SECONDS.toMillis(1); // Base interval: 1
second
+ long maxPollInterval = TimeUnit.SECONDS.toMillis(30); // Max interval: 10
seconds
Review Comment:
Remove the inner upper bound of `Math.min(backoffFactor, 3)` to allow the
backoff to truly utilize `maxPollInterval`.
Following the fix, the actual progress of the backoff is as follows:
+1 | 2s
-- | --
+2 | 4s
+3 | 8s
+4 | 16s
+5 | 30s(maxPollInterval limit is in effect.)
+6 | 30s
--
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]