summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2020-03-16 16:06:59 +0100
committerGitHub <noreply@github.com>2020-03-16 16:06:59 +0100
commit7ec5934200cdffb5e17a083b6f56e9b4ae37246f (patch)
tree1125804ffe2a2a71f25b5f4ce103549833bea11e /controller-server
parentbb38b24402381dbaa2cd19ccada38400ee9c961e (diff)
parentb7dbb81891a2e81d8af0b1d082ec76a386449de1 (diff)
Merge pull request #12581 from vespa-engine/mpolden/disable-routing-generator-flag
Add feature flag for disabling RoutingGenerator
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/RoutingController.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/RoutingController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/RoutingController.java
index 1730f033d61..df62c501cc6 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/RoutingController.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/RoutingController.java
@@ -65,6 +65,7 @@ public class RoutingController {
private final RoutingPolicies routingPolicies;
private final RotationRepository rotationRepository;
private final BooleanFlag allowDirectRouting;
+ private final BooleanFlag disableRoutingGenerator;
public RoutingController(Controller controller, RotationsConfig rotationsConfig) {
this.controller = Objects.requireNonNull(controller, "controller must be non-null");
@@ -72,6 +73,7 @@ public class RoutingController {
this.rotationRepository = new RotationRepository(rotationsConfig, controller.applications(),
controller.curator());
this.allowDirectRouting = Flags.ALLOW_DIRECT_ROUTING.bindTo(controller.flagSource());
+ this.disableRoutingGenerator = Flags.DISABLE_ROUTING_GENERATOR.bindTo(controller.flagSource());
}
public RoutingPolicies policies() {
@@ -87,12 +89,17 @@ public class RoutingController {
var endpoints = new LinkedHashSet<Endpoint>();
// TODO(mpolden): Remove this once all applications have deployed once and config server passes correct cluster
// id for combined cluster type
- controller.serviceRegistry().routingGenerator().clusterEndpoints(deployment)
- .forEach((cluster, url) -> endpoints.add(Endpoint.of(deployment.applicationId())
- .target(cluster, deployment.zoneId())
- .routingMethod(RoutingMethod.shared)
- .on(Port.fromRoutingMethod(RoutingMethod.shared))
- .in(controller.system())));
+ var disableRoutingGenerator = this.disableRoutingGenerator.with(FetchVector.Dimension.APPLICATION_ID,
+ deployment.applicationId().serializedForm())
+ .value();
+ if (!disableRoutingGenerator) {
+ controller.serviceRegistry().routingGenerator().clusterEndpoints(deployment)
+ .forEach((cluster, url) -> endpoints.add(Endpoint.of(deployment.applicationId())
+ .target(cluster, deployment.zoneId())
+ .routingMethod(RoutingMethod.shared)
+ .on(Port.fromRoutingMethod(RoutingMethod.shared))
+ .in(controller.system())));
+ }
boolean hasSharedEndpoint = !endpoints.isEmpty();
// Avoid reading application more than once per call to this
var application = Suppliers.memoize(() -> controller.applications().requireApplication(TenantAndApplicationId.from(deployment.applicationId())));