summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/ConfigServerBootstrapTest.java15
-rw-r--r--container-core/abi-spec.json1
-rw-r--r--container-core/src/main/java/com/yahoo/container/handler/ClustersStatus.java10
-rw-r--r--container-core/src/main/java/com/yahoo/container/handler/VipStatus.java11
-rw-r--r--container-core/src/main/resources/configdefinitions/vip-status.def2
5 files changed, 18 insertions, 21 deletions
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/ConfigServerBootstrapTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/ConfigServerBootstrapTest.java
index 281933e8943..df295b2d38b 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/ConfigServerBootstrapTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/ConfigServerBootstrapTest.java
@@ -72,7 +72,7 @@ public class ConfigServerBootstrapTest {
RpcServer rpcServer = createRpcServer(configserverConfig);
// Take a host away so that there are too few for the application, to verify we can still bootstrap
provisioner.allocations().values().iterator().next().remove(0);
- VipStatus vipStatus = createVipStatus(VIP_STATUS_PROGRAMMATICALLY);
+ VipStatus vipStatus = createVipStatus();
ConfigServerBootstrap bootstrap = new ConfigServerBootstrap(tester.applicationRepository(), rpcServer,
versionState, createStateMonitor(),
vipStatus, INITIALIZE_ONLY, VIP_STATUS_PROGRAMMATICALLY);
@@ -102,7 +102,7 @@ public class ConfigServerBootstrapTest {
assertTrue(versionState.isUpgraded());
RpcServer rpcServer = createRpcServer(configserverConfig);
- VipStatus vipStatus = createVipStatus(VIP_STATUS_FILE);
+ VipStatus vipStatus = createVipStatus();
ConfigServerBootstrap bootstrap = new ConfigServerBootstrap(tester.applicationRepository(), rpcServer,
versionState, createStateMonitor(),
vipStatus, INITIALIZE_ONLY, VIP_STATUS_FILE);
@@ -132,7 +132,7 @@ public class ConfigServerBootstrapTest {
.resolve("sessions/2/services.xml"));
RpcServer rpcServer = createRpcServer(configserverConfig);
- VipStatus vipStatus = createVipStatus(VIP_STATUS_PROGRAMMATICALLY);
+ VipStatus vipStatus = createVipStatus();
ConfigServerBootstrap bootstrap = new ConfigServerBootstrap(tester.applicationRepository(), rpcServer, versionState,
createStateMonitor(),
vipStatus, INITIALIZE_ONLY, VIP_STATUS_PROGRAMMATICALLY);
@@ -174,7 +174,7 @@ public class ConfigServerBootstrapTest {
curator.set(Path.fromString("/config/v2/tenants/" + applicationId.tenant().value() + "/sessions/2/version"), Utf8.toBytes("1.2.2"));
RpcServer rpcServer = createRpcServer(configserverConfig);
- VipStatus vipStatus = createVipStatus(VIP_STATUS_PROGRAMMATICALLY);
+ VipStatus vipStatus = createVipStatus();
ConfigServerBootstrap bootstrap = new ConfigServerBootstrap(tester.applicationRepository(), rpcServer, versionState,
createStateMonitor(), vipStatus,
BOOTSTRAP_IN_SEPARATE_THREAD, VIP_STATUS_PROGRAMMATICALLY);
@@ -229,13 +229,8 @@ public class ConfigServerBootstrapTest {
return new Host(hostname, Collections.emptyList(), Optional.empty(), Optional.of(com.yahoo.component.Version.fromString(version)));
}
- private VipStatus createVipStatus(ConfigServerBootstrap.VipStatusMode vipStatusMode) throws IOException {
+ private VipStatus createVipStatus() {
return new VipStatus(new QrSearchersConfig.Builder().build(),
- new VipStatusConfig.Builder()
- .initiallyInRotation(vipStatusMode == VIP_STATUS_FILE)
- .statusfile(temporaryFolder.newFile().getAbsolutePath())
- .accessdisk(vipStatusMode == VIP_STATUS_FILE)
- .build(),
new ClustersStatus());
}
diff --git a/container-core/abi-spec.json b/container-core/abi-spec.json
index dc13bd1807d..f8233569e28 100644
--- a/container-core/abi-spec.json
+++ b/container-core/abi-spec.json
@@ -241,6 +241,7 @@
"public void <init>()",
"public void <init>(com.yahoo.container.QrSearchersConfig)",
"public void <init>(com.yahoo.container.handler.ClustersStatus)",
+ "public void <init>(com.yahoo.container.QrSearchersConfig, com.yahoo.container.handler.ClustersStatus)",
"public void <init>(com.yahoo.container.QrSearchersConfig, com.yahoo.container.core.VipStatusConfig, com.yahoo.container.handler.ClustersStatus)",
"public void setInRotation(java.lang.Boolean)",
"public void addToRotation(java.lang.String)",
diff --git a/container-core/src/main/java/com/yahoo/container/handler/ClustersStatus.java b/container-core/src/main/java/com/yahoo/container/handler/ClustersStatus.java
index 4f4d4635933..23d219df340 100644
--- a/container-core/src/main/java/com/yahoo/container/handler/ClustersStatus.java
+++ b/container-core/src/main/java/com/yahoo/container/handler/ClustersStatus.java
@@ -26,9 +26,6 @@ public class ClustersStatus extends AbstractComponent {
/** Are there any (in-service influencing) clusters in this container? */
private boolean containerHasClusters;
- /** If we have no clusters, what should we answer? */
- private boolean receiveTrafficByDefault;
-
private final Object mutex = new Object();
/** The status of clusters, when known. Note that clusters may exist for which there is no knowledge yet. */
@@ -42,10 +39,9 @@ public class ClustersStatus extends AbstractComponent {
}
}
+ /** @deprecated this is ignored */
+ @Deprecated // TODO: remove on Vespa 8
public void setReceiveTrafficByDefault(boolean receiveTrafficByDefault) {
- synchronized (mutex) {
- this.receiveTrafficByDefault = receiveTrafficByDefault;
- }
}
void setUp(String clusterIdentifier) {
@@ -80,7 +76,7 @@ public class ClustersStatus extends AbstractComponent {
return clusterStatus.values().stream().anyMatch(status -> status==true);
}
else {
- return receiveTrafficByDefault;
+ return true;
}
}
}
diff --git a/container-core/src/main/java/com/yahoo/container/handler/VipStatus.java b/container-core/src/main/java/com/yahoo/container/handler/VipStatus.java
index 3b71ffff616..a0a27ec942f 100644
--- a/container-core/src/main/java/com/yahoo/container/handler/VipStatus.java
+++ b/container-core/src/main/java/com/yahoo/container/handler/VipStatus.java
@@ -24,7 +24,7 @@ public class VipStatus {
}
public VipStatus(QrSearchersConfig dispatchers) {
- this(dispatchers, new VipStatusConfig(new VipStatusConfig.Builder()), new ClustersStatus());
+ this(dispatchers, new ClustersStatus());
}
public VipStatus(ClustersStatus clustersStatus) {
@@ -32,12 +32,17 @@ public class VipStatus {
}
@Inject
- public VipStatus(QrSearchersConfig dispatchers, VipStatusConfig vipStatusConfig, ClustersStatus clustersStatus) {
+ public VipStatus(QrSearchersConfig dispatchers, ClustersStatus clustersStatus) {
this.clustersStatus = clustersStatus;
- clustersStatus.setReceiveTrafficByDefault(vipStatusConfig.initiallyInRotation());
clustersStatus.setContainerHasClusters(! dispatchers.searchcluster().isEmpty());
}
+ /** @deprecated don't pass VipStatusConfig */
+ @Deprecated // TODO: Remove on Vespa 8
+ public VipStatus(QrSearchersConfig dispatchers, VipStatusConfig vipStatusConfig, ClustersStatus clustersStatus) {
+ this(dispatchers, clustersStatus);
+ }
+
/**
* Explicitly set this container in or out of rotation
*
diff --git a/container-core/src/main/resources/configdefinitions/vip-status.def b/container-core/src/main/resources/configdefinitions/vip-status.def
index ed7ab3e4802..a042f5915c2 100644
--- a/container-core/src/main/resources/configdefinitions/vip-status.def
+++ b/container-core/src/main/resources/configdefinitions/vip-status.def
@@ -8,5 +8,5 @@ accessdisk bool default=false
## If the path is relative vespa home is prepended
statusfile string default="share/qrsdocs/status.html"
-## The default rotation state when there are no configured clusters to decide rotation state
+## Not used TODO: Remove on Vespa 8
initiallyInRotation bool default=true