summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2020-04-07 08:16:06 +0200
committerGitHub <noreply@github.com>2020-04-07 08:16:06 +0200
commitc7f2e56fdb745c2c0c61e2f59f9c45ee873531be (patch)
tree22a20a287c0a21edfe12728db5f8f626a08fa8c7 /config-model
parent864320cd88e2626785ecb70b3551ecd353812b68 (diff)
parent146041e8c794490e0b9a4e72b8b0540a9bf7611b (diff)
Merge pull request #12846 from vespa-engine/mpolden/remove-old-allocation-logic
Remove unused allocation logic for unspecified nodes
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java1
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java23
2 files changed, 2 insertions, 22 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 c2f1e399e08..4c9e9489c63 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
@@ -62,7 +62,6 @@ public class TestProperties implements ModelContext.Properties {
@Override public Optional<TlsSecrets> tlsSecrets() { return endpointCertificateSecrets.map(TlsSecrets::new); }
@Override public double defaultTermwiseLimit() { return defaultTermwiseLimit; }
@Override public boolean useBucketSpaceMetric() { return true; }
- @Override public boolean useDedicatedNodesWhenUnspecified() { return true; }
@Override public Optional<AthenzDomain> athenzDomain() { return Optional.ofNullable(athenzDomain); }
public TestProperties setDefaultTermwiseLimit(double limit) {
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
index 06707786136..4bd9f5fa8b0 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
@@ -573,7 +573,7 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
private void addNodesFromXml(ApplicationContainerCluster cluster, Element containerElement, ConfigModelContext context) {
Element nodesElement = XML.getChild(containerElement, "nodes");
if (nodesElement == null) {
- cluster.addContainers(allocateWithoutNodesTag(cluster, containerElement, context));
+ cluster.addContainers(allocateWithoutNodesTag(cluster, context));
} else {
List<ApplicationContainer> nodes = createNodes(cluster, nodesElement, context);
@@ -651,29 +651,10 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
}
/** Allocate a container cluster without a nodes tag */
- private List<ApplicationContainer> allocateWithoutNodesTag(ApplicationContainerCluster cluster, Element containerElement, ConfigModelContext context) {
+ private List<ApplicationContainer> allocateWithoutNodesTag(ApplicationContainerCluster cluster, ConfigModelContext context) {
DeployState deployState = context.getDeployState();
HostSystem hostSystem = cluster.hostSystem();
if (deployState.isHosted()) {
- // TODO(mpolden): The old way of allocating. Remove when 7.198 is the oldest model in production and the
- // feature flag is set to true in all zones.
- if (!context.properties().useDedicatedNodesWhenUnspecified()) {
- Optional<HostResource> singleContentHost = getHostResourceFromContentClusters(cluster, containerElement, context);
- if (singleContentHost.isPresent()) { // there is a content cluster; put the container on its first node
- return singleHostContainerCluster(cluster, singleContentHost.get(), context);
- }
- else { // request 1 node
- ClusterSpec clusterSpec = ClusterSpec.request(ClusterSpec.Type.container, ClusterSpec.Id.from(cluster.getName()))
- .vespaVersion(deployState.getWantedNodeVespaVersion())
- .dockerImageRepo(deployState.getWantedDockerImageRepo())
- .build();
- Capacity capacity = Capacity.from(new ClusterResources(1, 1, NodeResources.unspecified),
- false,
- ! deployState.getProperties().isBootstrap());
- HostResource host = hostSystem.allocateHosts(clusterSpec, capacity, log).keySet().iterator().next();
- return singleHostContainerCluster(cluster, host, context);
- }
- }
// request just enough nodes to satisfy environment capacity requirement
ClusterSpec clusterSpec = ClusterSpec.request(ClusterSpec.Type.container,
ClusterSpec.Id.from(cluster.getName()))