diff options
author | Harald Musum <musum@verizonmedia.com> | 2023-08-29 09:11:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-29 09:11:19 +0200 |
commit | e7c66eb91bd479cee4d499954ecb176c4361956a (patch) | |
tree | 6308b666003c373e5e20a8e2fa2377d692584f00 /config-model | |
parent | 9600d9e29307c566208dff6f76515b2ee31f3aee (diff) | |
parent | 168f8f6c78d0fa2f09adbbad3c38d274a2ab540a (diff) |
Merge pull request #28199 from vespa-engine/hmusum/remove-use-of-ALLOW_MORE_THAN_ONE_CONTENT_GROUP_DOWN
Stop using feature flag ALLOW_MORE_THAN_ONE_CONTENT_GROUP_DOWN
Diffstat (limited to 'config-model')
6 files changed, 38 insertions, 62 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 9f23c9b7231..31e066cdd8c 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 @@ -84,7 +84,6 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea private Architecture adminClusterNodeResourcesArchitecture = Architecture.getDefault(); private Optional<CloudAccount> cloudAccount = Optional.empty(); private boolean allowUserFilters = true; - private boolean allowMoreThanOneContentGroupDown = false; private List<DataplaneToken> dataplaneTokens; private boolean enableDataplaneProxy; @@ -143,7 +142,6 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea @Override public Optional<CloudAccount> cloudAccount() { return cloudAccount; } @Override public boolean allowUserFilters() { return allowUserFilters; } @Override public boolean enableGlobalPhase() { return true; } // Enable global-phase by default for unit tests only - @Override public boolean allowMoreThanOneContentGroupDown(ClusterSpec.Id id) { return allowMoreThanOneContentGroupDown; } @Override public List<DataplaneToken> dataplaneTokens() { return dataplaneTokens; } @Override public boolean enableDataplaneProxy() { return enableDataplaneProxy; } @@ -369,11 +367,6 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea return this; } - public TestProperties setAllowMoreThanOneContentGroupDown(boolean allowMoreThanOneContentGroupDown) { - this.allowMoreThanOneContentGroupDown = allowMoreThanOneContentGroupDown; - return this; - } - public TestProperties setAllowUserFilters(boolean b) { this.allowUserFilters = b; return this; } public TestProperties setDataplaneTokens(Collection<DataplaneToken> tokens) { diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/ClusterControllerConfig.java b/config-model/src/main/java/com/yahoo/vespa/model/content/ClusterControllerConfig.java index 538a1b49d24..bbbb51beb54 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/ClusterControllerConfig.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/ClusterControllerConfig.java @@ -24,16 +24,11 @@ public class ClusterControllerConfig extends AnyConfigProducer implements Fleetc private final String clusterName; private final ModelElement clusterElement; private final ResourceLimits resourceLimits; - private final boolean allowMoreThanOneContentGroupDown; - public Builder(String clusterName, - ModelElement clusterElement, - ResourceLimits resourceLimits, - boolean allowMoreThanOneContentGroupDown) { + public Builder(String clusterName, ModelElement clusterElement, ResourceLimits resourceLimits) { this.clusterName = clusterName; this.clusterElement = clusterElement; this.resourceLimits = resourceLimits; - this.allowMoreThanOneContentGroupDown = allowMoreThanOneContentGroupDown; } @Override @@ -53,15 +48,13 @@ public class ClusterControllerConfig extends AnyConfigProducer implements Fleetc var tuningConfig = new ClusterControllerTuningBuilder(clusterControllerTuning, minNodeRatioPerGroup, bucketSplittingMinimumBits, - allowMoreThanOneContentGroupDown, numberOfLeafGroups) .build(); return new ClusterControllerConfig(ancestor, clusterName, tuningConfig, - resourceLimits, - allowMoreThanOneContentGroupDown); + resourceLimits); } } @@ -69,18 +62,15 @@ public class ClusterControllerConfig extends AnyConfigProducer implements Fleetc private final String clusterName; private final ClusterControllerTuning tuning; private final ResourceLimits resourceLimits; - private final boolean allowMoreThanOneContentGroupDown; private ClusterControllerConfig(TreeConfigProducer<?> parent, String clusterName, ClusterControllerTuning tuning, - ResourceLimits resourceLimits, - boolean allowMoreThanOneContentGroupDown) { + ResourceLimits resourceLimits) { super(parent, "fleetcontroller"); this.clusterName = clusterName; this.tuning = tuning; this.resourceLimits = resourceLimits; - this.allowMoreThanOneContentGroupDown = allowMoreThanOneContentGroupDown; } @Override @@ -105,7 +95,7 @@ public class ClusterControllerConfig extends AnyConfigProducer implements Fleetc tuning.minStorageUpRatio.ifPresent(builder::min_storage_up_ratio); tuning.minSplitBits.ifPresent(builder::ideal_distribution_bits); tuning.minNodeRatioPerGroup.ifPresent(builder::min_node_ratio_per_group); - tuning.maxGroupsAllowedDown.ifPresent(max -> builder.max_number_of_groups_allowed_to_be_down(allowMoreThanOneContentGroupDown ? max : -1)); + tuning.maxGroupsAllowedDown.ifPresent(builder::max_number_of_groups_allowed_to_be_down); resourceLimits.getConfig(builder); } @@ -127,7 +117,6 @@ public class ClusterControllerConfig extends AnyConfigProducer implements Fleetc ClusterControllerTuningBuilder(ModelElement tuning, Optional<Double> minNodeRatioPerGroup, Optional<Integer> bucketSplittingMinimumBits, - boolean maxGroupsAllowedDown, int numberOfLeafGroups) { this.minSplitBits = bucketSplittingMinimumBits; this.minNodeRatioPerGroup = minNodeRatioPerGroup; @@ -147,12 +136,12 @@ public class ClusterControllerConfig extends AnyConfigProducer implements Fleetc this.stableStateTimePeriod = Optional.ofNullable(tuning.childAsDuration("stable-state-period")); this.minDistributorUpRatio = Optional.ofNullable(tuning.childAsDouble("min-distributor-up-ratio")); this.minStorageUpRatio = Optional.ofNullable(tuning.childAsDouble("min-storage-up-ratio")); - this.maxGroupsAllowedDown = maxGroupsAllowedDown(tuning, maxGroupsAllowedDown, numberOfLeafGroups); + this.maxGroupsAllowedDown = maxGroupsAllowedDown(tuning, numberOfLeafGroups); } } - private static Optional<Integer> maxGroupsAllowedDown(ModelElement tuning, boolean allowMoreThanOneContentGroupDown, int numberOfLeafGroups) { + private static Optional<Integer> maxGroupsAllowedDown(ModelElement tuning, int numberOfLeafGroups) { var groupsAllowedDownRatio = tuning.childAsDouble("groups-allowed-down-ratio"); if (groupsAllowedDownRatio != null) { @@ -160,7 +149,7 @@ public class ClusterControllerConfig extends AnyConfigProducer implements Fleetc throw new IllegalArgumentException("groups-allowed-down-ratio must be between 0 and 1, got " + groupsAllowedDownRatio); var maxGroupsAllowedDown = Math.max(1, (int) Math.floor(groupsAllowedDownRatio * numberOfLeafGroups)); - return allowMoreThanOneContentGroupDown ? Optional.of(maxGroupsAllowedDown) : Optional.empty(); + return Optional.of(maxGroupsAllowedDown); } return Optional.empty(); diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java index 985cef3a5ad..4f98102a61f 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java @@ -167,9 +167,7 @@ public class ContentCluster extends TreeConfigProducer<AnyConfigProducer> implem ClusterResourceLimits resourceLimits) { return new ClusterControllerConfig.Builder(c.clusterId, contentElement, - resourceLimits.getClusterControllerLimits(), - deployState.featureFlags() - .allowMoreThanOneContentGroupDown(new ClusterSpec.Id(c.clusterId))) + resourceLimits.getClusterControllerLimits()) .build(deployState, c, contentElement.getXml()); } diff --git a/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java b/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java index 9126c678171..2f8a8bddf20 100644 --- a/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java +++ b/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java @@ -2379,10 +2379,8 @@ public class ModelProvisioningTest { " </content>" + "</services>"; VespaModelTester tester = new VespaModelTester(); - tester.setModelProperties(new TestProperties().setAllowMoreThanOneContentGroupDown(true)); tester.addHosts(9); - VespaModel model = tester.createModel(servicesXml, true, new DeployState.Builder() - .properties(new TestProperties().setAllowMoreThanOneContentGroupDown(true))); + VespaModel model = tester.createModel(servicesXml, true, new DeployState.Builder().properties(new TestProperties())); var fleetControllerConfigBuilder = new FleetcontrollerConfig.Builder(); model.getConfig(fleetControllerConfigBuilder, "admin/standalone/cluster-controllers/0/components/clustercontroller-content-configurer"); 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 d9632b62fb2..1360ca259dd 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 @@ -1413,32 +1413,32 @@ public class ContentClusterTest extends ContentBaseTest { @Test void testGroupsAllowedToBeDown() { - assertGroupsAllowedsDown(1, 0.5, 1); - assertGroupsAllowedsDown(2, 0.5, 1); - assertGroupsAllowedsDown(3, 0.5, 1); - assertGroupsAllowedsDown(4, 0.5, 2); - assertGroupsAllowedsDown(5, 0.5, 2); - assertGroupsAllowedsDown(6, 0.5, 3); - - assertGroupsAllowedsDown(1, 0.33, 1); - assertGroupsAllowedsDown(2, 0.33, 1); - assertGroupsAllowedsDown(3, 0.33, 1); - assertGroupsAllowedsDown(4, 0.33, 1); - assertGroupsAllowedsDown(5, 0.33, 1); - assertGroupsAllowedsDown(6, 0.33, 1); - - assertGroupsAllowedsDown(1, 0.67, 1); - assertGroupsAllowedsDown(2, 0.67, 1); - assertGroupsAllowedsDown(3, 0.67, 2); - assertGroupsAllowedsDown(4, 0.67, 2); - assertGroupsAllowedsDown(5, 0.67, 3); - assertGroupsAllowedsDown(6, 0.67, 4); - - assertGroupsAllowedsDown(1, 0, 1); - assertGroupsAllowedsDown(2, 0, 1); - - assertGroupsAllowedsDown(1, 1, 1); - assertGroupsAllowedsDown(2, 1, 2); + assertGroupsAllowedDown(1, 0.5, 1); + assertGroupsAllowedDown(2, 0.5, 1); + assertGroupsAllowedDown(3, 0.5, 1); + assertGroupsAllowedDown(4, 0.5, 2); + assertGroupsAllowedDown(5, 0.5, 2); + assertGroupsAllowedDown(6, 0.5, 3); + + assertGroupsAllowedDown(1, 0.33, 1); + assertGroupsAllowedDown(2, 0.33, 1); + assertGroupsAllowedDown(3, 0.33, 1); + assertGroupsAllowedDown(4, 0.33, 1); + assertGroupsAllowedDown(5, 0.33, 1); + assertGroupsAllowedDown(6, 0.33, 1); + + assertGroupsAllowedDown(1, 0.67, 1); + assertGroupsAllowedDown(2, 0.67, 1); + assertGroupsAllowedDown(3, 0.67, 2); + assertGroupsAllowedDown(4, 0.67, 2); + assertGroupsAllowedDown(5, 0.67, 3); + assertGroupsAllowedDown(6, 0.67, 4); + + assertGroupsAllowedDown(1, 0, 1); + assertGroupsAllowedDown(2, 0, 1); + + assertGroupsAllowedDown(1, 1, 1); + assertGroupsAllowedDown(2, 1, 2); } private void assertIndexingDocprocEnabled(boolean indexed, boolean force, boolean expEnabled) { @@ -1478,9 +1478,9 @@ public class ContentClusterTest extends ContentBaseTest { assertIndexingDocprocEnabled(false, true, true); } - private void assertGroupsAllowedsDown(int groupCount, double groupsAllowedDown, int expectedGroupsAllowedDown) { + private void assertGroupsAllowedDown(int groupCount, double groupsAllowedDown, int expectedGroupsAllowedDown) { var services = servicesWithGroups(groupCount, groupsAllowedDown); - var model = createEnd2EndOneNode(new TestProperties().setAllowMoreThanOneContentGroupDown(true), services); + var model = createEnd2EndOneNode(new TestProperties(), services); var fleetControllerConfigBuilder = new FleetcontrollerConfig.Builder(); model.getConfig(fleetControllerConfigBuilder, "admin/cluster-controllers/0/components/clustercontroller-storage-configurer"); diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/FleetControllerClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/FleetControllerClusterTest.java index 2f7ed875226..0d7450aafd5 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/FleetControllerClusterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/FleetControllerClusterTest.java @@ -3,7 +3,6 @@ package com.yahoo.vespa.model.content; import com.yahoo.config.model.deploy.DeployState; import com.yahoo.config.model.deploy.TestProperties; -import com.yahoo.config.provision.ClusterSpec; import com.yahoo.vespa.config.content.FleetcontrollerConfig; import com.yahoo.vespa.model.test.utils.ApplicationPackageUtils; import com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg; @@ -16,7 +15,6 @@ public class FleetControllerClusterTest { private FleetcontrollerConfig parse(String xml, TestProperties props) { var deployStateBuilder = new DeployState.Builder().properties(props); - props.allowMoreThanOneContentGroupDown(new ClusterSpec.Id("default")); var mockPkg = new VespaModelCreatorWithMockPkg(null, xml, ApplicationPackageUtils.generateSchemas("type1")); var model = mockPkg.create(deployStateBuilder); var builder = new FleetcontrollerConfig.Builder(); @@ -48,7 +46,7 @@ public class FleetControllerClusterTest { </cluster-controller> </tuning> </content>""", - new TestProperties().setAllowMoreThanOneContentGroupDown(true)); + new TestProperties()); assertEquals(13 * 1000, config.init_progress_time()); assertEquals(27 * 1000, config.storage_transition_time()); |