diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-02-03 20:56:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-03 20:56:47 +0100 |
commit | b434914ac7aafd49adad156dd070af941a813985 (patch) | |
tree | 4972d0a8afa1028ab870104290359c03e126893a /config-model | |
parent | 9c5a27d4e22e6b8a56b5d44100e01c5ee31fb02a (diff) | |
parent | c9ec04b56728fb614975bc6a80906268245d7434 (diff) |
Merge pull request #16376 from vespa-engine/toregge/add-feature-flag-for-max-dead-bytes-ratio
Add feature flag for max dead bytes ratio.
Diffstat (limited to 'config-model')
3 files changed, 26 insertions, 0 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 6ca1c8f2b79..bcf76c15fa2 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 @@ -52,6 +52,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea private boolean reconfigurableZookeeperServer = false; private boolean useBucketExecutorForLidSpaceCompact; private boolean enableFeedBlockInDistributor = false; + private double maxDeadBytesRatio = 0.2; @Override public ModelContext.FeatureFlags featureFlags() { return this; } @Override public boolean multitenant() { return multitenant; } @@ -86,6 +87,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea @Override public boolean reconfigurableZookeeperServer() { return reconfigurableZookeeperServer; } @Override public boolean useBucketExecutorForLidSpaceCompact() { return useBucketExecutorForLidSpaceCompact; } @Override public boolean enableFeedBlockInDistributor() { return enableFeedBlockInDistributor; } + @Override public double maxDeadBytesRatio() { return maxDeadBytesRatio; } public TestProperties setFeedConcurrency(double feedConcurrency) { this.feedConcurrency = feedConcurrency; @@ -195,6 +197,11 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea return this; } + public TestProperties maxDeadBytesRatio(double ratio) { + maxDeadBytesRatio = ratio; + return this; + } + public static class Spec implements ConfigServerSpec { private final String hostName; diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java index 7ce72b138c1..0fdd39e70cf 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java @@ -66,6 +66,7 @@ public class ContentSearchCluster extends AbstractConfigProducer<SearchCluster> private final ProtonConfig.Indexing.Optimize.Enum feedSequencerType; private final double defaultFeedConcurrency; private final boolean useBucketExecutorForLidSpaceCompact; + private final double defaultMaxDeadBytesRatio; /** Whether the nodes of this cluster also hosts a container cluster in a hosted system */ private final boolean combined; @@ -206,6 +207,7 @@ public class ContentSearchCluster extends AbstractConfigProducer<SearchCluster> feedSequencerType = convertFeedSequencerType(featureFlags.feedSequencerType()); defaultFeedConcurrency = featureFlags.feedConcurrency(); useBucketExecutorForLidSpaceCompact = featureFlags.useBucketExecutorForLidSpaceCompact(); + defaultMaxDeadBytesRatio = featureFlags.maxDeadBytesRatio(); } public void setVisibilityDelay(double delay) { @@ -376,6 +378,7 @@ public class ContentSearchCluster extends AbstractConfigProducer<SearchCluster> .configid(getConfigId()) .visibilitydelay(visibilityDelay) .global(globalDocType); + ddbB.allocation.max_dead_bytes_ratio(defaultMaxDeadBytesRatio); if (hasIndexingModeStreaming(type)) { hasAnyNonIndexedCluster = 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 095434c8e04..7a2e9ad8da3 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 @@ -998,6 +998,22 @@ public class ContentClusterTest extends ContentBaseTest { assertTrue(resolveThreePhaseUpdateConfigWithFeatureFlag(true)); } + private double resolveMaxDeadBytesRatio(double maxDeadBytesRatio) { + VespaModel model = createEnd2EndOneNode(new TestProperties().maxDeadBytesRatio(maxDeadBytesRatio)); + ContentCluster cc = model.getContentClusters().get("storage"); + ProtonConfig.Builder protonBuilder = new ProtonConfig.Builder(); + cc.getSearch().getConfig(protonBuilder); + ProtonConfig protonConfig = new ProtonConfig(protonBuilder); + assertEquals(1, protonConfig.documentdb().size()); + return protonConfig.documentdb(0).allocation().max_dead_bytes_ratio(); + } + + @Test + public void default_max_dead_bytes_ratio_config_controlled_by_properties() { + assertEquals(0.2, resolveMaxDeadBytesRatio(0.2), 1e-5); + assertEquals(0.1, resolveMaxDeadBytesRatio(0.1), 1e-5); + } + void assertZookeeperServerImplementation(boolean reconfigurable, String expectedClassName) { VespaModel model = createEnd2EndOneNode( new TestProperties() |