summaryrefslogtreecommitdiffstats
path: root/container-core
diff options
context:
space:
mode:
authorgjoranv <gv@oath.com>2018-09-13 11:09:20 +0200
committergjoranv <gv@oath.com>2019-01-21 15:09:21 +0100
commit9836d47fdcbdce1e45908bf58ba4c34f53efe81a (patch)
tree24c95f20c37d91949c5a4762b6c27481f8aa90a3 /container-core
parent917251aaa8313e33571413864fea82fbe4836144 (diff)
Remove config param noSearchBackendsImpliesOutOfService
Diffstat (limited to 'container-core')
-rw-r--r--container-core/src/main/java/com/yahoo/container/handler/VipStatusHandler.java7
-rw-r--r--container-core/src/main/resources/configdefinitions/vip-status.def6
-rw-r--r--container-core/src/test/java/com/yahoo/container/handler/VipStatusHandlerTestCase.java15
3 files changed, 9 insertions, 19 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/handler/VipStatusHandler.java b/container-core/src/main/java/com/yahoo/container/handler/VipStatusHandler.java
index 60affddeb60..c8cf575dff3 100644
--- a/container-core/src/main/java/com/yahoo/container/handler/VipStatusHandler.java
+++ b/container-core/src/main/java/com/yahoo/container/handler/VipStatusHandler.java
@@ -38,7 +38,6 @@ public final class VipStatusHandler extends ThreadedHttpRequestHandler {
private final boolean accessDisk;
private final File statusFile;
private final VipStatus vipStatus;
- private final boolean noSearchBackendsImpliesOutOfService;
private volatile boolean previouslyInRotation = true;
@@ -57,7 +56,7 @@ public final class VipStatusHandler extends ThreadedHttpRequestHandler {
private StatusResponse() {
super(com.yahoo.jdisc.http.HttpResponse.Status.OK); // status may be overwritten below
- if (noSearchBackendsImpliesOutOfService && !vipStatus.isInRotation()) {
+ if (vipStatus != null && ! vipStatus.isInRotation()) {
searchContainerOutOfService();
} else if (accessDisk) {
preSlurpFile();
@@ -179,7 +178,6 @@ public final class VipStatusHandler extends ThreadedHttpRequestHandler {
super(executor, metric);
this.accessDisk = vipConfig.accessdisk();
this.statusFile = new File(Defaults.getDefaults().underVespaHome(vipConfig.statusfile()));
- this.noSearchBackendsImpliesOutOfService = vipConfig.noSearchBackendsImpliesOutOfService();
this.vipStatus = vipStatus;
}
@@ -187,9 +185,8 @@ public final class VipStatusHandler extends ThreadedHttpRequestHandler {
public HttpResponse handle(HttpRequest request) {
if (metric != null)
metric.add(NUM_REQUESTS_METRIC, 1, null);
- if (noSearchBackendsImpliesOutOfService) {
+ if (vipStatus != null)
updateAndLogRotationState();
- }
return new StatusResponse();
}
diff --git a/container-core/src/main/resources/configdefinitions/vip-status.def b/container-core/src/main/resources/configdefinitions/vip-status.def
index 6aa10ff1b90..ed7ab3e4802 100644
--- a/container-core/src/main/resources/configdefinitions/vip-status.def
+++ b/container-core/src/main/resources/configdefinitions/vip-status.def
@@ -1,12 +1,6 @@
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
namespace=container.core
-## If there is a Vespa search backend connected to this container, and that
-## backend is out of service, automatically remove this container from VIP
-## rotation, ignoring any status file.
-## TODO VESPA 7: This is always true and can be removed
-noSearchBackendsImpliesOutOfService bool default=true
-
## Whether to return hard-coded reply or serve "status.html" from disk
accessdisk bool default=false
diff --git a/container-core/src/test/java/com/yahoo/container/handler/VipStatusHandlerTestCase.java b/container-core/src/test/java/com/yahoo/container/handler/VipStatusHandlerTestCase.java
index f8de32ee3ff..de9289a1e9d 100644
--- a/container-core/src/test/java/com/yahoo/container/handler/VipStatusHandlerTestCase.java
+++ b/container-core/src/test/java/com/yahoo/container/handler/VipStatusHandlerTestCase.java
@@ -53,8 +53,7 @@ public class VipStatusHandlerTestCase {
@Test
public void testHandleRequest() {
- VipStatusConfig config = new VipStatusConfig(new VipStatusConfig.Builder().accessdisk(false)
- .noSearchBackendsImpliesOutOfService(false));
+ VipStatusConfig config = new VipStatusConfig(new VipStatusConfig.Builder().accessdisk(false));
VipStatusHandler handler = new VipStatusHandler(Executors.newCachedThreadPool(), config, metric);
MockResponseHandler responseHandler = new MockResponseHandler();
HttpRequest request = createRequest();
@@ -81,8 +80,7 @@ public class VipStatusHandlerTestCase {
@Test
public void testFileNotFound() {
VipStatusConfig config = new VipStatusConfig(new VipStatusConfig.Builder().accessdisk(true)
- .statusfile("/VipStatusHandlerTestCaseFileThatReallyReallyShouldNotExist")
- .noSearchBackendsImpliesOutOfService(false));
+ .statusfile("/VipStatusHandlerTestCaseFileThatReallyReallyShouldNotExist"));
VipStatusHandler handler = new VipStatusHandler(Executors.newCachedThreadPool(), config, metric);
NotFoundResponseHandler responseHandler = new NotFoundResponseHandler();
HttpRequest request = createRequest();
@@ -104,8 +102,10 @@ public class VipStatusHandlerTestCase {
String OK = "OK\n";
writer.write(OK);
writer.close();
- VipStatusConfig config = new VipStatusConfig(new VipStatusConfig.Builder().accessdisk(true)
- .statusfile(statusFile.getAbsolutePath()).noSearchBackendsImpliesOutOfService(false));
+ VipStatusConfig config = new VipStatusConfig(
+ new VipStatusConfig.Builder()
+ .accessdisk(true)
+ .statusfile(statusFile.getAbsolutePath()));
VipStatusHandler handler = new VipStatusHandler(Executors.newCachedThreadPool(), config, metric);
MockResponseHandler responseHandler = new MockResponseHandler();
HttpRequest request = createRequest();
@@ -123,8 +123,7 @@ public class VipStatusHandlerTestCase {
@Test
public void testExplicitlyRotationControl() {
VipStatus vipStatus = new VipStatus();
- VipStatusConfig config = new VipStatusConfig(new VipStatusConfig.Builder().accessdisk(false)
- .noSearchBackendsImpliesOutOfService(true));
+ VipStatusConfig config = new VipStatusConfig(new VipStatusConfig.Builder().accessdisk(false));
VipStatusHandler handler = new VipStatusHandler(Executors.newCachedThreadPool(), config, metric, vipStatus);
vipStatus.setInRotation(false);