summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2021-07-10 17:36:55 +0200
committerGitHub <noreply@github.com>2021-07-10 17:36:55 +0200
commit3c622e2a9ae7d0a46701c267972cac411ec3ca37 (patch)
treef0f792805216ab1d0b4adb039efade97f4ab0a81
parent5376fe6a6d8b8b875f272f1fba131a847ac6a65c (diff)
parent51e10d722c91df4b22cf350226a88f3f03796aa5 (diff)
Merge pull request #18587 from vespa-engine/hmusum/increase-session-timeout
-rw-r--r--configdefinitions/src/vespa/zookeeper-server.def4
-rw-r--r--zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java7
-rw-r--r--zookeeper-server/zookeeper-server-common/src/test/java/com/yahoo/vespa/zookeeper/ConfiguratorTest.java4
3 files changed, 10 insertions, 5 deletions
diff --git a/configdefinitions/src/vespa/zookeeper-server.def b/configdefinitions/src/vespa/zookeeper-server.def
index 006e266916c..b08fc8eeafe 100644
--- a/configdefinitions/src/vespa/zookeeper-server.def
+++ b/configdefinitions/src/vespa/zookeeper-server.def
@@ -6,8 +6,8 @@ zooKeeperConfigFile string default="conf/zookeeper/zookeeper.cfg"
# For more info about the values below, see ZooKeeper documentation
-# tick time in milliseconds
-tickTime int default=2000
+# tick time in milliseconds, min and max session timeout are 2 and 20 times this value
+tickTime int default=6000
initLimit int default=20
syncLimit int default=15
maxClientConnections int default=0
diff --git a/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java b/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java
index 9a6ef3f74f1..414a18eb56d 100644
--- a/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java
+++ b/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.curator;
import com.google.inject.Inject;
@@ -54,7 +54,10 @@ public class Curator implements VespaCurator, AutoCloseable {
private static final Logger LOG = Logger.getLogger(Curator.class.getName());
private static final File ZK_CLIENT_CONFIG_FILE = new File(Defaults.getDefaults().underVespaHome("conf/zookeeper/zookeeper-client.cfg"));
- private static final Duration ZK_SESSION_TIMEOUT = Duration.ofSeconds(30);
+
+ // Note that session timeout has min and max values are related to tickTime defined by server, see configserver.def
+ private static final Duration ZK_SESSION_TIMEOUT = Duration.ofSeconds(120);
+
private static final Duration ZK_CONNECTION_TIMEOUT = Duration.ofSeconds(30);
private static final Duration BASE_SLEEP_TIME = Duration.ofSeconds(1);
private static final int MAX_RETRIES = 10;
diff --git a/zookeeper-server/zookeeper-server-common/src/test/java/com/yahoo/vespa/zookeeper/ConfiguratorTest.java b/zookeeper-server/zookeeper-server-common/src/test/java/com/yahoo/vespa/zookeeper/ConfiguratorTest.java
index c40b7cb7b52..ae84ff12b3b 100644
--- a/zookeeper-server/zookeeper-server-common/src/test/java/com/yahoo/vespa/zookeeper/ConfiguratorTest.java
+++ b/zookeeper-server/zookeeper-server-common/src/test/java/com/yahoo/vespa/zookeeper/ConfiguratorTest.java
@@ -70,6 +70,7 @@ public class ConfiguratorTest {
builder.server(newServer(2, "baz", 345, 543, true));
builder.myidFile(idFile.getAbsolutePath());
builder.myid(1);
+ builder.tickTime(1234);
new Configurator(builder.build()).writeConfigToDisk(VespaTlsConfig.tlsDisabled());
validateConfigFileMultipleHosts(cfgFile);
validateIdFile(idFile, "1\n");
@@ -127,6 +128,7 @@ public class ConfiguratorTest {
builder.myidFile(idFile.getAbsolutePath());
builder.server(newServer(0, "foo", 123, 321, false));
builder.myid(0);
+ builder.tickTime(1234);
return builder;
}
@@ -146,7 +148,7 @@ public class ConfiguratorTest {
}
private String commonConfig() {
- return "tickTime=2000\n" +
+ return "tickTime=1234\n" +
"initLimit=20\n" +
"syncLimit=15\n" +
"maxClientCnxns=0\n" +