diff options
author | Jon Bratseth <bratseth@gmail.com> | 2021-01-15 12:53:29 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2021-01-15 12:53:29 +0100 |
commit | d49811c13c338f292846238ec3e3f0967364ad6a (patch) | |
tree | 077a2755c01c8fec539107025bdfcdada8a925c1 /node-repository | |
parent | c2921d06db79072e102bbeb03e55efe56a87842f (diff) |
No functional changes
Diffstat (limited to 'node-repository')
4 files changed, 10 insertions, 12 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocatableClusterResources.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocatableClusterResources.java index 9eb4b796970..456c1fa9a2d 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocatableClusterResources.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocatableClusterResources.java @@ -139,10 +139,10 @@ public class AllocatableClusterResources { boolean exclusive = clusterSpec.isExclusive(); if ( !clusterSpec.isExclusive() && !nodeRepository.zone().getCloud().dynamicProvisioning()) { // We decide resources: Add overhead to what we'll request (advertised) to make sure real becomes (at least) cappedNodeResources - NodeResources advertisedResources = nodeRepository.resourcesCalculator().realToRequest(wantedResources.nodeResources(), exclusive); - advertisedResources = systemLimits.enlargeToLegal(advertisedResources, clusterSpec.type(), exclusive); // Attempt to ask for something legal + var advertisedResources = nodeRepository.resourcesCalculator().realToRequest(wantedResources.nodeResources(), exclusive); + advertisedResources = systemLimits.enlargeToLegal(advertisedResources, clusterSpec.type(), exclusive); // Ask for something legal advertisedResources = applicationLimits.cap(advertisedResources); // Overrides other conditions, even if it will then fail - NodeResources realResources = nodeRepository.resourcesCalculator().requestToReal(advertisedResources, exclusive); // ... thus, what we really get may change + var realResources = nodeRepository.resourcesCalculator().requestToReal(advertisedResources, exclusive); // What we'll really get if ( ! systemLimits.isWithinRealLimits(realResources, clusterSpec.type())) return Optional.empty(); if (matchesAny(nodeRepository.flavors().getFlavors(), advertisedResources)) return Optional.of(new AllocatableClusterResources(wantedResources.with(realResources), diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocationOptimizer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocationOptimizer.java index fb97e803a35..4e6d342fa49 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocationOptimizer.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocationOptimizer.java @@ -38,8 +38,7 @@ public class AllocationOptimizer { */ public Optional<AllocatableClusterResources> findBestAllocation(ResourceTarget target, AllocatableClusterResources current, - Limits limits, - boolean exclusive) { + Limits limits) { if (limits.isEmpty()) limits = Limits.of(new ClusterResources(minimumNodes, 1, NodeResources.unspecified()), new ClusterResources(maximumNodes, maximumNodes, NodeResources.unspecified())); diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaler.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaler.java index 79383c056f9..445f3f7746c 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaler.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaler.java @@ -45,7 +45,7 @@ public class Autoscaler { * @return scaling advice for this cluster */ public Advice suggest(Cluster cluster, NodeList clusterNodes) { - return autoscale(cluster, clusterNodes, Limits.empty(), cluster.exclusive()); + return autoscale(cluster, clusterNodes, Limits.empty()); } /** @@ -56,10 +56,10 @@ public class Autoscaler { */ public Advice autoscale(Cluster cluster, NodeList clusterNodes) { if (cluster.minResources().equals(cluster.maxResources())) return Advice.none("Autoscaling is not enabled"); - return autoscale(cluster, clusterNodes, Limits.of(cluster), cluster.exclusive()); + return autoscale(cluster, clusterNodes, Limits.of(cluster)); } - private Advice autoscale(Cluster cluster, NodeList clusterNodes, Limits limits, boolean exclusive) { + private Advice autoscale(Cluster cluster, NodeList clusterNodes, Limits limits) { if ( ! stable(clusterNodes, nodeRepository)) return Advice.none("Cluster change in progress"); @@ -90,7 +90,7 @@ public class Autoscaler { var target = ResourceTarget.idealLoad(cpuLoad, memoryLoad, diskLoad, currentAllocation); Optional<AllocatableClusterResources> bestAllocation = - allocationOptimizer.findBestAllocation(target, currentAllocation, limits, exclusive); + allocationOptimizer.findBestAllocation(target, currentAllocation, limits); if (bestAllocation.isEmpty()) return Advice.dontScale("No allocation changes are possible within configured limits"); diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeRepositoryProvisioner.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeRepositoryProvisioner.java index a6d68243160..33f011f65e2 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeRepositoryProvisioner.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeRepositoryProvisioner.java @@ -169,12 +169,11 @@ public class NodeRepositoryProvisioner implements Provisioner { firstDeployment // start at min, preserve current resources otherwise ? new AllocatableClusterResources(requested.minResources(), clusterSpec, nodeRepository) : new AllocatableClusterResources(nodes, nodeRepository, clusterSpec.isExclusive()); - return within(Limits.of(requested), clusterSpec.isExclusive(), currentResources, firstDeployment); + return within(Limits.of(requested), currentResources, firstDeployment); } /** Make the minimal adjustments needed to the current resources to stay within the limits */ private ClusterResources within(Limits limits, - boolean exclusive, AllocatableClusterResources current, boolean firstDeployment) { if (limits.min().equals(limits.max())) return limits.min(); @@ -184,7 +183,7 @@ public class NodeRepositoryProvisioner implements Provisioner { if (! firstDeployment && currentAsAdvertised.isWithin(limits.min(), limits.max())) return currentAsAdvertised; // Otherwise, find an allocation that preserves the current resources as well as possible - return allocationOptimizer.findBestAllocation(ResourceTarget.preserve(current), current, limits, exclusive) + return allocationOptimizer.findBestAllocation(ResourceTarget.preserve(current), current, limits) .orElseThrow(() -> new IllegalArgumentException("No allocation possible within " + limits)) .toAdvertisedClusterResources(); } |