diff options
author | Jon Bratseth <bratseth@gmail.com> | 2021-04-22 16:42:08 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2021-04-22 16:42:08 +0200 |
commit | 9e6c24e8256ac77d60a171880d4f11a938bbfabe (patch) | |
tree | 72c5ed8aac617b5b3ea9602fefc558ab22421959 /config-model/src/main/java/com/yahoo/config/model/provision | |
parent | 8b894d8815dac50d07d4ef82ae83343915b8f8dd (diff) |
Revert "Merge pull request #17550 from vespa-engine/revert-17544-bratseth/clustercontroller-cleanup-take-2"
This reverts commit 8b894d8815dac50d07d4ef82ae83343915b8f8dd, reversing
changes made to 7bb93176d1c15704f89d69fa6daaaefdb19692c9.
Diffstat (limited to 'config-model/src/main/java/com/yahoo/config/model/provision')
-rw-r--r-- | config-model/src/main/java/com/yahoo/config/model/provision/InMemoryProvisioner.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/provision/InMemoryProvisioner.java b/config-model/src/main/java/com/yahoo/config/model/provision/InMemoryProvisioner.java index 0f824fcacf9..188504edd18 100644 --- a/config-model/src/main/java/com/yahoo/config/model/provision/InMemoryProvisioner.java +++ b/config-model/src/main/java/com/yahoo/config/model/provision/InMemoryProvisioner.java @@ -142,7 +142,6 @@ public class InMemoryProvisioner implements HostProvisioner { public List<HostSpec> prepare(ClusterSpec cluster, ClusterResources requested, boolean required, boolean canFail) { if (cluster.group().isPresent() && requested.groups() > 1) throw new IllegalArgumentException("Cannot both be specifying a group and ask for groups to be created"); - int capacity = failOnOutOfCapacity || required ? requested.nodes() : Math.min(requested.nodes(), freeNodes.get(defaultResources).size() + totalAllocatedTo(cluster)); @@ -200,7 +199,9 @@ public class InMemoryProvisioner implements HostProvisioner { for (int i = allocation.size() - 1; i >= 0; i--) { NodeResources currentResources = allocation.get(0).advertisedResources(); if (currentResources.isUnspecified() || requestedResources.isUnspecified()) continue; - if ( ! currentResources.compatibleWith(requestedResources)) { + if ( (! sharedHosts && ! currentResources.satisfies(requestedResources)) + || + (sharedHosts && ! currentResources.compatibleWith(requestedResources))) { HostSpec removed = allocation.remove(i); freeNodes.put(currentResources, new Host(removed.hostname())); // Return the node back to free pool } |