From 62ca0f7cd508269c15b498e46be335607a11ec5e Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Tue, 9 Feb 2021 13:30:44 +0100 Subject: Set dynamicReconfiguration per container in cluster container cluster --- .../model/admin/clustercontroller/ClusterControllerContainer.java | 4 ++++ .../admin/clustercontroller/ClusterControllerContainerCluster.java | 5 ++--- .../yahoo/vespa/model/container/ApplicationContainerCluster.java | 4 ++-- .../java/com/yahoo/vespa/model/content/ContentClusterTest.java | 7 ++++++- 4 files changed, 14 insertions(+), 6 deletions(-) (limited to 'config-model') diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainer.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainer.java index b5fffe00bdc..4b39c67cda4 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainer.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainer.java @@ -3,6 +3,7 @@ package com.yahoo.vespa.model.admin.clustercontroller; import com.yahoo.cloud.config.ZookeeperServerConfig; import com.yahoo.component.ComponentSpecification; +import com.yahoo.config.model.api.ModelContext; import com.yahoo.config.model.api.container.ContainerServiceType; import com.yahoo.config.model.deploy.DeployState; import com.yahoo.config.model.producer.AbstractConfigProducer; @@ -40,6 +41,7 @@ public class ClusterControllerContainer extends Container implements private static final ComponentSpecification REINDEXING_CONTROLLER_BUNDLE = new ComponentSpecification("clustercontroller-reindexer"); private final Set bundles = new TreeSet<>(); + private final ModelContext.FeatureFlags featureFlags; public ClusterControllerContainer( AbstractConfigProducer parent, @@ -47,6 +49,7 @@ public class ClusterControllerContainer extends Container implements boolean runStandaloneZooKeeper, DeployState deployState) { super(parent, "" + index, index, deployState.isHosted()); + this.featureFlags = deployState.featureFlags(); addHandler("clustercontroller-status", "com.yahoo.vespa.clustercontroller.apps.clustercontroller.StatusHandler", "/clustercontroller-status/*", @@ -144,6 +147,7 @@ public class ClusterControllerContainer extends Container implements @Override public void getConfig(ZookeeperServerConfig.Builder builder) { builder.myid(index()); + builder.dynamicReconfiguration(featureFlags.reconfigurableZookeeperServer()); } @Override diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainerCluster.java index f222a1f3de1..58e5ccd7c3a 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainerCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainerCluster.java @@ -1,4 +1,4 @@ -// Copyright 2019 Oath Inc. 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.model.admin.clustercontroller; import com.yahoo.config.model.api.Reindexing; @@ -12,8 +12,7 @@ import com.yahoo.vespa.model.container.ContainerCluster; * @author gjoranv * @author bjorncs */ -public class ClusterControllerContainerCluster extends ContainerCluster -{ +public class ClusterControllerContainerCluster extends ContainerCluster { private final ReindexingContext reindexingContext; diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java index f8ff7bcdc18..dafce877ddd 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java @@ -275,8 +275,8 @@ public final class ApplicationContainerCluster extends ContainerCluster component.classId().equals(expectedClassName)) .count()); + + var zBuilder = new ZookeeperServerConfig.Builder(); + c.getConfig(zBuilder); + assertEquals(reconfigurable, new ZookeeperServerConfig(zBuilder).dynamicReconfiguration()); } } -- cgit v1.2.3