summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2021-10-04 12:50:42 +0000
committerGeir Storli <geirst@verizonmedia.com>2021-10-04 12:50:42 +0000
commitfffcf762930b0119199622750658ebd3ab3703c4 (patch)
treec128eedbc481423ec3df1d246989d631def837cd /config-model
parent3f68eb7eb2f03020bed40f328294a0c9300fa17e (diff)
Add feature flag for distributor merge busy wait.
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java9
-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.java17
3 files changed, 33 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 e27e0e7624f..570638e7e93 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
@@ -65,6 +65,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
private double minNodeRatioPerGroup = 0.0;
private boolean containerDumpHeapOnShutdownTimeout = false;
private double containerShutdownTimeout = 50.0;
+ private int distributorMergeBusyWait = 10;
@Override public ModelContext.FeatureFlags featureFlags() { return this; }
@Override public boolean multitenant() { return multitenant; }
@@ -109,6 +110,9 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
@Override public int metricsproxyNumThreads() { return 1; }
@Override public double containerShutdownTimeout() { return containerShutdownTimeout; }
@Override public boolean containerDumpHeapOnShutdownTimeout() { return containerDumpHeapOnShutdownTimeout; }
+ @Override public int distributorMergeBusyWait() { return distributorMergeBusyWait; }
+
+
public TestProperties containerDumpHeapOnShutdownTimeout(boolean value) {
containerDumpHeapOnShutdownTimeout = value;
return this;
@@ -266,6 +270,11 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
return this;
}
+ public TestProperties setDistributorMergeBusyWait(int value) {
+ distributorMergeBusyWait = value;
+ 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/DistributorCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/DistributorCluster.java
index 0e3fee5a749..3fab1adde57 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 hasIndexedDocumentType;
private final boolean useThreePhaseUpdates;
private final int maxActivationInhibitedOutOfSyncGroups;
+ private final int mergeBusyWait;
public static class Builder extends VespaDomBuilder.DomConfigProducerBuilder<DistributorCluster> {
@@ -105,18 +106,20 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl
final boolean hasIndexedDocumentType = clusterContainsIndexedDocumentType(documentsNode);
boolean useThreePhaseUpdates = deployState.getProperties().featureFlags().useThreePhaseUpdates();
int maxInhibitedGroups = deployState.getProperties().featureFlags().maxActivationInhibitedOutOfSyncGroups();
+ int mergeBusyWait = deployState.getProperties().featureFlags().distributorMergeBusyWait();
return new DistributorCluster(parent,
new BucketSplitting.Builder().build(new ModelElement(producerSpec)), gc,
hasIndexedDocumentType, useThreePhaseUpdates,
- maxInhibitedGroups);
+ maxInhibitedGroups, mergeBusyWait);
}
}
private DistributorCluster(ContentCluster parent, BucketSplitting bucketSplitting,
GcOptions gc, boolean hasIndexedDocumentType,
boolean useThreePhaseUpdates,
- int maxActivationInhibitedOutOfSyncGroups)
+ int maxActivationInhibitedOutOfSyncGroups,
+ int mergeBusyWait)
{
super(parent, "distributor");
this.parent = parent;
@@ -125,6 +128,7 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl
this.hasIndexedDocumentType = hasIndexedDocumentType;
this.useThreePhaseUpdates = useThreePhaseUpdates;
this.maxActivationInhibitedOutOfSyncGroups = maxActivationInhibitedOutOfSyncGroups;
+ this.mergeBusyWait = mergeBusyWait;
}
@Override
@@ -138,6 +142,7 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl
builder.disable_bucket_activation(hasIndexedDocumentType == false);
builder.enable_metadata_only_fetch_phase_for_inconsistent_updates(useThreePhaseUpdates);
builder.max_activation_inhibited_out_of_sync_groups(maxActivationInhibitedOutOfSyncGroups);
+ builder.inhibit_merge_sending_on_busy_node_duration_sec(mergeBusyWait);
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 0b686db6801..7f006cdccd9 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
@@ -1085,6 +1085,23 @@ public class ContentClusterTest extends ContentBaseTest {
}
@Test
+ public void distributor_merge_busy_wait_controlled_by_properties() throws Exception {
+ assertEquals(10, resolveDistributorMergeBusyWaitConfig(Optional.empty()));
+ assertEquals(1, resolveDistributorMergeBusyWaitConfig(Optional.of(1)));
+ }
+
+ private int resolveDistributorMergeBusyWaitConfig(Optional<Integer> mergeBusyWait) throws Exception {
+ var props = new TestProperties();
+ if (mergeBusyWait.isPresent()) {
+ props.setDistributorMergeBusyWait(mergeBusyWait.get());
+ }
+ var cluster = createOneNodeCluster(props);
+ var builder = new StorDistributormanagerConfig.Builder();
+ cluster.getDistributorNodes().getConfig(builder);
+ return (new StorDistributormanagerConfig(builder)).inhibit_merge_sending_on_busy_node_duration_sec();
+ }
+
+ @Test
public void testDedicatedClusterControllers() {
VespaModel noContentModel = createEnd2EndOneNode(new TestProperties().setHostedVespa(true)
.setMultitenant(true),