summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2021-02-09 13:30:44 +0100
committerHarald Musum <musum@verizonmedia.com>2021-02-09 13:30:44 +0100
commit62ca0f7cd508269c15b498e46be335607a11ec5e (patch)
tree99f8355a26ee564f5de6e7f62adbcb3927c3c0bc /config-model
parent1244489c52a1c0c06f0cb47bf7835f8981a19e65 (diff)
Set dynamicReconfiguration per container in cluster container cluster
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainer.java4
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerContainerCluster.java5
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java4
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java7
4 files changed, 14 insertions, 6 deletions
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<String> 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<ClusterControllerContainer>
-{
+public class ClusterControllerContainerCluster extends ContainerCluster<ClusterControllerContainer> {
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<Applicat
.id(container.index())
.joining(!previousHosts.isEmpty() &&
!previousHosts.contains(container.getHostName()));
- builder.server(serverBuilder)
- .dynamicReconfiguration(true);
+ builder.server(serverBuilder);
+ builder.dynamicReconfiguration(true);
}
}
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java
index 7a2e9ad8da3..1fe49dcfbeb 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java
@@ -1,6 +1,7 @@
-// Copyright 2017 Yahoo Holdings. 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.content;
+import com.yahoo.cloud.config.ZookeeperServerConfig;
import com.yahoo.config.model.api.ModelContext;
import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.config.model.deploy.TestProperties;
@@ -1027,6 +1028,10 @@ public class ContentClusterTest extends ContentBaseTest {
assertEquals(1, new ComponentsConfig(builder).components().stream()
.filter(component -> component.classId().equals(expectedClassName))
.count());
+
+ var zBuilder = new ZookeeperServerConfig.Builder();
+ c.getConfig(zBuilder);
+ assertEquals(reconfigurable, new ZookeeperServerConfig(zBuilder).dynamicReconfiguration());
}
}