Skip to content

Commit

Permalink
Merge pull request #33222 from vespa-engine/hmusum/stop-using-feature…
Browse files Browse the repository at this point in the history
…-flag-2

Stop using feature flag QUERY_DISPATCH_POLICY
  • Loading branch information
hmusum authored Jan 31, 2025
2 parents 2823249 + 29e2442 commit 111afb5
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ interface FeatureFlags {
@ModelFeatureFlag(owners = {"baldersheim"}, comment = "Revisit in May or June 2024") default double defaultTermwiseLimit() { throw new UnsupportedOperationException("TODO specify default value"); }
@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"; }
@ModelFeatureFlag(owners = {"hmusum"}, removeAfter = "8.473") default String queryDispatchPolicy() { return "adaptive"; }
@ModelFeatureFlag(owners = {"baldersheim"}) default double queryDispatchWarmup() { return 5.0; }
@ModelFeatureFlag(owners = {"baldersheim"}) default int defaultNumResponseThreads() { return 2; }
@ModelFeatureFlag(owners = {"baldersheim"}) default int mbusNetworkThreads() { return 1; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
private boolean useDedicatedNodeForLogserver = false;
private double defaultTermwiseLimit = 1.0;
private String jvmGCOptions = null;
private String queryDispatchPolicy = "adaptive";
private String summaryDecodePolicy = "eager";
private String sequencerType = "THROUGHPUT";
private boolean firstTimeDeployment = false;
Expand Down Expand Up @@ -138,7 +137,6 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
@Override public int rpcNumTargets() { return rpc_num_targets; }
@Override public int heapSizePercentage() { return heapSizePercentage; }
@Override public int rpcEventsBeforeWakeup() { return rpc_events_before_wakeup; }
@Override public String queryDispatchPolicy() { return queryDispatchPolicy; }
@Override public String summaryDecodePolicy() { return summaryDecodePolicy; }
@Override public Optional<CloudAccount> cloudAccount() { return cloudAccount; }
@Override public boolean allowUserFilters() { return allowUserFilters; }
Expand Down Expand Up @@ -197,10 +195,7 @@ public TestProperties setJvmGCOptions(String gcOptions) {
jvmGCOptions = gcOptions;
return this;
}
public TestProperties setQueryDispatchPolicy(String policy) {
queryDispatchPolicy = policy;
return this;
}

public TestProperties setSummaryDecodePolicy(String type) {
summaryDecodePolicy = type;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1242,37 +1242,6 @@ void default_topKprobability_controlled_by_properties() {
verifyTopKProbabilityPropertiesControl();
}

private void verifyQueryDispatchPolicy(String policy, DispatchConfig.DistributionPolicy.Enum expected) {
TestProperties properties = new TestProperties();
if (policy != null) {
properties.setQueryDispatchPolicy(policy);
}
VespaModel model = createEnd2EndOneNode(properties);

ContentCluster cc = model.getContentClusters().get("storage");
DispatchConfig.Builder builder = new DispatchConfig.Builder();
cc.getSearch().getConfig(builder);

DispatchConfig cfg = new DispatchConfig(builder);
assertEquals(expected, cfg.distributionPolicy());
}

@Test
public void default_dispatch_controlled_by_properties() {
verifyQueryDispatchPolicy(null, DispatchConfig.DistributionPolicy.ADAPTIVE);
verifyQueryDispatchPolicy("adaptive", DispatchConfig.DistributionPolicy.ADAPTIVE);
verifyQueryDispatchPolicy("round-robin", DispatchConfig.DistributionPolicy.ROUNDROBIN);
verifyQueryDispatchPolicy("best-of-random-2", DispatchConfig.DistributionPolicy.BEST_OF_RANDOM_2);
verifyQueryDispatchPolicy("latency-amortized-over-requests", DispatchConfig.DistributionPolicy.LATENCY_AMORTIZED_OVER_REQUESTS);
verifyQueryDispatchPolicy("latency-amortized-over-time", DispatchConfig.DistributionPolicy.LATENCY_AMORTIZED_OVER_TIME);
try {
verifyQueryDispatchPolicy("unknown", DispatchConfig.DistributionPolicy.ADAPTIVE);
fail();
} catch (IllegalArgumentException e) {
assertEquals("Unknown dispatch policy 'unknown'", e.getMessage());
}
}

private void verifySummaryDecodeType(String policy, DispatchConfig.SummaryDecodePolicy.Enum expected) {
TestProperties properties = new TestProperties();
if (policy != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ public ExecutorService getExecutor() {

public static class FeatureFlags implements ModelContext.FeatureFlags {

private final String queryDispatchPolicy;
private final double queryDispatchWarmup;
private final double defaultTermwiseLimit;
private final String feedSequencer;
Expand Down Expand Up @@ -248,7 +247,6 @@ public FeatureFlags(FlagSource source, ApplicationId appId, Version version) {
this.mbus_cpp_events_before_wakeup = Flags.MBUS_CPP_EVENTS_BEFORE_WAKEUP.bindTo(source).with(appId).with(version).value();
this.rpc_num_targets = Flags.RPC_NUM_TARGETS.bindTo(source).with(appId).with(version).value();
this.rpc_events_before_wakeup = Flags.RPC_EVENTS_BEFORE_WAKEUP.bindTo(source).with(appId).with(version).value();
this.queryDispatchPolicy = Flags.QUERY_DISPATCH_POLICY.bindTo(source).with(appId).with(version).value();
this.queryDispatchWarmup = PermanentFlags.QUERY_DISPATCH_WARMUP.bindTo(source).with(appId).with(version).value();
this.heapPercentage = PermanentFlags.HEAP_SIZE_PERCENTAGE.bindTo(source).with(appId).with(version).value();
this.summaryDecodePolicy = Flags.SUMMARY_DECODE_POLICY.bindTo(source).with(appId).with(version).value();
Expand All @@ -272,7 +270,6 @@ public FeatureFlags(FlagSource source, ApplicationId appId, Version version) {
}

@Override public int heapSizePercentage() { return heapPercentage; }
@Override public String queryDispatchPolicy() { return queryDispatchPolicy; }
@Override public double queryDispatchWarmup() { return queryDispatchWarmup; }
@Override public String summaryDecodePolicy() { return summaryDecodePolicy; }
@Override public double defaultTermwiseLimit() { return defaultTermwiseLimit; }
Expand Down
8 changes: 0 additions & 8 deletions flags/src/main/java/com/yahoo/vespa/flags/Flags.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ public class Flags {
"Takes effect at redeployment",
INSTANCE_ID);

public static final UnboundStringFlag QUERY_DISPATCH_POLICY = defineStringFlag(
"query-dispatch-policy", "adaptive",
List.of("baldersheim"), "2022-08-20", "2025-03-01",
"Select query dispatch policy, valid values are adaptive, round-robin, best-of-random-2," +
" latency-amortized-over-requests, latency-amortized-over-time",
"Takes effect at redeployment (requires restart)",
INSTANCE_ID);

public static final UnboundStringFlag SUMMARY_DECODE_POLICY = defineStringFlag(
"summary-decode-policy", "eager",
List.of("baldersheim"), "2023-03-30", "2025-03-01",
Expand Down

0 comments on commit 111afb5

Please sign in to comment.