diff options
author | bjormel <bjormel@yahooinc.com> | 2023-11-02 14:40:26 +0000 |
---|---|---|
committer | bjormel <bjormel@yahooinc.com> | 2023-11-02 14:40:26 +0000 |
commit | 1b6288fb42ab3ffaabfe9ffed4111e83cade121f (patch) | |
tree | 2d5ac6be9d9edbec594f1c7729589846d2c078e5 /node-repository | |
parent | ad47322349deddcef97fbbef106d23b31e49548b (diff) |
Don't autoscale single node clusters
Diffstat (limited to 'node-repository')
2 files changed, 4 insertions, 4 deletions
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 8e8474c6a6d..8adfebb6284 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 @@ -78,6 +78,9 @@ public class Autoscaler { if (target.isEmpty()) return Autoscaling.dontScale(Status.insufficient, "No allocations are possible within configured limits", model); + if (target.get().nodes() == 1 && model.current().nodes() == 1) + return Autoscaling.dontScale(Status.unavailable, "Autoscaling is not enabled for single node clusters", model); + if (! worthRescaling(model.current().realResources(), target.get().realResources())) { if (target.get().fulfilment() < 0.9999999) return Autoscaling.dontScale(Status.insufficient, "Configured limits prevents ideal scaling of this cluster", model); @@ -86,7 +89,6 @@ public class Autoscaler { else return Autoscaling.dontScale(Status.ideal, "Cluster is ideally scaled (within configured limits)", model); } - return Autoscaling.scaleTo(target.get().advertisedResources(), model); } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java index 37e1390a673..1fb137eb088 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java @@ -843,9 +843,7 @@ public class AutoscalingTest { .build(); fixture.tester().clock().advance(Duration.ofDays(2)); fixture.loader().applyLoad(new Load(1.0, 1.0, 1.0), 200); - fixture.tester().assertResources("Scale only to a single node and group since this is dev", - 1, 1, 0.1, 22.9, 105.2, - fixture.autoscale()); + assertEquals("Don't autoscale: Autoscaling is not enabled for single node clusters", fixture.autoscale().toString()); } /** Same setup as test_autoscaling_in_dev(), just with required = true */ |