diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-07-09 18:11:04 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-07-09 18:11:04 +0000 |
commit | 05072c36938ae99912ed55d502f45952570e54a6 (patch) | |
tree | ec9712fde804d3b76d62a05116d184ee3cf3ca93 /config-model | |
parent | 36f1f82001f4a1b973dfbd6bb28cf57315219420 (diff) |
Add feature flags for rolling out skipping of feed threads.
Diffstat (limited to 'config-model')
7 files changed, 37 insertions, 19 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java index 9708207b11f..abe14fbed32 100644 --- a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java +++ b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java @@ -75,6 +75,9 @@ public class TestProperties implements ModelContext.Properties { @Override public Optional<ApplicationRoles> applicationRoles() { return Optional.ofNullable(applicationRoles); } @Override public String responseSequencerType() { return responseSequencerType; } @Override public int defaultNumResponseThreads() { return reponseNumThreads; } + @Override public boolean skipCommunicationManagerThread() { return false; } + @Override public boolean skipMbusRequestThread() { return false; } + @Override public boolean skipMbusReplyThread() { return false; } public TestProperties setJvmGCOptions(String gcOptions) { jvmGCOptions = gcOptions; diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentNode.java b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentNode.java index 9a8a57f12ea..f2e90ae2859 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentNode.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentNode.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. package com.yahoo.vespa.model.content; +import com.yahoo.config.model.api.ModelContext; import com.yahoo.metrics.MetricsmanagerConfig; import com.yahoo.vespa.config.content.LoadTypeConfig; import com.yahoo.vespa.config.content.core.StorCommunicationmanagerConfig; @@ -21,16 +22,21 @@ import com.yahoo.vespa.model.application.validation.RestartConfigs; public abstract class ContentNode extends AbstractService implements StorCommunicationmanagerConfig.Producer, StorStatusConfig.Producer, StorServerConfig.Producer { - protected int distributionKey; - String rootDirectory; + private final int distributionKey; + private final String rootDirectory; + private final boolean skipCommunicationManagerThread; + private final boolean skipMbusRequestThread; + private final boolean skipMbusReplyThread; - public ContentNode(AbstractConfigProducer parent, String clusterName, String rootDirectory, int distributionKey) { + public ContentNode(ModelContext.Properties properties, AbstractConfigProducer parent, String clusterName, String rootDirectory, int distributionKey) { super(parent, "" + distributionKey); this.distributionKey = distributionKey; - initialize(distributionKey); - + this.skipCommunicationManagerThread = properties.skipCommunicationManagerThread(); + this.skipMbusRequestThread = properties.skipMbusRequestThread(); + this.skipMbusReplyThread = properties.skipMbusReplyThread(); this.rootDirectory = rootDirectory; + initialize(); setProp("clustertype", "content"); setProp("clustername", clusterName); setProp("index", distributionKey); @@ -46,8 +52,7 @@ public abstract class ContentNode extends AbstractService builder.node_index(distributionKey); } - public void initialize(int distributionKey) { - this.distributionKey = distributionKey; + private void initialize() { portsMeta.on(0).tag("messaging"); portsMeta.on(1).tag("rpc").tag("status"); portsMeta.on(2).tag("http").tag("status").tag("state"); @@ -73,6 +78,9 @@ public abstract class ContentNode extends AbstractService public void getConfig(StorCommunicationmanagerConfig.Builder builder) { builder.mbusport(getRelativePort(0)); builder.rpcport(getRelativePort(1)); + builder.skip_thread(skipCommunicationManagerThread); + builder.mbus.skip_request_thread(skipMbusRequestThread); + builder.mbus.skip_reply_thread(skipMbusReplyThread); } @Override diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/Distributor.java b/config-model/src/main/java/com/yahoo/vespa/model/content/Distributor.java index 4b07b78a713..f03b7144e38 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/Distributor.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/Distributor.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. package com.yahoo.vespa.model.content; +import com.yahoo.config.model.api.ModelContext; import com.yahoo.config.model.deploy.DeployState; import com.yahoo.vespa.config.content.core.StorCommunicationmanagerConfig; import com.yahoo.vespa.config.content.core.StorServerConfig; @@ -28,14 +29,14 @@ public class Distributor extends ContentNode { @Override protected Distributor doBuild(DeployState deployState, AbstractConfigProducer ancestor, Element producerSpec) { - return new Distributor((DistributorCluster)ancestor, new ModelElement(producerSpec).integerAttribute("distribution-key"), + return new Distributor(deployState.getProperties(), (DistributorCluster)ancestor, new ModelElement(producerSpec).integerAttribute("distribution-key"), clusterXml.integerAttribute("distributor-base-port"), persistenceProvider); } } - Distributor(DistributorCluster parent, int distributionKey, Integer distributorBasePort, PersistenceEngine provider) { - super(parent, parent.getClusterName(), StorageNode.rootFolder + parent.getClusterName() + "/distributor/" - + distributionKey, distributionKey); + Distributor(ModelContext.Properties properties, DistributorCluster parent, int distributionKey, Integer distributorBasePort, PersistenceEngine provider) { + super(properties, parent, parent.getClusterName(), + StorageNode.rootFolder + parent.getClusterName() + "/distributor/" + distributionKey, distributionKey); this.provider = provider; diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/StorageGroup.java b/config-model/src/main/java/com/yahoo/vespa/model/content/StorageGroup.java index e380588f16e..894022d936d 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/StorageGroup.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/StorageGroup.java @@ -283,10 +283,10 @@ public class StorageGroup { private StorageNode buildSingleNode(DeployState deployState, ContentCluster parent) { int distributionKey = 0; - StorageNode sNode = new StorageNode(parent.getStorageNodes(), 1.0, distributionKey , false); + StorageNode sNode = new StorageNode(deployState.getProperties(), parent.getStorageNodes(), 1.0, distributionKey , false); sNode.setHostResource(parent.hostSystem().getHost(Container.SINGLENODE_CONTAINER_SERVICESPEC)); PersistenceEngine provider = parent.getPersistence().create(deployState, sNode, storageGroup, null); - new Distributor(parent.getDistributorNodes(), distributionKey, null, provider); + new Distributor(deployState.getProperties(), parent.getDistributorNodes(), distributionKey, null, provider); return sNode; } @@ -463,13 +463,13 @@ public class StorageGroup { } private static StorageNode createStorageNode(DeployState deployState, ContentCluster parent, HostResource hostResource, StorageGroup parentGroup, ClusterMembership clusterMembership) { - StorageNode sNode = new StorageNode(parent.getStorageNodes(), null, clusterMembership.index(), clusterMembership.retired()); + StorageNode sNode = new StorageNode(deployState.getProperties(), parent.getStorageNodes(), null, clusterMembership.index(), clusterMembership.retired()); sNode.setHostResource(hostResource); sNode.initService(deployState.getDeployLogger()); // TODO: Supplying null as XML is not very nice PersistenceEngine provider = parent.getPersistence().create(deployState, sNode, parentGroup, null); - Distributor d = new Distributor(parent.getDistributorNodes(), clusterMembership.index(), null, provider); + Distributor d = new Distributor(deployState.getProperties(), parent.getDistributorNodes(), clusterMembership.index(), null, provider); d.setHostResource(sNode.getHostResource()); d.initService(deployState.getDeployLogger()); return sNode; diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/StorageNode.java b/config-model/src/main/java/com/yahoo/vespa/model/content/StorageNode.java index d40abec5bb1..d47d77897e8 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/StorageNode.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/StorageNode.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. package com.yahoo.vespa.model.content; +import com.yahoo.config.model.api.ModelContext; import com.yahoo.config.model.deploy.DeployState; import com.yahoo.config.provision.Flavor; import com.yahoo.vespa.config.content.StorFilestorConfig; @@ -33,13 +34,12 @@ public class StorageNode extends ContentNode implements StorServerConfig.Produce @Override protected StorageNode doBuild(DeployState deployState, AbstractConfigProducer ancestor, Element producerSpec) { ModelElement e = new ModelElement(producerSpec); - return new StorageNode((StorageCluster)ancestor, e.doubleAttribute("capacity"), e.integerAttribute("distribution-key"), false); + return new StorageNode(deployState.getProperties(), (StorageCluster)ancestor, e.doubleAttribute("capacity"), e.integerAttribute("distribution-key"), false); } } - StorageNode(StorageCluster cluster, Double capacity, int distributionKey, boolean retired) { - super(cluster, - cluster.getClusterName(), + StorageNode(ModelContext.Properties properties, StorageCluster cluster, Double capacity, int distributionKey, boolean retired) { + super(properties, cluster, cluster.getClusterName(), rootFolder + cluster.getClusterName() + "/storage/" + distributionKey, distributionKey); this.retired = retired; diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/DistributorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/DistributorTest.java index 8ea846cc790..c00a9da4fed 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/DistributorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/DistributorTest.java @@ -290,6 +290,9 @@ public class DistributorTest { assertFalse(config.mbus().dispatch_on_decode()); assertEquals(4, config.mbus().num_threads()); assertEquals(StorCommunicationmanagerConfig.Mbus.Optimize_for.LATENCY, config.mbus().optimize_for()); + assertFalse(config.skip_thread()); + assertFalse(config.mbus().skip_request_thread()); + assertFalse(config.mbus().skip_reply_thread()); } private StorDistributormanagerConfig clusterXmlToConfig(String xml) { diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java index 660c4c3abad..238f65b2988 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java @@ -90,6 +90,9 @@ public class StorageClusterTest { assertFalse(config.mbus().dispatch_on_decode()); assertEquals(4, config.mbus().num_threads()); assertEquals(StorCommunicationmanagerConfig.Mbus.Optimize_for.LATENCY, config.mbus().optimize_for()); + assertFalse(config.skip_thread()); + assertFalse(config.mbus().skip_request_thread()); + assertFalse(config.mbus().skip_reply_thread()); } @Test |