diff options
author | Geir Storli <geirst@verizonmedia.com> | 2021-09-21 12:12:26 +0000 |
---|---|---|
committer | Geir Storli <geirst@verizonmedia.com> | 2021-09-21 12:12:26 +0000 |
commit | 69b9c59072c923be4798733dde03a37beda918db (patch) | |
tree | 7716adff9a2c2393d2c5e951774c2a80bcfa20e7 /config-model/src | |
parent | 76cb9601d6e946918420317b58c4579a9985f254 (diff) |
Ignore num-distributor-stripes flag and always tune when node resource is available.
Diffstat (limited to 'config-model/src')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/content/Distributor.java | 28 | ||||
-rw-r--r-- | config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java | 20 |
2 files changed, 18 insertions, 30 deletions
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 f640af71a59..f84e5c6c3a7 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 @@ -18,7 +18,6 @@ import org.w3c.dom.Element; public class Distributor extends ContentNode implements StorDistributormanagerConfig.Producer { PersistenceEngine provider; - private final int numDistributorStripesFlag; public static class Builder extends VespaDomBuilder.DomConfigProducerBuilder<Distributor> { ModelElement clusterXml; @@ -41,7 +40,6 @@ public class Distributor extends ContentNode implements StorDistributormanagerCo StorageNode.rootFolder + parent.getClusterName() + "/distributor/" + distributionKey, distributionKey); this.provider = provider; - this.numDistributorStripesFlag = properties.featureFlags().numDistributorStripes(); if (distributorBasePort != null) { setBasePort(distributorBasePort); @@ -49,23 +47,21 @@ public class Distributor extends ContentNode implements StorDistributormanagerCo } private int tuneNumDistributorStripes() { - if (numDistributorStripesFlag == -1) { - if (getHostResource() != null) { - int cores = (int)getHostResource().realResources().vcpu(); - // This should match the calculation used when node flavor is not available: - // storage/src/vespa/storage/common/bucket_stripe_utils.cpp - if (cores <= 16) { - return 1; - } else if (cores <= 64) { - return 2; - } else { - return 4; - } - } else { + if (getHostResource() != null && + !getHostResource().realResources().isUnspecified()) { + int cores = (int)getHostResource().realResources().vcpu(); + // This should match the calculation used when node flavor is not available: + // storage/src/vespa/storage/common/bucket_stripe_utils.cpp + if (cores <= 16) { return 1; + } else if (cores <= 64) { + return 2; + } else { + return 4; } + } else { + return 0; } - return numDistributorStripesFlag; } @Override 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 c7c02c581f9..0b686db6801 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 @@ -1057,30 +1057,22 @@ public class ContentClusterTest extends ContentBaseTest { assertEquals(2, resolveMaxInhibitedGroupsConfigWithFeatureFlag(2)); } - private int resolveNumDistributorStripesConfigWithFeatureFlag(TestProperties props, Optional<Flavor> flavor) throws Exception { - var cc = createOneNodeCluster(props, flavor); + private int resolveNumDistributorStripesConfig(Optional<Flavor> flavor) throws Exception { + var cc = createOneNodeCluster(new TestProperties(), flavor); var builder = new StorDistributormanagerConfig.Builder(); cc.getDistributorNodes().getChildren().get("0").getConfig(builder); return (new StorDistributormanagerConfig(builder)).num_distributor_stripes(); } - private int resolveNumDistributorStripesConfigWithFeatureFlag(int numStripes) throws Exception { - return resolveNumDistributorStripesConfigWithFeatureFlag(new TestProperties().setNumDistributorStripes(numStripes), Optional.empty()); - } - private int resolveTunedNumDistributorStripesConfig(int numCpuCores) throws Exception { var flavor = new Flavor(new FlavorsConfig.Flavor(new FlavorsConfig.Flavor.Builder().name("test").minCpuCores(numCpuCores))); - return resolveNumDistributorStripesConfigWithFeatureFlag(new TestProperties().setNumDistributorStripes(-1), - Optional.of(flavor)); + return resolveNumDistributorStripesConfig(Optional.of(flavor)); } @Test - public void num_distributor_stripes_config_controlled_by_properties() throws Exception { - assertEquals(0, resolveNumDistributorStripesConfigWithFeatureFlag(new TestProperties(), Optional.empty())); - assertEquals(0, resolveNumDistributorStripesConfigWithFeatureFlag(0)); - assertEquals(1, resolveNumDistributorStripesConfigWithFeatureFlag(1)); - assertEquals(1, resolveNumDistributorStripesConfigWithFeatureFlag(-1)); - assertEquals(4, resolveNumDistributorStripesConfigWithFeatureFlag(4)); + public void num_distributor_stripes_config_defaults_to_zero() throws Exception { + // This triggers tuning when starting the distributor process, based on CPU core sampling on the node. + assertEquals(0, resolveNumDistributorStripesConfig(Optional.empty())); } @Test |