diff options
author | Tor Brede Vekterli <vekterli@yahooinc.com> | 2021-11-16 13:21:57 +0100 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@yahooinc.com> | 2021-11-17 11:08:08 +0100 |
commit | 35adcc568a0265e20ffdcb8add3db8558ea9c350 (patch) | |
tree | d75734ba370b0e7394a34c13d6f58594e724d103 /config-model | |
parent | da9a7ce37b73405dd8ae936b3b8a52d2b2b816f1 (diff) |
Add feature flag for unordered merge chaining
Diffstat (limited to 'config-model')
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 49c968a1d91..9f2f3620c73 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 double diskBloatFactor = 0.2; private boolean distributorEnhancedMaintenanceScheduling = false; private boolean asyncApplyBucketDiff = false; + private boolean unorderedMergeChaining = false; private List<String> zoneDnsSuffixes = List.of(); @Override public ModelContext.FeatureFlags featureFlags() { return this; } @@ -125,6 +126,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea @Override public boolean distributorEnhancedMaintenanceScheduling() { return distributorEnhancedMaintenanceScheduling; } @Override public int maxUnCommittedMemory() { return maxUnCommittedMemory; } @Override public boolean asyncApplyBucketDiff() { return asyncApplyBucketDiff; } + @Override public boolean unorderedMergeChaining() { return unorderedMergeChaining; } @Override public List<String> zoneDnsSuffixes() { return zoneDnsSuffixes; } public TestProperties maxUnCommittedMemory(int maxUnCommittedMemory) { @@ -322,6 +324,11 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea return this; } + public TestProperties setUnorderedMergeChaining(boolean unordered) { + unorderedMergeChaining = unordered; + return this; + } + public TestProperties setZoneDnsSuffixes(List<String> zoneDnsSuffixes) { this.zoneDnsSuffixes = List.copyOf(zoneDnsSuffixes); 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 fa91dbc2e42..518c3f73a8f 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 @@ -45,6 +45,7 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl private final int maxActivationInhibitedOutOfSyncGroups; private final int mergeBusyWait; private final boolean enhancedMaintenanceScheduling; + private final boolean unorderedMergeChaining; public static class Builder extends VespaDomBuilder.DomConfigProducerBuilder<DistributorCluster> { @@ -109,12 +110,14 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl int maxInhibitedGroups = deployState.getProperties().featureFlags().maxActivationInhibitedOutOfSyncGroups(); int mergeBusyWait = deployState.getProperties().featureFlags().distributorMergeBusyWait(); boolean useEnhancedMaintenanceScheduling = deployState.getProperties().featureFlags().distributorEnhancedMaintenanceScheduling(); + boolean unorderedMergeChaining = deployState.getProperties().featureFlags().unorderedMergeChaining(); return new DistributorCluster(parent, new BucketSplitting.Builder().build(new ModelElement(producerSpec)), gc, hasIndexedDocumentType, useThreePhaseUpdates, maxInhibitedGroups, mergeBusyWait, - useEnhancedMaintenanceScheduling); + useEnhancedMaintenanceScheduling, + unorderedMergeChaining); } } @@ -123,7 +126,8 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl boolean useThreePhaseUpdates, int maxActivationInhibitedOutOfSyncGroups, int mergeBusyWait, - boolean enhancedMaintenanceScheduling) + boolean enhancedMaintenanceScheduling, + boolean unorderedMergeChaining) { super(parent, "distributor"); this.parent = parent; @@ -134,6 +138,7 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl this.maxActivationInhibitedOutOfSyncGroups = maxActivationInhibitedOutOfSyncGroups; this.mergeBusyWait = mergeBusyWait; this.enhancedMaintenanceScheduling = enhancedMaintenanceScheduling; + this.unorderedMergeChaining = unorderedMergeChaining; } @Override @@ -149,6 +154,7 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl builder.max_activation_inhibited_out_of_sync_groups(maxActivationInhibitedOutOfSyncGroups); builder.inhibit_merge_sending_on_busy_node_duration_sec(mergeBusyWait); builder.implicitly_clear_bucket_priority_on_schedule(enhancedMaintenanceScheduling); + builder.use_unordered_merge_chaining(unorderedMergeChaining); 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 0fb7e82c095..729348a0e3a 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 @@ -1119,6 +1119,23 @@ public class ContentClusterTest extends ContentBaseTest { } @Test + public void unordered_merge_chaining_config_controlled_by_properties() throws Exception { + assertFalse(resolveUnorderedMergeChainingConfig(false)); + assertTrue(resolveUnorderedMergeChainingConfig(true)); + } + + private boolean resolveUnorderedMergeChainingConfig(boolean unorderedMergeChaining) throws Exception { + var props = new TestProperties(); + if (unorderedMergeChaining) { + props.setUnorderedMergeChaining(true); + } + var cluster = createOneNodeCluster(props); + var builder = new StorDistributormanagerConfig.Builder(); + cluster.getDistributorNodes().getConfig(builder); + return (new StorDistributormanagerConfig(builder)).use_unordered_merge_chaining(); + } + + @Test public void testDedicatedClusterControllers() { VespaModel noContentModel = createEnd2EndOneNode(new TestProperties().setHostedVespa(true) .setMultitenant(true), |