diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-09-30 11:18:21 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-09-30 11:18:33 +0200 |
commit | d4676c26c8dd26c05a72257fa4c9e8b69b0c0ab0 (patch) | |
tree | a970e31012593b831f9ad084099787d8164f19a4 | |
parent | e22ff8637d9f86cd56d9e9ff410b7d4b87bfe637 (diff) |
Always doing three phase updates now.
7 files changed, 6 insertions, 53 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java b/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java index 78f62d7d3d8..837c0749548 100644 --- a/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java @@ -73,7 +73,7 @@ public interface ModelContext { */ interface FeatureFlags { @ModelFeatureFlag(owners = {"baldersheim"}, comment = "Revisit in May or June 2021") default double defaultTermwiseLimit() { throw new UnsupportedOperationException("TODO specify default value"); } - @ModelFeatureFlag(owners = {"vekterli"}) default boolean useThreePhaseUpdates() { return true; } + @ModelFeatureFlag(owners = {"vekterli"}, removeAfter="7.last") default boolean useThreePhaseUpdates() { return true; } @ModelFeatureFlag(owners = {"baldersheim"}, comment = "Select sequencer type use while feeding") default String feedSequencerType() { return "THROUGHPUT"; } @ModelFeatureFlag(owners = {"baldersheim"}) default String responseSequencerType() { throw new UnsupportedOperationException("TODO specify default value"); } @ModelFeatureFlag(owners = {"baldersheim"}) default String queryDispatchPolicy() { return "adaptive"; } 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 e37959054c5..39d1a76341e 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 @@ -38,7 +38,6 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea private Zone zone; private final Set<ContainerEndpoint> endpoints = Collections.emptySet(); private boolean useDedicatedNodeForLogserver = false; - private boolean useThreePhaseUpdates = false; private double defaultTermwiseLimit = 1.0; private String jvmGCOptions = null; private String queryDispatchPolicy = "adaptive"; @@ -107,7 +106,6 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea @Override public boolean useDedicatedNodeForLogserver() { return useDedicatedNodeForLogserver; } @Override public Optional<EndpointCertificateSecrets> endpointCertificateSecrets() { return endpointCertificateSecrets; } @Override public double defaultTermwiseLimit() { return defaultTermwiseLimit; } - @Override public boolean useThreePhaseUpdates() { return useThreePhaseUpdates; } @Override public Optional<AthenzDomain> athenzDomain() { return Optional.ofNullable(athenzDomain); } @Override public String responseSequencerType() { return responseSequencerType; } @Override public int defaultNumResponseThreads() { return responseNumThreads; } @@ -236,11 +234,6 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea return this; } - public TestProperties setUseThreePhaseUpdates(boolean useThreePhaseUpdates) { - this.useThreePhaseUpdates = useThreePhaseUpdates; - return this; - } - public TestProperties setApplicationId(ApplicationId applicationId) { this.applicationId = applicationId; 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 b8e27d92f8c..b1258247e2e 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 @@ -25,22 +25,12 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl public static final Logger log = Logger.getLogger(DistributorCluster.class.getPackage().toString()); - private static class GcOptions { - - public final int interval; - public final String selection; - - public GcOptions(int interval, String selection) { - this.interval = interval; - this.selection = selection; - } - } + private record GcOptions(int interval, String selection) { } private final ContentCluster parent; private final BucketSplitting bucketSplitting; private final GcOptions gc; private final boolean hasIndexedDocumentType; - private final boolean useThreePhaseUpdates; private final int maxActivationInhibitedOutOfSyncGroups; private final boolean unorderedMergeChaining; private final boolean useTwoPhaseDocumentGc; @@ -99,26 +89,24 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl } @Override - protected DistributorCluster doBuild(DeployState deployState, AbstractConfigProducer ancestor, Element producerSpec) { + protected DistributorCluster doBuild(DeployState deployState, AbstractConfigProducer<?> ancestor, Element producerSpec) { final ModelElement clusterElement = new ModelElement(producerSpec); final ModelElement documentsNode = clusterElement.child("documents"); final GcOptions gc = parseGcOptions(documentsNode); final boolean hasIndexedDocumentType = clusterContainsIndexedDocumentType(documentsNode); - boolean useThreePhaseUpdates = deployState.getProperties().featureFlags().useThreePhaseUpdates(); int maxInhibitedGroups = deployState.getProperties().featureFlags().maxActivationInhibitedOutOfSyncGroups(); boolean unorderedMergeChaining = deployState.getProperties().featureFlags().unorderedMergeChaining(); boolean useTwoPhaseDocumentGc = deployState.getProperties().featureFlags().useTwoPhaseDocumentGc(); return new DistributorCluster(parent, new BucketSplitting.Builder().build(new ModelElement(producerSpec)), gc, - hasIndexedDocumentType, useThreePhaseUpdates, + hasIndexedDocumentType, maxInhibitedGroups, unorderedMergeChaining, useTwoPhaseDocumentGc); } } private DistributorCluster(ContentCluster parent, BucketSplitting bucketSplitting, GcOptions gc, boolean hasIndexedDocumentType, - boolean useThreePhaseUpdates, int maxActivationInhibitedOutOfSyncGroups, boolean unorderedMergeChaining, boolean useTwoPhaseDocumentGc) @@ -128,7 +116,6 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl this.bucketSplitting = bucketSplitting; this.gc = gc; this.hasIndexedDocumentType = hasIndexedDocumentType; - this.useThreePhaseUpdates = useThreePhaseUpdates; this.maxActivationInhibitedOutOfSyncGroups = maxActivationInhibitedOutOfSyncGroups; this.unorderedMergeChaining = unorderedMergeChaining; this.useTwoPhaseDocumentGc = useTwoPhaseDocumentGc; @@ -142,8 +129,7 @@ public class DistributorCluster extends AbstractConfigProducer<Distributor> impl .interval(gc.interval)); } builder.enable_revert(parent.getPersistence().supportRevert()); - builder.disable_bucket_activation(hasIndexedDocumentType == false); - builder.enable_metadata_only_fetch_phase_for_inconsistent_updates(useThreePhaseUpdates); + builder.disable_bucket_activation(!hasIndexedDocumentType); builder.max_activation_inhibited_out_of_sync_groups(maxActivationInhibitedOutOfSyncGroups); builder.use_unordered_merge_chaining(unorderedMergeChaining); builder.enable_two_phase_garbage_collection(useTwoPhaseDocumentGc); 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 ac291fc578f..0ba47d9c58b 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 @@ -1036,22 +1036,6 @@ public class ContentClusterTest extends ContentBaseTest { } } - private boolean resolveThreePhaseUpdateConfigWithFeatureFlag(boolean flagEnableThreePhase) { - VespaModel model = createEnd2EndOneNode(new TestProperties().setUseThreePhaseUpdates(flagEnableThreePhase)); - - ContentCluster cc = model.getContentClusters().get("storage"); - var builder = new StorDistributormanagerConfig.Builder(); - cc.getDistributorNodes().getConfig(builder); - - return (new StorDistributormanagerConfig(builder)).enable_metadata_only_fetch_phase_for_inconsistent_updates(); - } - - @Test - void default_distributor_three_phase_update_config_controlled_by_properties() { - assertFalse(resolveThreePhaseUpdateConfigWithFeatureFlag(false)); - assertTrue(resolveThreePhaseUpdateConfigWithFeatureFlag(true)); - } - private int resolveMaxCompactBuffers(OptionalInt maxCompactBuffers) { TestProperties testProperties = new TestProperties(); if (maxCompactBuffers.isPresent()) { diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java index b5ef5f7f804..353c8c49053 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java @@ -168,7 +168,6 @@ public class ModelContextImpl implements ModelContext { private final String queryDispatchPolicy; private final double defaultTermwiseLimit; - private final boolean useThreePhaseUpdates; private final String feedSequencer; private final String responseSequencer; private final int numResponseThreads; @@ -220,7 +219,6 @@ public class ModelContextImpl implements ModelContext { public FeatureFlags(FlagSource source, ApplicationId appId, Version version) { this.defaultTermwiseLimit = flagValue(source, appId, version, Flags.DEFAULT_TERM_WISE_LIMIT); - this.useThreePhaseUpdates = flagValue(source, appId, version, Flags.USE_THREE_PHASE_UPDATES); this.feedSequencer = flagValue(source, appId, version, Flags.FEED_SEQUENCER_TYPE); this.responseSequencer = flagValue(source, appId, version, Flags.RESPONSE_SEQUENCER_TYPE); this.numResponseThreads = flagValue(source, appId, version, Flags.RESPONSE_NUM_THREADS); @@ -274,7 +272,6 @@ public class ModelContextImpl implements ModelContext { @Override public String queryDispatchPolicy() { return queryDispatchPolicy; } @Override public double defaultTermwiseLimit() { return defaultTermwiseLimit; } - @Override public boolean useThreePhaseUpdates() { return useThreePhaseUpdates; } @Override public String feedSequencerType() { return feedSequencer; } @Override public String responseSequencerType() { return responseSequencer; } @Override public int defaultNumResponseThreads() { return numResponseThreads; } diff --git a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java index 90e548d3ebd..4b42c055865 100644 --- a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java +++ b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java @@ -126,13 +126,6 @@ public class Flags { "Takes effect at redeployment", ZONE_ID, APPLICATION_ID); - public static final UnboundBooleanFlag USE_THREE_PHASE_UPDATES = defineFeatureFlag( - "use-three-phase-updates", true, - List.of("vekterli"), "2020-12-02", "2022-10-01", - "Whether to enable the use of three-phase updates when bucket replicas are out of sync.", - "Takes effect at redeployment", - ZONE_ID, APPLICATION_ID); - public static final UnboundBooleanFlag USE_ASYNC_MESSAGE_HANDLING_ON_SCHEDULE = defineFeatureFlag( "async-message-handling-on-schedule", false, List.of("baldersheim"), "2020-12-02", "2023-01-01", diff --git a/storage/src/vespa/storage/config/stor-distributormanager.def b/storage/src/vespa/storage/config/stor-distributormanager.def index e363f53a4ea..9ecd39cdd01 100644 --- a/storage/src/vespa/storage/config/stor-distributormanager.def +++ b/storage/src/vespa/storage/config/stor-distributormanager.def @@ -242,7 +242,7 @@ use_weak_internal_read_consistency_for_client_gets bool default=false ## Setting this option to true always implicitly enables the fast update restart ## feature, so it's not required to set that config to true, nor will setting it ## to false actually disable the feature. -enable_metadata_only_fetch_phase_for_inconsistent_updates bool default=false +enable_metadata_only_fetch_phase_for_inconsistent_updates bool default=true ## If a distributor main thread tick is constantly processing requests or responses ## originating from other nodes, setting this value above zero will prevent implicit |