aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java7
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerConfigurer.java8
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/ClusterControllerConfig.java152
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java25
-rw-r--r--config-model/src/main/resources/schema/content.rnc3
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java54
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/content/FleetControllerClusterTest.java39
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterUtils.java2
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/test/utils/VespaModelCreatorWithMockPkg.java2
9 files changed, 176 insertions, 116 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 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> 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> 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/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..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
@@ -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<AnyConfigProducer> 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<Double> minNodeRatioPerGroup = Optional.of(deployState.featureFlags().minNodeRatioPerGroup());
+ Optional<Integer> 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,58 @@ 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);
+ 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);
+ }
+
+ public ClusterControllerTuning tuning() { return tuning; }
+
+ public static class ClusterControllerTuning {
+
+ private final Optional<Double> minNodeRatioPerGroup;
+ private final Optional<Duration> initProgressTime;
+ private final Optional<Duration> transitionTime;
+ private final Optional<Long> maxPrematureCrashes;
+ private final Optional<Duration> stableStateTimePeriod;
+ private final Optional<Double> minDistributorUpRatio;
+ private final Optional<Double> minStorageUpRatio;
+ private final Optional<Integer> minSplitBits;
+ final Optional<Integer> maxGroupsAllowedDown;
+
+ ClusterControllerTuning(ModelElement tuning,
+ Optional<Double> minNodeRatioPerGroup,
+ Optional<Integer> 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();
+ this.maxGroupsAllowedDown = 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"));
+ this.maxGroupsAllowedDown = Optional.ofNullable(tuning.childAsInteger("max-groups-allowed-down"));
+ }
+ }
+
+ public Optional<Integer> 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<AnyConfigProducer> 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<AnyConfigProducer> 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<AnyConfigProducer> 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<AnyConfigProducer> 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 {
" </proton>" +
" </engine>" +
" <redundancy>15</redundancy>\n" +
- " <group name='root' distribution-key='0'>" +
+ " <group name='root'>" +
" <distribution partitions='1|1|*'/>" +
" <group name='g-1' distribution-key='0'>" +
" <node hostalias='mockhost' distribution-key='0'/>" +
@@ -167,7 +167,7 @@ public class ContentClusterTest extends ContentBaseTest {
<content version='1.0' id='storage'>
<documents/>
<min-redundancy>2</min-redundancy>
- <group name='root' distribution-key='0'>"
+ <group name='root'>"
<distribution partitions='1|*'/>
<group name='g0' distribution-key='0'>
<node hostalias='mockhost' distribution-key='0'/>
@@ -214,7 +214,7 @@ public class ContentClusterTest extends ContentBaseTest {
<content version='1.0' id='storage'>
<documents/>
<min-redundancy>4</min-redundancy>
- <group name='root' distribution-key='0'>"
+ <group name='root'>"
<distribution partitions='1|*'/>
<group name='g0' distribution-key='0'>
<node hostalias='mockhost' distribution-key='0'/>
@@ -1294,4 +1294,52 @@ public class ContentClusterTest extends ContentBaseTest {
clusterControllers);
}
+ @Test
+ void testAllow2GroupsDown() {
+ String services = "<?xml version='1.0' encoding='UTF-8' ?>" +
+ "<services version='1.0'>" +
+ " <container id='default' version='1.0' />" +
+ " <content id='storage' version='1.0'>" +
+ " <redundancy>4</redundancy>" +
+ " <documents>" +
+ " <document mode='index' type='type1' />" +
+ " </documents>" +
+ " <group name='root'>" +
+ " <distribution partitions='1|1|1|*'/>" +
+ " <group name='g-1' distribution-key='0'>" +
+ " <node hostalias='mockhost' distribution-key='0'/>" +
+ " </group>" +
+ " <group name='g-2' distribution-key='1'>" +
+ " <node hostalias='mockhost' distribution-key='1'/>" +
+ " </group>" +
+ " <group name='g-3' distribution-key='2'>" +
+ " <node hostalias='mockhost' distribution-key='2'/>" +
+ " </group>" +
+ " <group name='g-4' distribution-key='3'>" +
+ " <node hostalias='mockhost' distribution-key='3'/>" +
+ " </group>" +
+ " </group>" +
+ " <tuning>" +
+ " <cluster-controller>" +
+ " <max-groups-allowed-down>2</max-groups-allowed-down>" +
+ " </cluster-controller>" +
+ " </tuning>" +
+ " <engine>" +
+ " <proton>" +
+ " <searchable-copies>4</searchable-copies>" +
+ " </proton>" +
+ " </engine>" +
+ " </content>" +
+ " </services>";
+ 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("<cluster id=\"storage\">\n" +
- " <documents/>" +
- " <tuning>\n" +
- " <bucket-splitting minimum-bits=\"7\" />" +
- " <cluster-controller>\n" +
- " <init-progress-time>13</init-progress-time>\n" +
- " <transition-time>27</transition-time>\n" +
- " <max-premature-crashes>4</max-premature-crashes>\n" +
- " <stable-state-period>72</stable-state-period>\n" +
- " <min-distributor-up-ratio>0.7</min-distributor-up-ratio>\n" +
- " <min-storage-up-ratio>0.3</min-storage-up-ratio>\n" +
- " </cluster-controller>\n" +
- " </tuning>\n" +
- "</cluster>").
+ parse("""
+ <cluster id="storage">
+ <documents/> <tuning>
+ <bucket-splitting minimum-bits="7" /> <cluster-controller>
+ <init-progress-time>13</init-progress-time>
+ <transition-time>27</transition-time>
+ <max-premature-crashes>4</max-premature-crashes>
+ <stable-state-period>72</stable-state-period>
+ <min-distributor-up-ratio>0.7</min-distributor-up-ratio>
+ <min-storage-up-ratio>0.3</min-storage-up-ratio>
+ <max-groups-allowed-down>2</max-groups-allowed-down>
+ </cluster-controller>
+ </tuning>
+ </cluster>""",
+ 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 {