summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2021-12-15 20:20:44 +0100
committerTor Egge <Tor.Egge@online.no>2021-12-15 20:20:44 +0100
commit02fe1deeb08afaa81c9503973141d4ba471ecab5 (patch)
treeeb3f178c74cef2f6d80680d7b7f4997b9696e8b6 /config-model
parent9d615eec41a3bb7e3cb82a889c217cc1cf02066c (diff)
Add max-compact-buffers feature flag.
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java7
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java3
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java16
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 ee9af73c554..cf649162c08 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,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
private boolean asyncApplyBucketDiff = false;
private boolean unorderedMergeChaining = false;
private List<String> zoneDnsSuffixes = List.of();
+ private int maxCompactBuffers = 1;
@Override public ModelContext.FeatureFlags featureFlags() { return this; }
@Override public boolean multitenant() { return multitenant; }
@@ -130,6 +131,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
@Override public boolean asyncApplyBucketDiff() { return asyncApplyBucketDiff; }
@Override public boolean unorderedMergeChaining() { return unorderedMergeChaining; }
@Override public List<String> zoneDnsSuffixes() { return zoneDnsSuffixes; }
+ @Override public int maxCompactBuffers() { return maxCompactBuffers; }
public TestProperties maxUnCommittedMemory(int maxUnCommittedMemory) {
this.maxUnCommittedMemory = maxUnCommittedMemory;
@@ -340,6 +342,11 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
return this;
}
+ public TestProperties maxCompactBuffers(int maxCompactBuffers) {
+ this.maxCompactBuffers = maxCompactBuffers;
+ 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 13c3c229acb..f981ed6228f 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
@@ -71,6 +71,7 @@ public class ContentSearchCluster extends AbstractConfigProducer<SearchCluster>
private final double defaultDiskBloatFactor;
private final int defaultDocStoreCompressionLevel;
private final boolean forwardIssuesToQrs;
+ private final int defaultMaxCompactBuffers;
/** Whether the nodes of this cluster also hosts a container cluster in a hosted system */
private final boolean combined;
@@ -225,6 +226,7 @@ public class ContentSearchCluster extends AbstractConfigProducer<SearchCluster>
this.defaultDiskBloatFactor = featureFlags.diskBloatFactor();
this.defaultDocStoreCompressionLevel = featureFlags.docstoreCompressionLevel();
this.forwardIssuesToQrs = featureFlags.forwardIssuesAsErrors();
+ this.defaultMaxCompactBuffers = featureFlags.maxCompactBuffers();
}
public void setVisibilityDelay(double delay) {
@@ -387,6 +389,7 @@ public class ContentSearchCluster extends AbstractConfigProducer<SearchCluster>
.configid(getConfigId())
.visibilitydelay(visibilityDelay)
.global(globalDocType);
+ ddbB.allocation.max_compact_buffers(defaultMaxCompactBuffers);
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 729348a0e3a..f3f372f3df4 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
@@ -1026,6 +1026,22 @@ public class ContentClusterTest extends ContentBaseTest {
assertTrue(resolveThreePhaseUpdateConfigWithFeatureFlag(true));
}
+ private int resolveMaxCompactBuffers(int maxCompactBuffers) {
+ VespaModel model = createEnd2EndOneNode(new TestProperties().maxCompactBuffers(maxCompactBuffers));
+ 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_compact_buffers();
+ }
+
+ @Test
+ public void default_max_compact_buffers_config_controlled_by_properties() {
+ assertEquals(2, resolveMaxCompactBuffers(2));
+ assertEquals(7, resolveMaxCompactBuffers(7));
+ }
+
void assertZookeeperServerImplementation(String expectedClassName,
ClusterControllerContainerCluster clusterControllerCluster) {
for (ClusterControllerContainer c : clusterControllerCluster.getContainers()) {