summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2022-02-11 13:13:08 +0000
committerGeir Storli <geirst@yahooinc.com>2022-02-11 13:13:08 +0000
commit025df33c53f5ab6c6ae25f7e4ada4eda8bdf269c (patch)
tree63338ab85d56dd7b96ac07ab21b0941c0ed691af /config-model
parent662eb8a1c2ed6e4fbe0442beae38a5962faa05f5 (diff)
Add "inhibit-default-merges-when-global-merges-pending" 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/DistributorCluster.java9
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java18
3 files changed, 32 insertions, 2 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 c9ddcdf38eb..0cde8c361a7 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
@@ -72,6 +72,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
private String mergeThrottlingPolicy = "STATIC";
private double persistenceThrottlingWsDecrementFactor = 1.2;
private double persistenceThrottlingWsBackoff = 0.95;
+ private boolean inhibitDefaultMergesWhenGlobalMergesPending = false;
private boolean useV8GeoPositions = false;
private List<String> environmentVariables = List.of();
@@ -126,6 +127,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
@Override public String mergeThrottlingPolicy() { return mergeThrottlingPolicy; }
@Override public double persistenceThrottlingWsDecrementFactor() { return persistenceThrottlingWsDecrementFactor; }
@Override public double persistenceThrottlingWsBackoff() { return persistenceThrottlingWsBackoff; }
+ @Override public boolean inhibitDefaultMergesWhenGlobalMergesPending() { return inhibitDefaultMergesWhenGlobalMergesPending; }
@Override public boolean useV8GeoPositions() { return useV8GeoPositions; }
@Override public List<String> environmentVariables() { return environmentVariables; }
@@ -330,6 +332,11 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
return this;
}
+ public TestProperties inhibitDefaultMergesWhenGlobalMergesPending(boolean value) {
+ this.inhibitDefaultMergesWhenGlobalMergesPending = value;
+ return this;
+ }
+
public TestProperties setUseV8GeoPositions(boolean value) {
this.useV8GeoPositions = value;
return this;
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/DistributorCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/DistributorCluster.java
index b8d2a4f91fe..3f01f5610f1 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/content/DistributorCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/content/DistributorCluster.java
@@ -43,6 +43,7 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl
private final boolean useThreePhaseUpdates;
private final int maxActivationInhibitedOutOfSyncGroups;
private final boolean unorderedMergeChaining;
+ private final boolean inhibitDefaultMergesWhenGlobalMergesPending;
public static class Builder extends VespaDomBuilder.DomConfigProducerBuilder<DistributorCluster> {
@@ -106,11 +107,12 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl
boolean useThreePhaseUpdates = deployState.getProperties().featureFlags().useThreePhaseUpdates();
int maxInhibitedGroups = deployState.getProperties().featureFlags().maxActivationInhibitedOutOfSyncGroups();
boolean unorderedMergeChaining = deployState.getProperties().featureFlags().unorderedMergeChaining();
+ boolean inhibitDefaultMerges = deployState.getProperties().featureFlags().inhibitDefaultMergesWhenGlobalMergesPending();
return new DistributorCluster(parent,
new BucketSplitting.Builder().build(new ModelElement(producerSpec)), gc,
hasIndexedDocumentType, useThreePhaseUpdates,
- maxInhibitedGroups, unorderedMergeChaining);
+ maxInhibitedGroups, unorderedMergeChaining, inhibitDefaultMerges);
}
}
@@ -118,7 +120,8 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl
GcOptions gc, boolean hasIndexedDocumentType,
boolean useThreePhaseUpdates,
int maxActivationInhibitedOutOfSyncGroups,
- boolean unorderedMergeChaining)
+ boolean unorderedMergeChaining,
+ boolean inhibitDefaultMergesWhenGlobalMergesPending)
{
super(parent, "distributor");
this.parent = parent;
@@ -128,6 +131,7 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl
this.useThreePhaseUpdates = useThreePhaseUpdates;
this.maxActivationInhibitedOutOfSyncGroups = maxActivationInhibitedOutOfSyncGroups;
this.unorderedMergeChaining = unorderedMergeChaining;
+ this.inhibitDefaultMergesWhenGlobalMergesPending = inhibitDefaultMergesWhenGlobalMergesPending;
}
@Override
@@ -142,6 +146,7 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl
builder.enable_metadata_only_fetch_phase_for_inconsistent_updates(useThreePhaseUpdates);
builder.max_activation_inhibited_out_of_sync_groups(maxActivationInhibitedOutOfSyncGroups);
builder.use_unordered_merge_chaining(unorderedMergeChaining);
+ builder.inhibit_default_merges_when_global_merges_pending(inhibitDefaultMergesWhenGlobalMergesPending);
bucketSplitting.getConfig(builder);
}
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 88073d281c5..9f571167d8c 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
@@ -1159,6 +1159,24 @@ public class ContentClusterTest extends ContentBaseTest {
}
@Test
+ public void inhibit_default_merges_when_global_merges_pending_controlled_by_properties() throws Exception {
+ assertFalse(resolveInhibitDefaultMergesConfig(Optional.empty()));
+ assertFalse(resolveInhibitDefaultMergesConfig(Optional.of(false)));
+ assertTrue(resolveInhibitDefaultMergesConfig(Optional.of(true)));
+ }
+
+ private boolean resolveInhibitDefaultMergesConfig(Optional<Boolean> inhibitDefaultMerges) throws Exception {
+ var props = new TestProperties();
+ if (inhibitDefaultMerges.isPresent()) {
+ props.inhibitDefaultMergesWhenGlobalMergesPending(inhibitDefaultMerges.get());
+ }
+ var cluster = createOneNodeCluster(props);
+ var builder = new StorDistributormanagerConfig.Builder();
+ cluster.getDistributorNodes().getConfig(builder);
+ return (new StorDistributormanagerConfig(builder)).inhibit_default_merges_when_global_merges_pending();
+ }
+
+ @Test
public void testDedicatedClusterControllers() {
VespaModel noContentModel = createEnd2EndOneNode(new TestProperties().setHostedVespa(true)
.setMultitenant(true),