summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2022-01-25 14:28:47 +0100
committerTor Brede Vekterli <vekterli@yahooinc.com>2022-01-25 14:28:47 +0100
commite68f0aa6f7cb59440f638dcb87e0d27bf53ce9a8 (patch)
tree00042043b10971852f4b04fadfac13e15106cdc1 /config-model/src/main/java
parent1608bedc17ea020f0a5a4834552aded54e82ab5d (diff)
Add feature flag for merge throttling policy
Two options; `STATIC` (default) and `DYNAMIC`. Does not currently set any window size configs based on the existing feature flag for max pending, so the config defaults will be used for these when dynamic throttling is enabled.
Diffstat (limited to 'config-model/src/main/java')
-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/storagecluster/StorServerProducer.java12
2 files changed, 19 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 1478854aecf..3aadf30e2f9 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
@@ -71,6 +71,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
private int maxCompactBuffers = 1;
private boolean failDeploymentWithInvalidJvmOptions = false;
private String persistenceAsyncThrottling = "UNLIMITED";
+ private String mergeThrottlingPolicy = "STATIC";
@Override public ModelContext.FeatureFlags featureFlags() { return this; }
@Override public boolean multitenant() { return multitenant; }
@@ -121,6 +122,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
@Override public int maxCompactBuffers() { return maxCompactBuffers; }
@Override public boolean failDeploymentWithInvalidJvmOptions() { return failDeploymentWithInvalidJvmOptions; }
@Override public String persistenceAsyncThrottling() { return persistenceAsyncThrottling; }
+ @Override public String mergeThrottlingPolicy() { return mergeThrottlingPolicy; }
public TestProperties maxUnCommittedMemory(int maxUnCommittedMemory) {
this.maxUnCommittedMemory = maxUnCommittedMemory;
@@ -313,6 +315,11 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
return this;
}
+ public TestProperties setMergeThrottlingPolicy(String policy) {
+ this.mergeThrottlingPolicy = policy;
+ 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/storagecluster/StorServerProducer.java b/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorServerProducer.java
index 6f9166f4493..2fca964a995 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorServerProducer.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorServerProducer.java
@@ -32,6 +32,7 @@ public class StorServerProducer implements StorServerConfig.Producer {
private Integer maxMergesPerNode;
private Integer queueSize;
private Integer bucketDBStripeBits;
+ private StorServerConfig.Merge_throttling_policy.Type.Enum mergeThrottlingPolicyType;
private StorServerProducer setMaxMergesPerNode(Integer value) {
if (value != null) {
@@ -50,10 +51,19 @@ public class StorServerProducer implements StorServerConfig.Producer {
return this;
}
+ private static StorServerConfig.Merge_throttling_policy.Type.Enum toThrottlePolicyType(String policyType) {
+ try {
+ return StorServerConfig.Merge_throttling_policy.Type.Enum.valueOf(policyType);
+ } catch (Throwable t) {
+ return StorServerConfig.Merge_throttling_policy.Type.STATIC;
+ }
+ }
+
StorServerProducer(String clusterName, ModelContext.FeatureFlags featureFlags) {
this.clusterName = clusterName;
maxMergesPerNode = featureFlags.maxConcurrentMergesPerNode();
queueSize = featureFlags.maxMergeQueueSize();
+ mergeThrottlingPolicyType = toThrottlePolicyType(featureFlags.mergeThrottlingPolicy());
}
@Override
@@ -73,5 +83,7 @@ public class StorServerProducer implements StorServerConfig.Producer {
if (bucketDBStripeBits != null) {
builder.content_node_bucket_db_stripe_bits(bucketDBStripeBits);
}
+ // TODO set throttle policy params based on existing or separate flags
+ builder.merge_throttling_policy(new StorServerConfig.Merge_throttling_policy.Builder().type(mergeThrottlingPolicyType));
}
}