aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2022-03-09 15:02:44 +0100
committerGitHub <noreply@github.com>2022-03-09 15:02:44 +0100
commit2a78ad7f8a5d8b2bca875f1a5be2183f5d27974c (patch)
treee8e234e0abc8ebc81291e2aa1db9b2f092fae50c
parent4f46b3a7d1c084bc3627b3137be70d2ca48a538f (diff)
parenta18996a3cb90a10f9efd53beb9ea68524db5b60f (diff)
Merge pull request #21616 from vespa-engine/jonmv/shorter-reconfig-timeout
Wait exactly 3 minutes for new servers
-rw-r--r--jdisc_core/src/main/java/com/yahoo/jdisc/application/DeactivatedContainer.java2
-rw-r--r--zookeeper-server/zookeeper-server-common/src/main/java/com/yahoo/vespa/zookeeper/Reconfigurer.java10
2 files changed, 5 insertions, 7 deletions
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/application/DeactivatedContainer.java b/jdisc_core/src/main/java/com/yahoo/jdisc/application/DeactivatedContainer.java
index f85f626d4b7..fa749d924d1 100644
--- a/jdisc_core/src/main/java/com/yahoo/jdisc/application/DeactivatedContainer.java
+++ b/jdisc_core/src/main/java/com/yahoo/jdisc/application/DeactivatedContainer.java
@@ -29,7 +29,7 @@ public interface DeactivatedContainer {
* DeactivatedContainer is considered to have terminated once there are no more {@link Request}s, {@link Response}s
* or corresponding {@link ContentChannel}s being processed by components that belong to it.</p>
*
- * <p>If termination has already occured, this method immediately runs the given Runnable in the current thread.</p>
+ * <p>If termination has already occurred, this method immediately runs the given Runnable in the current thread.</p>
*
* @param task The task to run once this DeactivatedContainer has terminated.
*/
diff --git a/zookeeper-server/zookeeper-server-common/src/main/java/com/yahoo/vespa/zookeeper/Reconfigurer.java b/zookeeper-server/zookeeper-server-common/src/main/java/com/yahoo/vespa/zookeeper/Reconfigurer.java
index 604419c063d..389df340ca7 100644
--- a/zookeeper-server/zookeeper-server-common/src/main/java/com/yahoo/vespa/zookeeper/Reconfigurer.java
+++ b/zookeeper-server/zookeeper-server-common/src/main/java/com/yahoo/vespa/zookeeper/Reconfigurer.java
@@ -29,8 +29,7 @@ public class Reconfigurer extends AbstractComponent {
private static final Logger log = java.util.logging.Logger.getLogger(Reconfigurer.class.getName());
- private static final Duration MIN_TIMEOUT = Duration.ofMinutes(3);
- private static final Duration NODE_TIMEOUT = Duration.ofMinutes(1);
+ private static final Duration TIMEOUT = Duration.ofMinutes(3);
private final ExponentialBackoff backoff = new ExponentialBackoff(Duration.ofSeconds(1), Duration.ofSeconds(10));
private final VespaZooKeeperAdmin vespaZooKeeperAdmin;
@@ -95,7 +94,7 @@ public class Reconfigurer extends AbstractComponent {
"\nServers in new config:" + servers(newConfig));
String connectionSpec = localConnectionSpec(activeConfig);
Instant now = Instant.now();
- Duration reconfigTimeout = reconfigTimeout(newConfig.server().size());
+ Duration reconfigTimeout = reconfigTimeout();
Instant end = now.plus(reconfigTimeout);
// Loop reconfiguring since we might need to wait until another reconfiguration is finished before we can succeed
for (int attempt = 1; now.isBefore(end); attempt++) {
@@ -129,11 +128,10 @@ public class Reconfigurer extends AbstractComponent {
Process.logAndDie("Reconfiguration did not complete within timeout " + reconfigTimeout + ". Forcing container shutdown.");
}
- /** Returns the timeout to use for the given joining server count */
- private static Duration reconfigTimeout(int joiningServers) {
+ private static Duration reconfigTimeout() {
// For reconfig to succeed, the current and resulting ensembles must have a majority. When an ensemble grows and
// the joining servers outnumber the existing ones, we have to wait for enough of them to start to have a majority.
- return Duration.ofMillis(Math.max(joiningServers * NODE_TIMEOUT.toMillis(), MIN_TIMEOUT.toMillis()));
+ return TIMEOUT;
}
private static String localConnectionSpec(ZookeeperServerConfig config) {