summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2020-03-16 15:05:13 +0100
committerMartin Polden <mpolden@mpolden.no>2020-03-16 15:05:13 +0100
commitb7dbb81891a2e81d8af0b1d082ec76a386449de1 (patch)
tree1ba2cb438d19669d8b1a0f8dedf2614aa02cf17d /controller-server
parent2d416aebb3b45aa467f72d7fa7766559d1a161c2 (diff)
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())));