aboutsummaryrefslogtreecommitdiffstats
path: root/node-repository
diff options
context:
space:
mode:
authorBjørn Meland <bjormel@users.noreply.github.com>2023-11-03 14:42:25 +0000
committerGitHub <noreply@github.com>2023-11-03 14:42:25 +0000
commit5adfe3dd5851488c847c014b5473018a93879327 (patch)
tree1d8507bd21703c45d6bb41fb74e6fed03ea11d93 /node-repository
parent59107fa8733a7061b41d0122df7ca8ab524383a4 (diff)
parentc31fd7fea8c5c2b5a2ce02b07bdf68d077d8c089 (diff)
Merge pull request #29202 from vespa-engine/bjormel/dont_autoscale_single_node_clusters
Don't autoscale resources in single node clusters
Diffstat (limited to 'node-repository')
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaler.java4
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java4
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..738abddc31a 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)
+ return Autoscaling.dontScale(Status.unavailable, "Autoscaling is disabled in 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..d4d34ab66e5 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 disabled in single node clusters", fixture.autoscale().toString());
}
/** Same setup as test_autoscaling_in_dev(), just with required = true */