diff options
5 files changed, 10 insertions, 19 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/NodeType.java b/config-provisioning/src/main/java/com/yahoo/config/provision/NodeType.java index b1e9fe3ea05..3a078fd3cb7 100644 --- a/config-provisioning/src/main/java/com/yahoo/config/provision/NodeType.java +++ b/config-provisioning/src/main/java/com/yahoo/config/provision/NodeType.java @@ -95,6 +95,7 @@ public enum NodeType { public NodeType hostType() { if (isHost()) return this; for (NodeType nodeType : values()) { + // Ignore host types that support multiple node types if (nodeType.childNodeTypes.size() == 1 && nodeType.canRun(this)) { return nodeType; } 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 38c3bd47e0d..b583eaffc7e 100644 --- a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java +++ b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java @@ -274,12 +274,6 @@ public class Flags { "Takes effect at redeployment", ZONE_ID, APPLICATION_ID); - public static final UnboundBooleanFlag DYNAMIC_CONFIG_SERVER_PROVISIONING = defineFeatureFlag( - "dynamic-config-server-provisioning", false, - List.of("mpolden", "hakon"), "2021-03-03", "2021-05-01", - "Enable dynamic provisioning of config servers", - "Takes effect immediately, for subsequent provisioning"); - /** WARNING: public for testing: All flags should be defined in {@link Flags}. */ public static UnboundBooleanFlag defineFeatureFlag(String flagId, boolean defaultValue, List<String> owners, String createdAt, String expiresAt, String description, diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupPreparer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupPreparer.java index 0f725e6447a..29f3bcebfbf 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupPreparer.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupPreparer.java @@ -7,7 +7,6 @@ import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.NodeType; import com.yahoo.config.provision.OutOfCapacityException; import com.yahoo.transaction.Mutex; -import com.yahoo.vespa.flags.BooleanFlag; import com.yahoo.vespa.flags.FetchVector; import com.yahoo.vespa.flags.FlagSource; import com.yahoo.vespa.flags.Flags; @@ -35,7 +34,6 @@ public class GroupPreparer { private final NodeRepository nodeRepository; private final Optional<HostProvisioner> hostProvisioner; private final StringFlag allocateOsRequirementFlag; - private final BooleanFlag provisionConfigServerDynamically; public GroupPreparer(NodeRepository nodeRepository, Optional<HostProvisioner> hostProvisioner, @@ -43,7 +41,6 @@ public class GroupPreparer { this.nodeRepository = nodeRepository; this.hostProvisioner = hostProvisioner; this.allocateOsRequirementFlag = Flags.ALLOCATE_OS_REQUIREMENT.bindTo(flagSource); - this.provisionConfigServerDynamically = Flags.DYNAMIC_CONFIG_SERVER_PROVISIONING.bindTo(flagSource); } /** @@ -91,10 +88,7 @@ public class GroupPreparer { indices::next, wantedGroups, allocationLock, allocateOsRequirement); NodeType hostType = allocation.nodeType().hostType(); - boolean hostTypeSupportsDynamicProvisioning = hostType == NodeType.host || - (hostType.isConfigServerHostLike() && - provisionConfigServerDynamically.value()); - if (nodeRepository.zone().getCloud().dynamicProvisioning() && hostTypeSupportsDynamicProvisioning) { + if (canProvisionDynamically(hostType)) { final Version osVersion; if (allocateOsRequirement.equals("rhel8")) { osVersion = new Version(8, Integer.MAX_VALUE /* always use latest 8 version */, 0); @@ -155,6 +149,11 @@ public class GroupPreparer { return allocation; } + private boolean canProvisionDynamically(NodeType hostType) { + return nodeRepository.zone().getCloud().dynamicProvisioning() && + (hostType == NodeType.host || hostType.isConfigServerHostLike()); + } + private static HostSharing hostSharing(NodeSpec spec, NodeType hostType) { HostSharing sharing = spec.isExclusive() ? HostSharing.exclusive : HostSharing.any; if (!hostType.isSharable() && sharing != HostSharing.any) { diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeSpec.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeSpec.java index 482f0f2e011..b41c5d75832 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeSpec.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeSpec.java @@ -179,9 +179,8 @@ public interface NodeSpec { /** A node spec specifying a node type. This will accept all nodes of this type. */ class TypeNodeSpec implements NodeSpec { - private static final Map<NodeType, Integer> WANTED_NODE_COUNT = Map.of( - NodeType.config, 3, - NodeType.controller, 3); + private static final Map<NodeType, Integer> WANTED_NODE_COUNT = Map.of(NodeType.config, 3, + NodeType.controller, 3); private final NodeType type; diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/DynamicProvisioningMaintainerTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/DynamicProvisioningMaintainerTest.java index 48a6e03f646..5d8330da21a 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/DynamicProvisioningMaintainerTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/DynamicProvisioningMaintainerTest.java @@ -16,7 +16,6 @@ import com.yahoo.config.provision.RegionName; import com.yahoo.config.provision.SystemName; import com.yahoo.config.provision.Zone; import com.yahoo.net.HostName; -import com.yahoo.vespa.flags.Flags; import com.yahoo.vespa.flags.InMemoryFlagSource; import com.yahoo.vespa.flags.PermanentFlags; import com.yahoo.vespa.flags.custom.ClusterCapacity; @@ -431,7 +430,7 @@ public class DynamicProvisioningMaintainerTest { replace_config_server_like(NodeType.controllerhost); } - public void replace_config_server_like(NodeType hostType) { + private void replace_config_server_like(NodeType hostType) { final ApplicationId hostApp; final ApplicationId configSrvApp; switch (hostType) { @@ -451,7 +450,6 @@ public class DynamicProvisioningMaintainerTest { DynamicProvisioningTester dynamicProvisioningTester = new DynamicProvisioningTester(cloud, new MockNameResolver().mockAnyLookup()); ProvisioningTester tester = dynamicProvisioningTester.provisioningTester; dynamicProvisioningTester.hostProvisioner.overrideHostFlavor("default"); - dynamicProvisioningTester.flagSource.withBooleanFlag(Flags.DYNAMIC_CONFIG_SERVER_PROVISIONING.id(), true); // Initial config server hosts are provisioned manually List<Node> provisionedHosts = tester.makeReadyNodes(3, "default", hostType).stream() |