diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-09-26 22:52:09 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-09-27 08:22:49 +0200 |
commit | 30ed522487bfeb722749a0827b7861326346645d (patch) | |
tree | 98af4a9734931844f65e3dd1cce583f8197046db /config-model/src | |
parent | 9377da84086392e118d69b467006e73fe9ae3f70 (diff) |
GC fully deployed featuer flag enforce-rank-profile-inheritance
Diffstat (limited to 'config-model/src')
4 files changed, 4 insertions, 37 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 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()); } } |