summaryrefslogtreecommitdiffstats
path: root/zookeeper-server
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2020-12-07 14:23:28 +0100
committerHarald Musum <musum@verizonmedia.com>2020-12-07 14:23:28 +0100
commit7e7b7c72b7ca4131f6f29efa0f9d63f857d9f369 (patch)
treea037b007b9c4cb81b247d8d14227d74374f4bbb3 /zookeeper-server
parentf98e158a6f61cd39029f439da903f10e75e4c3fa (diff)
parent72a1848f3d752aa16495fe39a3ebd58463b9b277 (diff)
Merge branch 'master' into hmusum/refactor-reconfigurer
Diffstat (limited to 'zookeeper-server')
-rw-r--r--zookeeper-server/zookeeper-server-3.5.6/src/main/java/com/yahoo/vespa/zookeeper/Reconfigurer.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/zookeeper-server/zookeeper-server-3.5.6/src/main/java/com/yahoo/vespa/zookeeper/Reconfigurer.java b/zookeeper-server/zookeeper-server-3.5.6/src/main/java/com/yahoo/vespa/zookeeper/Reconfigurer.java
index 89c29a642d4..90de4a9472e 100644
--- a/zookeeper-server/zookeeper-server-3.5.6/src/main/java/com/yahoo/vespa/zookeeper/Reconfigurer.java
+++ b/zookeeper-server/zookeeper-server-3.5.6/src/main/java/com/yahoo/vespa/zookeeper/Reconfigurer.java
@@ -89,10 +89,9 @@ public class Reconfigurer extends AbstractComponent {
". Joining servers: " + joiningServers + ", leaving servers: " + leavingServers);
sleeper.accept(reconfigWaitPeriod());
String connectionSpec = connectionSpec(activeConfig);
- boolean reconfigured = false;
Instant end = Instant.now().plus(reconfigTimeout);
// Loop reconfiguring since we might need to wait until another reconfiguration is finished before we can succeed
- for (int attempts = 1; ! reconfigured && Instant.now().isBefore(end); attempts++) {
+ for (int attempts = 1; Instant.now().isBefore(end); attempts++) {
try {
Instant reconfigStarted = Instant.now();
zkAdmin.reconfigure(connectionSpec, joiningServers, leavingServers);
@@ -101,14 +100,14 @@ public class Reconfigurer extends AbstractComponent {
Duration.between(reconfigTriggered, reconfigEnded) +
", after " + attempts + " attempt(s). ZooKeeper reconfig call took " +
Duration.between(reconfigStarted, reconfigEnded));
- reconfigured = true;
+ activeConfig = newConfig;
+ return;
} catch (ReconfigException e) {
log.log(Level.INFO, "Reconfiguration failed. Retrying in " + retryWait + ": " +
Exceptions.toMessageString(e));
sleeper.accept(retryWait);
}
}
- activeConfig = newConfig;
}
/** Returns how long this node should wait before reconfiguring the cluster */