summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-09-26 22:52:09 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2021-09-27 08:22:49 +0200
commit30ed522487bfeb722749a0827b7861326346645d (patch)
tree98af4a9734931844f65e3dd1cce583f8197046db
parent9377da84086392e118d69b467006e73fe9ae3f70 (diff)
GC fully deployed featuer flag enforce-rank-profile-inheritance
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java2
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java5
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java14
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/derived/RankProfileList.java6
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/RankProfileTestCase.java16
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java4
-rw-r--r--flags/src/main/java/com/yahoo/vespa/flags/Flags.java7
7 files changed, 5 insertions, 49 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 2870b88d105..d38cb1a2207 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
@@ -80,7 +80,7 @@ public interface ModelContext {
@ModelFeatureFlag(owners = {"baldersheim"}) default boolean useAsyncMessageHandlingOnSchedule() { throw new UnsupportedOperationException("TODO specify default value"); }
@ModelFeatureFlag(owners = {"baldersheim"}) default double feedConcurrency() { throw new UnsupportedOperationException("TODO specify default value"); }
@ModelFeatureFlag(owners = {"baldersheim"}) default int metricsproxyNumThreads() { throw new UnsupportedOperationException("TODO specify default value"); }
- @ModelFeatureFlag(owners = {"baldersheim"}) default boolean enforceRankProfileInheritance() { return false; }
+ @ModelFeatureFlag(owners = {"baldersheim"}, removeAfter = "7.472") default boolean enforceRankProfileInheritance() { return true; }
@ModelFeatureFlag(owners = {"baldersheim"}) default int largeRankExpressionLimit() { return 8192; }
@ModelFeatureFlag(owners = {"baldersheim"}, removeAfter = "7.468") default boolean useExternalRankExpressions() { return true; }
@ModelFeatureFlag(owners = {"baldersheim"}, removeAfter = "7.468") default boolean distributeExternalRankExpressions() { return true; }
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 dea6b980692..e27e0e7624f 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
@@ -107,7 +107,6 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
@Override public double resourceLimitMemory() { return resourceLimitMemory; }
@Override public double minNodeRatioPerGroup() { return minNodeRatioPerGroup; }
@Override public int metricsproxyNumThreads() { return 1; }
- @Override public boolean enforceRankProfileInheritance() { return enforceRankProfileInheritance; }
@Override public double containerShutdownTimeout() { return containerShutdownTimeout; }
@Override public boolean containerDumpHeapOnShutdownTimeout() { return containerDumpHeapOnShutdownTimeout; }
public TestProperties containerDumpHeapOnShutdownTimeout(boolean value) {
@@ -118,10 +117,6 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
containerShutdownTimeout = value;
return this;
}
- public TestProperties enforceRankProfileInheritance(boolean value) {
- enforceRankProfileInheritance = value;
- return this;
- }
public TestProperties largeRankExpressionLimit(int value) {
largeRankExpressionLimit = value;
return this;
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java
index 9d51d39f3d0..d169760538d 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java
@@ -227,12 +227,7 @@ public class RankProfile implements Cloneable {
String msg = "rank-profile '" + getName() + "' inherits '" + inheritedName +
"', but it does not exist anywhere in the inheritance of search '" +
((getSearch() != null) ? getSearch().getName() : " global rank profiles") + "'.";
- if (search.getDeployProperties().featureFlags().enforceRankProfileInheritance()) {
- throw new IllegalArgumentException(msg);
- } else {
- deployLogger.logApplicationPackage(Level.WARNING, msg);
- inherited = resolveIndependentOfInheritance();
- }
+ throw new IllegalArgumentException(msg);
} else {
List<String> children = new ArrayList<>();
children.add(createFullyQualifiedName());
@@ -241,12 +236,7 @@ public class RankProfile implements Cloneable {
}
return inherited;
}
- private RankProfile resolveIndependentOfInheritance() {
- for (RankProfile rankProfile : rankProfileRegistry.all()) {
- if (rankProfile.getName().equals(inheritedName)) return rankProfile;
- }
- return null;
- }
+
private String createFullyQualifiedName() {
return (search != null)
? (search.getName() + "." + getName())
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/derived/RankProfileList.java b/config-model/src/main/java/com/yahoo/searchdefinition/derived/RankProfileList.java
index 46b785ccf42..ad85f68cb8a 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/derived/RankProfileList.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/derived/RankProfileList.java
@@ -100,12 +100,6 @@ public class RankProfileList extends Derived implements RankProfilesConfig.Produ
remaining.forEach((name, rank) -> {
if (areDependenciesReady(rank, rankProfileRegistry)) ready.add(rank);
});
- if (ready.isEmpty() && ! deployProperties.featureFlags().enforceRankProfileInheritance()) {
- // Dirty fallback to allow incorrect rankprofile inheritance to pass for now.
- // We then handle one by one.
- // TODO remove ASAP
- ready.add(remaining.values().iterator().next());
- }
processRankProfiles(ready, queryProfiles, importedModels, search, attributeFields, deployProperties, executor);
ready.forEach(rank -> remaining.remove(rank.getName()));
}
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/RankProfileTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/RankProfileTestCase.java
index 2c1f68e5ecc..aa068ec8f0e 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/RankProfileTestCase.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/RankProfileTestCase.java
@@ -118,13 +118,8 @@ public class RankProfileTestCase extends SchemaTestCase {
@Test
public void requireThatSidewaysInheritanceIsImpossible() throws ParseException {
- verifySidewaysInheritance(false);
- verifySidewaysInheritance(true);
- }
- private void verifySidewaysInheritance(boolean enforce) throws ParseException {
RankProfileRegistry registry = new RankProfileRegistry();
- SearchBuilder builder = new SearchBuilder(registry, setupQueryProfileTypes(),
- new TestProperties().enforceRankProfileInheritance(enforce));
+ SearchBuilder builder = new SearchBuilder(registry, setupQueryProfileTypes());
builder.importString(joinLines(
"schema child1 {",
" document child1 {",
@@ -168,15 +163,8 @@ public class RankProfileTestCase extends SchemaTestCase {
"}"));
try {
builder.build(true);
- if (enforce) {
- fail("Sideways inheritance should have been enforced");
- } else {
- assertNotNull(builder.getSearch("child2"));
- assertNotNull(builder.getSearch("child1"));
- assertTrue(registry.get("child1", "child").inherits("parent"));
- }
+ fail("Sideways inheritance should have been enforced");
} catch (IllegalArgumentException e) {
- if (!enforce) fail("Sideways inheritance should have been allowed");
assertEquals("rank-profile 'child' inherits 'parent', but it does not exist anywhere in the inheritance of search 'child1'.", e.getMessage());
}
}
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 0198e5899da..8dedb5a29c9 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
@@ -187,7 +187,6 @@ public class ModelContextImpl implements ModelContext {
private final double resourceLimitMemory;
private final double minNodeRatioPerGroup;
private final int metricsproxyNumThreads;
- private final boolean enforceRankProfileInheritance;
private final boolean newLocationBrokerLogic;
private final boolean containerDumpHeapOnShutdownTimeout;
private final double containerShutdownTimeout;
@@ -216,7 +215,6 @@ public class ModelContextImpl implements ModelContext {
this.resourceLimitMemory = flagValue(source, appId, PermanentFlags.RESOURCE_LIMIT_MEMORY);
this.minNodeRatioPerGroup = flagValue(source, appId, Flags.MIN_NODE_RATIO_PER_GROUP);
this.metricsproxyNumThreads = flagValue(source, appId, Flags.METRICSPROXY_NUM_THREADS);
- this.enforceRankProfileInheritance = flagValue(source, appId, Flags.ENFORCE_RANK_PROFILE_INHERITANCE);
this.newLocationBrokerLogic = flagValue(source, appId, Flags.NEW_LOCATION_BROKER_LOGIC);
this.containerDumpHeapOnShutdownTimeout = flagValue(source, appId, Flags.CONTAINER_DUMP_HEAP_ON_SHUTDOWN_TIMEOUT);
this.containerShutdownTimeout = flagValue(source, appId,Flags.CONTAINER_SHUTDOWN_TIMEOUT);
@@ -252,8 +250,6 @@ public class ModelContextImpl implements ModelContext {
@Override public double containerShutdownTimeout() { return containerShutdownTimeout; }
@Override public boolean containerDumpHeapOnShutdownTimeout() { return containerDumpHeapOnShutdownTimeout; }
- @Override public boolean enforceRankProfileInheritance() { return enforceRankProfileInheritance; }
-
private static <V> V flagValue(FlagSource source, ApplicationId appId, UnboundFlag<? extends V, ?, ?> flag) {
return flag.bindTo(source)
.with(FetchVector.Dimension.APPLICATION_ID, appId.serializedForm())
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 69d325d4841..c1ea44b7d46 100644
--- a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
+++ b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
@@ -79,13 +79,6 @@ public class Flags {
"Takes effect at redeployment",
ZONE_ID, APPLICATION_ID);
- public static final UnboundBooleanFlag ENFORCE_RANK_PROFILE_INHERITANCE = defineFeatureFlag(
- "enforce-rank-profile-inheritance", true,
- List.of("baldersheim"), "2021-09-07", "2021-10-01",
- "Should we enforce verification of rank-profile inheritance.",
- "Takes effect at redeployment",
- ZONE_ID, APPLICATION_ID);
-
public static final UnboundBooleanFlag SKIP_MBUS_REQUEST_THREAD = defineFeatureFlag(
"skip-mbus-request-thread", false,
List.of("baldersheim"), "2020-12-02", "2022-01-01",