diff options
author | Tor Brede Vekterli <vekterli@yahooinc.com> | 2021-10-14 14:52:50 +0200 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@yahooinc.com> | 2021-10-14 14:54:56 +0200 |
commit | 4c09e1b31dcaff2bc0a73b83ba3bdaafa63d4bd5 (patch) | |
tree | 3e5d2cab2847f265e333c6a3a302c9a5c6823684 /config-model/src | |
parent | 299e8fea68d4a0f28c365bd3ff7866f18ca290dd (diff) |
Add feature flag for enhanced distributor maintenance scheduling
Diffstat (limited to 'config-model/src')
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 ce4e5f0c01f..a728dfe71b9 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 @@ -67,6 +67,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea private int distributorMergeBusyWait = 10; private int docstoreCompressionLevel = 9; private double diskBloatFactor = 0.2; + private boolean distributorEnhancedMaintenanceScheduling = false; @Override public ModelContext.FeatureFlags featureFlags() { return this; } @Override public boolean multitenant() { return multitenant; } @@ -114,6 +115,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea @Override public int distributorMergeBusyWait() { return distributorMergeBusyWait; } @Override public double diskBloatFactor() { return diskBloatFactor; } @Override public int docstoreCompressionLevel() { return docstoreCompressionLevel; } + @Override public boolean distributorEnhancedMaintenanceScheduling() { return distributorEnhancedMaintenanceScheduling; } public TestProperties docstoreCompressionLevel(int docstoreCompressionLevel) { this.docstoreCompressionLevel = docstoreCompressionLevel; @@ -287,6 +289,11 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea return this; } + public TestProperties distributorEnhancedMaintenanceScheduling(boolean enhancedScheduling) { + distributorEnhancedMaintenanceScheduling = enhancedScheduling; + 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 94cf33eae51..fa91dbc2e42 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 @@ -44,6 +44,7 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl private final boolean useThreePhaseUpdates; private final int maxActivationInhibitedOutOfSyncGroups; private final int mergeBusyWait; + private final boolean enhancedMaintenanceScheduling; public static class Builder extends VespaDomBuilder.DomConfigProducerBuilder<DistributorCluster> { @@ -107,11 +108,13 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl boolean useThreePhaseUpdates = deployState.getProperties().featureFlags().useThreePhaseUpdates(); int maxInhibitedGroups = deployState.getProperties().featureFlags().maxActivationInhibitedOutOfSyncGroups(); int mergeBusyWait = deployState.getProperties().featureFlags().distributorMergeBusyWait(); + boolean useEnhancedMaintenanceScheduling = deployState.getProperties().featureFlags().distributorEnhancedMaintenanceScheduling(); return new DistributorCluster(parent, new BucketSplitting.Builder().build(new ModelElement(producerSpec)), gc, hasIndexedDocumentType, useThreePhaseUpdates, - maxInhibitedGroups, mergeBusyWait); + maxInhibitedGroups, mergeBusyWait, + useEnhancedMaintenanceScheduling); } } @@ -119,7 +122,8 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl GcOptions gc, boolean hasIndexedDocumentType, boolean useThreePhaseUpdates, int maxActivationInhibitedOutOfSyncGroups, - int mergeBusyWait) + int mergeBusyWait, + boolean enhancedMaintenanceScheduling) { super(parent, "distributor"); this.parent = parent; @@ -129,6 +133,7 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl this.useThreePhaseUpdates = useThreePhaseUpdates; this.maxActivationInhibitedOutOfSyncGroups = maxActivationInhibitedOutOfSyncGroups; this.mergeBusyWait = mergeBusyWait; + this.enhancedMaintenanceScheduling = enhancedMaintenanceScheduling; } @Override @@ -143,6 +148,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.inhibit_merge_sending_on_busy_node_duration_sec(mergeBusyWait); + builder.implicitly_clear_bucket_priority_on_schedule(enhancedMaintenanceScheduling); 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 759aad81e5f..0fb7e82c095 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 @@ -1102,6 +1102,23 @@ public class ContentClusterTest extends ContentBaseTest { } @Test + public void distributor_enhanced_maintenance_scheduling_controlled_by_properties() throws Exception { + assertFalse(resolveDistributorEnhancedSchedulingConfig(false)); + assertTrue(resolveDistributorEnhancedSchedulingConfig(true)); + } + + private boolean resolveDistributorEnhancedSchedulingConfig(boolean enhancedScheduling) throws Exception { + var props = new TestProperties(); + if (enhancedScheduling) { + props.distributorEnhancedMaintenanceScheduling(enhancedScheduling); + } + var cluster = createOneNodeCluster(props); + var builder = new StorDistributormanagerConfig.Builder(); + cluster.getDistributorNodes().getConfig(builder); + return (new StorDistributormanagerConfig(builder)).implicitly_clear_bucket_priority_on_schedule(); + } + + @Test public void testDedicatedClusterControllers() { VespaModel noContentModel = createEnd2EndOneNode(new TestProperties().setHostedVespa(true) .setMultitenant(true), |