From 04ff50210cba21487fb78728831ed339ecd82fff Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Mon, 17 Apr 2023 19:29:17 +0200 Subject: Refactor cluster controller tuning config --- .../ClusterControllerConfigurer.java | 8 +- .../model/content/ClusterControllerConfig.java | 143 +++++++++------------ 2 files changed, 66 insertions(+), 85 deletions(-) (limited to 'config-model/src/main') diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerConfigurer.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerConfigurer.java index d63301a9668..25cca42f703 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerConfigurer.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerConfigurer.java @@ -16,16 +16,16 @@ public class ClusterControllerConfigurer extends SimpleComponent implements Stor FleetcontrollerConfig.Producer { private final ContentCluster cluster; - private final int index; + private final int clusterControllerIndex; private final int nodeCount; - public ClusterControllerConfigurer(ContentCluster cluster, int index, int nodeCount) { + public ClusterControllerConfigurer(ContentCluster cluster, int clusterControllerIndex, int nodeCount) { super(new ComponentModel(new BundleInstantiationSpecification( new ComponentSpecification("clustercontroller" + "-" + cluster.getName() + "-configurer"), new ComponentSpecification("com.yahoo.vespa.clustercontroller.apps.clustercontroller.ClusterControllerClusterConfigurer"), new ComponentSpecification("clustercontroller-apps")))); this.cluster = cluster; - this.index = index; + this.clusterControllerIndex = clusterControllerIndex; this.nodeCount = nodeCount; } @@ -38,7 +38,7 @@ public class ClusterControllerConfigurer extends SimpleComponent implements Stor public void getConfig(FleetcontrollerConfig.Builder builder) { cluster.getConfig(builder); cluster.getClusterControllerConfig().getConfig(builder); - builder.index(index); + builder.index(clusterControllerIndex); builder.fleet_controller_count(nodeCount); builder.http_port(0); builder.rpc_port(0); 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 201e0b5693a..49d63cbfba3 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 @@ -2,15 +2,16 @@ package com.yahoo.vespa.model.content; import com.yahoo.config.model.deploy.DeployState; +import com.yahoo.config.model.producer.AbstractConfigProducerRoot; import com.yahoo.config.model.producer.AnyConfigProducer; import com.yahoo.config.model.producer.TreeConfigProducer; -import com.yahoo.config.model.producer.AbstractConfigProducerRoot; import com.yahoo.vespa.config.content.FleetcontrollerConfig; import com.yahoo.vespa.model.VespaModel; import com.yahoo.vespa.model.builder.xml.dom.ModelElement; import com.yahoo.vespa.model.builder.xml.dom.VespaDomBuilder; import com.yahoo.vespa.model.utils.Duration; import org.w3c.dom.Element; +import java.util.Optional; /** * Config generation for common parameters for all fleet controllers. @@ -35,76 +36,38 @@ public class ClusterControllerConfig extends AnyConfigProducer implements Fleetc @Override protected ClusterControllerConfig doBuild(DeployState deployState, TreeConfigProducer ancestor, Element producerSpec) { - ModelElement tuning = null; - - ModelElement clusterTuning = clusterElement.child("tuning"); - Integer bucketSplittingMinimumBits = null; - Double minNodeRatioPerGroup = deployState.getProperties().featureFlags().minNodeRatioPerGroup(); - if (clusterTuning != null) { - tuning = clusterTuning.child("cluster-controller"); - minNodeRatioPerGroup = clusterTuning.childAsDouble("min-node-ratio-per-group"); - bucketSplittingMinimumBits = clusterTuning.childAsInteger("bucket-splitting.minimum-bits"); - } + ModelElement tuning = clusterElement.child("tuning"); + ModelElement clusterControllerTuning = null; + Optional minNodeRatioPerGroup = Optional.of(deployState.featureFlags().minNodeRatioPerGroup()); + Optional bucketSplittingMinimumBits = Optional.empty(); if (tuning != null) { - return new ClusterControllerConfig(ancestor, clusterName, - tuning.childAsDuration("init-progress-time"), - tuning.childAsDuration("transition-time"), - tuning.childAsLong("max-premature-crashes"), - tuning.childAsDuration("stable-state-period"), - tuning.childAsDouble("min-distributor-up-ratio"), - tuning.childAsDouble("min-storage-up-ratio"), - bucketSplittingMinimumBits, - minNodeRatioPerGroup, - resourceLimits, - allowMoreThanOneContentGroupDown); - } else { - return new ClusterControllerConfig(ancestor, clusterName, - null, null, null, null, null, null, - bucketSplittingMinimumBits, - minNodeRatioPerGroup, - resourceLimits, - allowMoreThanOneContentGroupDown); + minNodeRatioPerGroup = Optional.ofNullable(tuning.childAsDouble("min-node-ratio-per-group")); + bucketSplittingMinimumBits = Optional.ofNullable(tuning.childAsInteger("bucket-splitting.minimum-bits")); + clusterControllerTuning = tuning.child("cluster-controller"); } + + return new ClusterControllerConfig(ancestor, + clusterName, + new ClusterControllerTuning(clusterControllerTuning, minNodeRatioPerGroup, bucketSplittingMinimumBits), + resourceLimits, + allowMoreThanOneContentGroupDown); } } private final String clusterName; - private final Duration initProgressTime; - private final Duration transitionTime; - private final Long maxPrematureCrashes; - private final Duration stableStateTimePeriod; - private final Double minDistributorUpRatio; - private final Double minStorageUpRatio; - private final Integer minSplitBits; - private final Double minNodeRatioPerGroup; + private final ClusterControllerTuning tuning; private final ResourceLimits resourceLimits; private final boolean allowMoreThanOneContentGroupDown; - // TODO refactor; too many args private ClusterControllerConfig(TreeConfigProducer parent, String clusterName, - Duration initProgressTime, - Duration transitionTime, - Long maxPrematureCrashes, - Duration stableStateTimePeriod, - Double minDistributorUpRatio, - Double minStorageUpRatio, - Integer minSplitBits, - Double minNodeRatioPerGroup, + ClusterControllerTuning tuning, ResourceLimits resourceLimits, boolean allowMoreThanOneContentGroupDown) { super(parent, "fleetcontroller"); - this.clusterName = clusterName; - this.initProgressTime = initProgressTime; - this.transitionTime = transitionTime; - this.maxPrematureCrashes = maxPrematureCrashes; - this.stableStateTimePeriod = stableStateTimePeriod; - this.minDistributorUpRatio = minDistributorUpRatio; - this.minStorageUpRatio = minStorageUpRatio; - this.minSplitBits = minSplitBits; - this.minNodeRatioPerGroup = minNodeRatioPerGroup; + this.tuning = tuning; this.resourceLimits = resourceLimits; this.allowMoreThanOneContentGroupDown = allowMoreThanOneContentGroupDown; } @@ -113,8 +76,7 @@ public class ClusterControllerConfig extends AnyConfigProducer implements Fleetc public void getConfig(FleetcontrollerConfig.Builder builder) { AbstractConfigProducerRoot root = getRoot(); if (root instanceof VespaModel) { - String zooKeeperAddress = - root.getAdmin().getZooKeepersConfigProvider().getZooKeepersConnectionSpec(); + String zooKeeperAddress = root.getAdmin().getZooKeepersConfigProvider().getZooKeepersConnectionSpec(); builder.zookeeper_server(zooKeeperAddress); } else { builder.zookeeper_server(""); @@ -124,32 +86,51 @@ public class ClusterControllerConfig extends AnyConfigProducer implements Fleetc builder.cluster_name(clusterName); builder.fleet_controller_count(getChildren().size()); - if (initProgressTime != null) { - builder.init_progress_time((int) initProgressTime.getMilliSeconds()); - } - if (transitionTime != null) { - builder.storage_transition_time((int) transitionTime.getMilliSeconds()); - } - if (maxPrematureCrashes != null) { - builder.max_premature_crashes(maxPrematureCrashes.intValue()); - } - if (stableStateTimePeriod != null) { - builder.stable_state_time_period((int) stableStateTimePeriod.getMilliSeconds()); - } - if (minDistributorUpRatio != null) { - builder.min_distributor_up_ratio(minDistributorUpRatio); - } - if (minStorageUpRatio != null) { - builder.min_storage_up_ratio(minStorageUpRatio); - } - if (minSplitBits != null) { - builder.ideal_distribution_bits(minSplitBits); - } - if (minNodeRatioPerGroup != null) { - builder.min_node_ratio_per_group(minNodeRatioPerGroup); - } + tuning.initProgressTime.ifPresent(i -> builder.init_progress_time((int) i.getMilliSeconds())); + tuning.transitionTime.ifPresent(t -> builder.storage_transition_time((int) t.getMilliSeconds())); + tuning.maxPrematureCrashes.ifPresent(var -> builder.max_premature_crashes(var.intValue())); + tuning.stableStateTimePeriod.ifPresent(var -> builder.stable_state_time_period((int) var.getMilliSeconds())); + tuning.minDistributorUpRatio.ifPresent(builder::min_distributor_up_ratio); + tuning.minStorageUpRatio.ifPresent(builder::min_storage_up_ratio); + tuning.minSplitBits.ifPresent(builder::ideal_distribution_bits); + tuning.minNodeRatioPerGroup.ifPresent(builder::min_node_ratio_per_group); + resourceLimits.getConfig(builder); builder.max_number_of_groups_allowed_to_be_down(allowMoreThanOneContentGroupDown ? 1 : -1); } + private static class ClusterControllerTuning { + + private final Optional minNodeRatioPerGroup; + private final Optional initProgressTime; + private final Optional transitionTime; + private final Optional maxPrematureCrashes; + private final Optional stableStateTimePeriod; + private final Optional minDistributorUpRatio; + private final Optional minStorageUpRatio; + private final Optional minSplitBits; + + ClusterControllerTuning(ModelElement tuning, + Optional minNodeRatioPerGroup, + Optional bucketSplittingMinimumBits) { + this.minSplitBits = bucketSplittingMinimumBits; + this.minNodeRatioPerGroup = minNodeRatioPerGroup; + if (tuning == null) { + this.initProgressTime = Optional.empty(); + this.transitionTime = Optional.empty(); + this.maxPrematureCrashes = Optional.empty(); + this.stableStateTimePeriod = Optional.empty(); + this.minDistributorUpRatio = Optional.empty(); + this.minStorageUpRatio = Optional.empty(); + } else { + this.initProgressTime = Optional.ofNullable(tuning.childAsDuration("init-progress-time")); + this.transitionTime = Optional.ofNullable(tuning.childAsDuration("transition-time")); + this.maxPrematureCrashes = Optional.ofNullable(tuning.childAsLong("max-premature-crashes")); + 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")); + } + } + } + } -- cgit v1.2.3 From ab4a5285fced06c0462d523a1d9538b334cd553e Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Thu, 20 Apr 2023 14:46:20 +0200 Subject: Add support for max groups allowed down in services.xml Undocumented for now, need an architecture review on naming and placement in services.xml --- .../yahoo/config/model/deploy/TestProperties.java | 7 +++ .../model/content/ClusterControllerConfig.java | 11 ++++- .../model/content/cluster/ContentCluster.java | 25 ++++++++-- config-model/src/main/resources/schema/content.rnc | 3 +- .../vespa/model/content/ContentClusterTest.java | 54 ++++++++++++++++++++-- .../model/content/FleetControllerClusterTest.java | 39 ++++++++-------- .../model/content/utils/ContentClusterUtils.java | 2 +- .../test/utils/VespaModelCreatorWithMockPkg.java | 2 +- 8 files changed, 111 insertions(+), 32 deletions(-) (limited to 'config-model/src/main') 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 c72aa23a836..540905bef4c 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 @@ -83,6 +83,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea private boolean useRestrictedDataPlaneBindings = false; private Optional cloudAccount = Optional.empty(); private boolean allowUserFilters = true; + private boolean allowMoreThanOneContentGroupDown = false; @Override public ModelContext.FeatureFlags featureFlags() { return this; } @Override public boolean multitenant() { return multitenant; } @@ -140,6 +141,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea @Override public Optional 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; } public TestProperties sharedStringRepoNoReclaim(boolean sharedStringRepoNoReclaim) { this.sharedStringRepoNoReclaim = sharedStringRepoNoReclaim; @@ -368,6 +370,11 @@ 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 static class Spec implements ConfigServerSpec { 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 49d63cbfba3..5a96e33c522 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 @@ -94,12 +94,14 @@ 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)); resourceLimits.getConfig(builder); - builder.max_number_of_groups_allowed_to_be_down(allowMoreThanOneContentGroupDown ? 1 : -1); } - private static class ClusterControllerTuning { + public ClusterControllerTuning tuning() { return tuning; } + + public static class ClusterControllerTuning { private final Optional minNodeRatioPerGroup; private final Optional initProgressTime; @@ -109,6 +111,7 @@ public class ClusterControllerConfig extends AnyConfigProducer implements Fleetc private final Optional minDistributorUpRatio; private final Optional minStorageUpRatio; private final Optional minSplitBits; + final Optional maxGroupsAllowedDown; ClusterControllerTuning(ModelElement tuning, Optional minNodeRatioPerGroup, @@ -122,6 +125,7 @@ public class ClusterControllerConfig extends AnyConfigProducer implements Fleetc this.stableStateTimePeriod = Optional.empty(); this.minDistributorUpRatio = Optional.empty(); this.minStorageUpRatio = Optional.empty(); + this.maxGroupsAllowedDown = Optional.empty(); } else { this.initProgressTime = Optional.ofNullable(tuning.childAsDuration("init-progress-time")); this.transitionTime = Optional.ofNullable(tuning.childAsDuration("transition-time")); @@ -129,8 +133,11 @@ 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 = Optional.ofNullable(tuning.childAsInteger("max-groups-allowed-down")); } } + + public Optional maxGroupsAllowedDown() { return maxGroupsAllowedDown; } } } 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 217c26516a9..f1f210b013c 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 @@ -125,11 +125,6 @@ public class ContentCluster extends TreeConfigProducer implem deployState.featureFlags().resourceLimitDisk(), deployState.featureFlags().resourceLimitMemory()) .build(contentElement); - c.clusterControllerConfig = new ClusterControllerConfig.Builder(clusterId, - contentElement, - resourceLimits.getClusterControllerLimits(), - deployState.featureFlags().allowMoreThanOneContentGroupDown(new ClusterSpec.Id(clusterId))) - .build(deployState, c, contentElement.getXml()); c.search = new ContentSearchCluster.Builder(documentDefinitions, globallyDistributedDocuments, fractionOfMemoryReserved(clusterId, containers), @@ -139,6 +134,7 @@ public class ContentCluster extends TreeConfigProducer implem c.storageNodes = new StorageCluster.Builder().build(deployState, c, w3cContentElement); c.distributorNodes = new DistributorCluster.Builder(c).build(deployState, c, w3cContentElement); c.rootGroup = new StorageGroup.Builder(contentElement, context).buildRootGroup(deployState, redundancyBuilder, c); + c.clusterControllerConfig = createClusterControllerConfig(contentElement, deployState, c, resourceLimits); validateThatGroupSiblingsAreUnique(c.clusterId, c.rootGroup); c.search.handleRedundancy(c.redundancy); setupSearchCluster(c.search, contentElement, deployState.getDeployLogger()); @@ -164,6 +160,24 @@ public class ContentCluster extends TreeConfigProducer implem return c; } + private ClusterControllerConfig createClusterControllerConfig(ModelElement contentElement, + DeployState deployState, + ContentCluster c, + ClusterResourceLimits resourceLimits) { + var config = new ClusterControllerConfig.Builder(c.clusterId, + contentElement, + resourceLimits.getClusterControllerLimits(), + deployState.featureFlags() + .allowMoreThanOneContentGroupDown(new ClusterSpec.Id(c.clusterId))) + .build(deployState, c, contentElement.getXml()); + config.tuning().maxGroupsAllowedDown().ifPresent(m -> { + int numberOfLeafGroups = c.getRootGroup().getNumberOfLeafGroups(); + if (m > numberOfLeafGroups) + throw new IllegalArgumentException("Cannot set max-groups-allowed-down (" + m + ") larger than number of groups (" + numberOfLeafGroups + ")"); + }); + return config; + } + private void setupSearchCluster(ContentSearchCluster csc, ModelElement element, DeployLogger logger) { ContentSearch search = DomContentSearchBuilder.build(element); Double visibilityDelay = search.getVisibilityDelay(); @@ -435,6 +449,7 @@ public class ContentCluster extends TreeConfigProducer implem public final ContentSearchCluster getSearch() { return search; } public Redundancy redundancy() { return redundancy; } + public ContentCluster setRedundancy(Redundancy redundancy) { this.redundancy = redundancy; return this; diff --git a/config-model/src/main/resources/schema/content.rnc b/config-model/src/main/resources/schema/content.rnc index 84338d49314..6486fdacc18 100644 --- a/config-model/src/main/resources/schema/content.rnc +++ b/config-model/src/main/resources/schema/content.rnc @@ -81,7 +81,8 @@ ClusterControllerTuning = element cluster-controller { element max-premature-crashes { xsd:nonNegativeInteger }? & element stable-state-period { xsd:string { pattern = "([0-9\.]+)\s*([a-z]+)?" } }? & element min-distributor-up-ratio { xsd:double }? & - element min-storage-up-ratio { xsd:double }? + element min-storage-up-ratio { xsd:double }? & + element max-groups-allowed-down { xsd:nonNegativeInteger }? } DispatchTuning = element dispatch { 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 488ad9f8484..a33b30f7d93 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 @@ -70,7 +70,7 @@ public class ContentClusterTest extends ContentBaseTest { " " + " " + " 15\n" + - " " + + " " + " " + " " + " " + @@ -167,7 +167,7 @@ public class ContentClusterTest extends ContentBaseTest { 2 - " + " @@ -214,7 +214,7 @@ public class ContentClusterTest extends ContentBaseTest { 4 - " + " @@ -1294,4 +1294,52 @@ public class ContentClusterTest extends ContentBaseTest { clusterControllers); } + @Test + void testAllow2GroupsDown() { + String services = "" + + "" + + " " + + " " + + " 4" + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " 2" + + " " + + " " + + " " + + " " + + " 4" + + " " + + " " + + " " + + " "; + VespaModel model = createEnd2EndOneNode(new TestProperties() + .setHostedVespa(false) + .setMultitenant(true) + .setAllowMoreThanOneContentGroupDown(true), + services); + + var fleetControllerConfigBuilder = new FleetcontrollerConfig.Builder(); + model.getConfig(fleetControllerConfigBuilder, "admin/standalone/cluster-controllers/0/components/clustercontroller-storage-configurer"); + assertEquals(2, fleetControllerConfigBuilder.build().max_number_of_groups_allowed_to_be_down()); + } + } 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 1f8dea41a3e..ae22542de6c 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 @@ -1,10 +1,10 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.content; -import com.yahoo.config.model.api.ModelContext; import com.yahoo.config.model.deploy.DeployState; import com.yahoo.config.model.deploy.TestProperties; import com.yahoo.config.model.test.MockRoot; +import com.yahoo.config.provision.ClusterSpec; import com.yahoo.text.XML; import com.yahoo.vespa.config.content.FleetcontrollerConfig; import com.yahoo.vespa.model.builder.xml.dom.ModelElement; @@ -21,14 +21,13 @@ public class FleetControllerClusterTest { var deployState = new DeployState.Builder().properties(props).build(); MockRoot root = new MockRoot("", deployState); var clusterElement = new ModelElement(doc.getDocumentElement()); - ModelContext.FeatureFlags featureFlags = new TestProperties(); return new ClusterControllerConfig.Builder("storage", clusterElement, new ClusterResourceLimits.Builder(false, - featureFlags.resourceLimitDisk(), - featureFlags.resourceLimitMemory()) + props.resourceLimitDisk(), + props.resourceLimitMemory()) .build(clusterElement).getClusterControllerLimits(), - false) + props.allowMoreThanOneContentGroupDown(new ClusterSpec.Id("default"))) .build(root.getDeployState(), root, clusterElement.getXml()); } @@ -39,20 +38,21 @@ public class FleetControllerClusterTest { @Test void testParameters() { FleetcontrollerConfig.Builder builder = new FleetcontrollerConfig.Builder(); - parse("\n" + - " " + - " \n" + - " " + - " \n" + - " 13\n" + - " 27\n" + - " 4\n" + - " 72\n" + - " 0.7\n" + - " 0.3\n" + - " \n" + - " \n" + - ""). + parse(""" + + + + 13 + 27 + 4 + 72 + 0.7 + 0.3 + 2 + + + """, + new TestProperties().setAllowMoreThanOneContentGroupDown(true)). getConfig(builder); FleetcontrollerConfig config = new FleetcontrollerConfig(builder); @@ -63,6 +63,7 @@ public class FleetControllerClusterTest { assertEquals(0.7, config.min_distributor_up_ratio(), 0.01); assertEquals(0.3, config.min_storage_up_ratio(), 0.01); assertEquals(7, config.ideal_distribution_bits()); + assertEquals(2, config.max_number_of_groups_allowed_to_be_down()); } @Test diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterUtils.java b/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterUtils.java index 291ae97696b..a7c019f162b 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterUtils.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterUtils.java @@ -60,7 +60,7 @@ public class ContentClusterUtils { Admin admin = new Admin(root, new DefaultMonitoring(), new Metrics(), - false, + root.getDeployState().getProperties().multitenant(), root.getDeployState().isHosted(), applicationType); Document doc = XML.getDocument(clusterXml); diff --git a/config-model/src/test/java/com/yahoo/vespa/model/test/utils/VespaModelCreatorWithMockPkg.java b/config-model/src/test/java/com/yahoo/vespa/model/test/utils/VespaModelCreatorWithMockPkg.java index 2c70c7b2da5..0ca3cb4af2e 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/test/utils/VespaModelCreatorWithMockPkg.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/test/utils/VespaModelCreatorWithMockPkg.java @@ -66,7 +66,7 @@ public class VespaModelCreatorWithMockPkg { try { this.deployState = deployState; VespaModel model = new VespaModel(configModelRegistry, deployState); - Version vespaVersion = new Version(6); + Version vespaVersion = new Version(8); if (validate) { SchemaValidators validators = new SchemaValidators(vespaVersion); try { -- cgit v1.2.3