summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2022-02-23 12:47:19 +0100
committerGitHub <noreply@github.com>2022-02-23 12:47:19 +0100
commit4c1babd6cd22cab305d779999f9f462ad3fa0427 (patch)
tree44ec3eed5d6d0519137eac8d7b9dffdaf7dbcab6
parent14719d7d2b44f84f55518d34c3852f652ab66d6c (diff)
parent6583a1c11ce9b221a803a22c3e1d32057984a0fb (diff)
Merge pull request #21331 from vespa-engine/bratseth/out-of-capacity
Replace 'out of capacity' by 'node allocation failure'
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/NodeAllocationException.java16
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/OutOfCapacityException.java17
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpErrorResponse.java7
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpHandler.java6
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ModelsBuilder.java4
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionPrepareHandlerTest.java8
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServerException.java2
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/DeploymentFailureMails.java8
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/InstanceList.java2
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java2
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java2
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java14
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobList.java2
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobMetrics.java4
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobStatus.java4
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/RunStatus.java4
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/notification/Notification.java2
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/RunSerializer.java7
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java5
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentContext.java7
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java12
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunnerTest.java2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/NotificationsSerializerTest.java4
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/notifications-tenant1-app2.json2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/notifications-tenant1.json2
-rw-r--r--hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java2
-rw-r--r--hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java2
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/DynamicProvisioningMaintainer.java14
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupPreparer.java7
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeAllocation.java4
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Preparer.java10
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockHostProvisioner.java4
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/DynamicAllocationTest.java18
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/InPlaceResizeProvisionTest.java12
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java14
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/VirtualNodeProvisioningTest.java24
-rw-r--r--vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java2
38 files changed, 129 insertions, 131 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/NodeAllocationException.java b/config-provisioning/src/main/java/com/yahoo/config/provision/NodeAllocationException.java
new file mode 100644
index 00000000000..d568a61fc69
--- /dev/null
+++ b/config-provisioning/src/main/java/com/yahoo/config/provision/NodeAllocationException.java
@@ -0,0 +1,16 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.config.provision;
+
+/**
+ *
+ * Exception thrown when we are unable to fulfill a node allocation request.
+ *
+ * @author hmusum
+ */
+public class NodeAllocationException extends RuntimeException {
+
+ public NodeAllocationException(String message) {
+ super(message);
+ }
+
+}
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/OutOfCapacityException.java b/config-provisioning/src/main/java/com/yahoo/config/provision/OutOfCapacityException.java
deleted file mode 100644
index 177b3f6e198..00000000000
--- a/config-provisioning/src/main/java/com/yahoo/config/provision/OutOfCapacityException.java
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.config.provision;
-
-/**
- *
- * Exception thrown when we are unable to fulfill the request due to
- * having too few nodes (of the specified flavor)
- *
- * @author hmusum
- */
-public class OutOfCapacityException extends RuntimeException {
-
- public OutOfCapacityException(String message) {
- super(message);
- }
-
-}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpErrorResponse.java b/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpErrorResponse.java
index c414d8dfa9a..9b3b3cef5b5 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpErrorResponse.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpErrorResponse.java
@@ -20,7 +20,6 @@ import static com.yahoo.jdisc.Response.Status.REQUEST_TIMEOUT;
/**
* @author Ulf Lilleengen
- * @since 5.1
*/
public class HttpErrorResponse extends HttpResponse {
@@ -45,7 +44,7 @@ public class HttpErrorResponse extends HttpResponse {
INVALID_APPLICATION_PACKAGE,
METHOD_NOT_ALLOWED,
NOT_FOUND,
- OUT_OF_CAPACITY,
+ NODE_ALLOCATION_FAILURE,
REQUEST_TIMEOUT,
UNKNOWN_VESPA_VERSION,
PARENT_HOST_NOT_READY,
@@ -66,8 +65,8 @@ public class HttpErrorResponse extends HttpResponse {
return new HttpErrorResponse(BAD_REQUEST, ErrorCode.INVALID_APPLICATION_PACKAGE.name(), msg);
}
- public static HttpErrorResponse outOfCapacity(String msg) {
- return new HttpErrorResponse(BAD_REQUEST, ErrorCode.OUT_OF_CAPACITY.name(), msg);
+ public static HttpErrorResponse nodeAllocationFailure(String msg) {
+ return new HttpErrorResponse(BAD_REQUEST, ErrorCode.NODE_ALLOCATION_FAILURE.name(), msg);
}
public static HttpErrorResponse badRequest(String msg) {
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpHandler.java b/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpHandler.java
index 190005771c7..2700f401a86 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpHandler.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpHandler.java
@@ -3,7 +3,7 @@ package com.yahoo.vespa.config.server.http;
import com.yahoo.config.provision.ApplicationLockException;
import com.yahoo.config.provision.CertificateNotReadyException;
-import com.yahoo.config.provision.OutOfCapacityException;
+import com.yahoo.config.provision.NodeAllocationException;
import com.yahoo.config.provision.ParentHostUnavailableException;
import com.yahoo.config.provision.exception.ActivationConflictException;
import com.yahoo.config.provision.exception.LoadBalancerServiceException;
@@ -55,8 +55,8 @@ public class HttpHandler extends ThreadedHttpRequestHandler {
return HttpErrorResponse.invalidApplicationPackage(getMessage(e, request));
} catch (IllegalArgumentException e) {
return HttpErrorResponse.badRequest(getMessage(e, request));
- } catch (OutOfCapacityException e) {
- return HttpErrorResponse.outOfCapacity(getMessage(e, request));
+ } catch (NodeAllocationException e) {
+ return HttpErrorResponse.nodeAllocationFailure(getMessage(e, request));
} catch (InternalServerException e) {
return HttpErrorResponse.internalServerError(getMessage(e, request));
} catch (UnknownVespaVersionException e) {
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ModelsBuilder.java b/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ModelsBuilder.java
index 0fbece2681b..3f655ec66f6 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ModelsBuilder.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ModelsBuilder.java
@@ -13,7 +13,7 @@ import com.yahoo.config.provision.AllocatedHosts;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.ApplicationLockException;
import com.yahoo.config.provision.DockerImage;
-import com.yahoo.config.provision.OutOfCapacityException;
+import com.yahoo.config.provision.NodeAllocationException;
import com.yahoo.config.provision.TransientException;
import com.yahoo.config.provision.Zone;
import com.yahoo.lang.SettableOptional;
@@ -123,7 +123,7 @@ public abstract class ModelsBuilder<MODELRESULT extends ModelResult> {
buildLatestModelForThisMajor, majorVersion));
buildLatestModelForThisMajor = false; // We have successfully built latest model version, do it only for this major
}
- catch (OutOfCapacityException | ApplicationLockException | TransientException e) {
+ catch (NodeAllocationException | ApplicationLockException | TransientException e) {
// Don't wrap this exception, and don't try to load other model versions as this is (most likely)
// caused by the state of the system, not the model version/application combination
throw e;
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionPrepareHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionPrepareHandlerTest.java
index 0b8b142e3aa..9071b12507e 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionPrepareHandlerTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionPrepareHandlerTest.java
@@ -8,7 +8,7 @@ import com.yahoo.config.provision.ApplicationLockException;
import com.yahoo.config.provision.ApplicationName;
import com.yahoo.config.provision.DockerImage;
import com.yahoo.config.provision.InstanceName;
-import com.yahoo.config.provision.OutOfCapacityException;
+import com.yahoo.config.provision.NodeAllocationException;
import com.yahoo.config.provision.TenantName;
import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.jdisc.http.HttpRequest;
@@ -246,15 +246,15 @@ public class SessionPrepareHandlerTest extends SessionHandlerTest {
@Test
public void test_out_of_capacity_response() throws IOException {
long sessionId = applicationRepository.createSession(applicationId(), timeoutBudget, app);
- String exceptionMessage = "Out of capacity";
+ String exceptionMessage = "Node allocation failure";
FailingSessionPrepareHandler handler = new FailingSessionPrepareHandler(SessionPrepareHandler.testContext(),
applicationRepository,
configserverConfig,
- new OutOfCapacityException(exceptionMessage));
+ new NodeAllocationException(exceptionMessage));
HttpResponse response = handler.handle(createTestRequest(pathPrefix, HttpRequest.Method.PUT, Cmd.PREPARED, sessionId));
assertEquals(400, response.getStatus());
Slime data = getData(response);
- assertEquals(HttpErrorResponse.ErrorCode.OUT_OF_CAPACITY.name(), data.get().field("error-code").asString());
+ assertEquals(HttpErrorResponse.ErrorCode.NODE_ALLOCATION_FAILURE.name(), data.get().field("error-code").asString());
assertEquals(exceptionMessage, data.get().field("message").asString());
}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServerException.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServerException.java
index f0b681fd9c9..47373413a0d 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServerException.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServerException.java
@@ -34,7 +34,7 @@ public class ConfigServerException extends RuntimeException {
INVALID_APPLICATION_PACKAGE,
METHOD_NOT_ALLOWED,
NOT_FOUND,
- OUT_OF_CAPACITY,
+ NODE_ALLOCATION_FAILURE,
REQUEST_TIMEOUT,
UNKNOWN_VESPA_VERSION,
PARENT_HOST_NOT_READY,
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/DeploymentFailureMails.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/DeploymentFailureMails.java
index 10727f1d4eb..2dcb80d28fb 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/DeploymentFailureMails.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/DeploymentFailureMails.java
@@ -20,10 +20,10 @@ public class DeploymentFailureMails {
this.registry = registry;
}
- public Mail outOfCapacity(RunId id, Collection<String> recipients) {
- return mail(id, recipients, " due to lack of capacity",
- "as the zone does not have enough free capacity to " +
- "accomodate the deployment. Please contact the Vespa team to request more!");
+ public Mail nodeAllocationFailure(RunId id, Collection<String> recipients) {
+ return mail(id, recipients, " due to node allocation failure",
+ "as your node resource request could not be " +
+ "fulfilled for your tenant. Contact Vespa Cloud support.");
}
public Mail deploymentFailure(RunId id, Collection<String> recipients) {
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/InstanceList.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/InstanceList.java
index 1354f173633..9ef7cbcebf6 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/InstanceList.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/InstanceList.java
@@ -18,8 +18,6 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
-import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.aborted;
-import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.outOfCapacity;
import static java.util.Comparator.comparing;
import static java.util.Comparator.naturalOrder;
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java
index 4f546081c07..fb4584d4672 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java
@@ -744,7 +744,7 @@ public class DeploymentStatus {
Versions lastVersions = job.lastCompleted().get().versions();
if (change.platform().isPresent() && ! change.platform().get().equals(lastVersions.targetPlatform())) return Optional.empty();
if (change.application().isPresent() && ! change.application().get().equals(lastVersions.targetApplication())) return Optional.empty();
- if (job.id().type().environment().isTest() && job.isOutOfCapacity()) return Optional.empty();
+ if (job.id().type().environment().isTest() && job.isNodeAllocationFailure()) return Optional.empty();
Instant firstFailing = job.firstFailing().get().end().get();
Instant lastCompleted = job.lastCompleted().get().end().get();
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java
index 64f879a3a5c..41db36b136e 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java
@@ -411,7 +411,7 @@ public class DeploymentTrigger {
// ---------- Version and job helpers ----------
private Job deploymentJob(Instance instance, Versions versions, JobType jobType, JobStatus jobStatus, Instant availableSince) {
- return new Job(instance, versions, jobType, availableSince, jobStatus.isOutOfCapacity(), instance.change().application().isPresent());
+ return new Job(instance, versions, jobType, availableSince, jobStatus.isNodeAllocationFailure(), instance.change().application().isPresent());
}
// ---------- Data containers ----------
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
index e4987c64b2b..f89e262aac2 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
@@ -86,7 +86,7 @@ import static com.yahoo.vespa.hosted.controller.api.integration.configserver.Nod
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.deploymentFailed;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.error;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.installationFailed;
-import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.outOfCapacity;
+import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.nodeAllocationFailure;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.reset;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.running;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.testFailure;
@@ -263,11 +263,11 @@ public class InternalStepRunner implements StepRunner {
case PARENT_HOST_NOT_READY:
logger.log(e.message()); // Consider splitting these messages in summary and details, on config server.
return result;
- case OUT_OF_CAPACITY:
+ case NODE_ALLOCATION_FAILURE:
logger.log(e.message());
return controller.system().isCd() && startTime.plus(timeouts.capacity()).isAfter(controller.clock().instant())
? result
- : Optional.of(outOfCapacity);
+ : Optional.of(nodeAllocationFailure);
case INVALID_APPLICATION_PACKAGE:
case BAD_REQUEST:
logger.log(WARNING, e.getMessage());
@@ -812,8 +812,8 @@ public class InternalStepRunner implements StepRunner {
case success:
controller.notificationsDb().removeNotification(source, Notification.Type.deployment);
return;
- case outOfCapacity:
- if ( ! run.id().type().environment().isTest()) updater.accept("lack of capacity. Please contact the Vespa team to request more!");
+ case nodeAllocationFailure:
+ if ( ! run.id().type().environment().isTest()) updater.accept("could not allocate the requested capacity to your tenant. Contact Vespa Cloud support.");
return;
case deploymentFailed:
updater.accept("invalid application configuration, or timeout of other deployments of the same application");
@@ -840,8 +840,8 @@ public class InternalStepRunner implements StepRunner {
case aborted:
case success:
return Optional.empty();
- case outOfCapacity:
- return run.id().type().isProduction() ? Optional.of(mails.outOfCapacity(run.id(), recipients)) : Optional.empty();
+ case nodeAllocationFailure:
+ return run.id().type().isProduction() ? Optional.of(mails.nodeAllocationFailure(run.id(), recipients)) : Optional.empty();
case deploymentFailed:
return Optional.of(mails.deploymentFailure(run.id(), recipients));
case installationFailed:
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobList.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobList.java
index c54d17c2596..5de07bad859 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobList.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobList.java
@@ -60,7 +60,7 @@ public class JobList extends AbstractFilteringList<JobStatus, JobList> {
}
public JobList outOfTestCapacity() {
- return matching(job -> job.isOutOfCapacity() && job.id().type().environment().isTest());
+ return matching(job -> job.isNodeAllocationFailure() && job.id().type().environment().isTest());
}
public JobList running() {
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobMetrics.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobMetrics.java
index 80a03f910aa..874b1828f5f 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobMetrics.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobMetrics.java
@@ -16,7 +16,7 @@ import java.util.function.Supplier;
public class JobMetrics {
public static final String start = "deployment.start";
- public static final String outOfCapacity = "deployment.outOfCapacity";
+ public static final String nodeAllocationFailure = "deployment.nodeAllocationFailure";
public static final String endpointCertificateTimeout = "deployment.endpointCertificateTimeout";
public static final String deploymentFailure = "deployment.deploymentFailure";
public static final String convergenceFailure = "deployment.convergenceFailure";
@@ -51,7 +51,7 @@ public class JobMetrics {
static String valueOf(RunStatus status) {
switch (status) {
- case outOfCapacity: return outOfCapacity;
+ case nodeAllocationFailure: return nodeAllocationFailure;
case endpointCertificateTimeout: return endpointCertificateTimeout;
case deploymentFailed: return deploymentFailure;
case installationFailed: return convergenceFailure;
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobStatus.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobStatus.java
index cf8081de7ca..aad5d510261 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobStatus.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobStatus.java
@@ -67,8 +67,8 @@ public class JobStatus {
return lastTriggered.isPresent() && ! lastTriggered.get().hasEnded();
}
- public boolean isOutOfCapacity() {
- return lastStatus().isPresent() && lastStatus().get() == RunStatus.outOfCapacity;
+ public boolean isNodeAllocationFailure() {
+ return lastStatus().isPresent() && lastStatus().get() == RunStatus.nodeAllocationFailure;
}
@Override
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/RunStatus.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/RunStatus.java
index 375bdd239d3..0bb4a30425e 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/RunStatus.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/RunStatus.java
@@ -11,8 +11,8 @@ public enum RunStatus {
/** Run is still proceeding normally, i.e., without failures. */
running,
- /** Deployment was rejected due to lack of capacity. */
- outOfCapacity,
+ /** Deployment was rejected due node allocation failure. */
+ nodeAllocationFailure,
/** Deployment of the real application was rejected. */
deploymentFailed,
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/notification/Notification.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/notification/Notification.java
index 5935a0d51fd..c39ee031e27 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/notification/Notification.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/notification/Notification.java
@@ -69,7 +69,7 @@ public class Notification {
/** Related to contents of application package, e.g. usage of deprecated features/syntax */
applicationPackage,
- /** Related to deployment of application, e.g. system test failure, out of capacity, internal errors, etc. */
+ /** Related to deployment of application, e.g. system test failure, node allocation failure, internal errors, etc. */
deployment,
/** Application cluster is (near) external feed blocked */
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/RunSerializer.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/RunSerializer.java
index 800d5e2750b..9a301f50b1a 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/RunSerializer.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/RunSerializer.java
@@ -36,7 +36,7 @@ import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.deploymentF
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.endpointCertificateTimeout;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.error;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.installationFailed;
-import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.outOfCapacity;
+import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.nodeAllocationFailure;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.reset;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.running;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.success;
@@ -360,7 +360,7 @@ class RunSerializer {
static String valueOf(RunStatus status) {
switch (status) {
case running : return "running";
- case outOfCapacity : return "outOfCapacity";
+ case nodeAllocationFailure : return "nodeAllocationFailure";
case endpointCertificateTimeout : return "endpointCertificateTimeout";
case deploymentFailed : return "deploymentFailed";
case installationFailed : return "installationFailed";
@@ -377,7 +377,8 @@ class RunSerializer {
static RunStatus runStatusOf(String status) {
switch (status) {
case "running" : return running;
- case "outOfCapacity" : return outOfCapacity;
+ case "outOfCapacity" : return nodeAllocationFailure; // TODO: Remove after March 2022
+ case "nodeAllocationFailure" : return nodeAllocationFailure;
case "endpointCertificateTimeout" : return endpointCertificateTimeout;
case "deploymentFailed" : return deploymentFailed;
case "installationFailed" : return installationFailed;
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java
index 0da8934f2a6..799907f258e 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java
@@ -237,7 +237,7 @@ class JobControllerApiHandlerHelper {
case error: return "error";
case testFailure: return "testFailure";
case endpointCertificateTimeout: return "endpointCertificateTimeout";
- case outOfCapacity: return "outOfCapacity";
+ case nodeAllocationFailure: return "nodeAllocationFailure";
case installationFailed: return "installationFailed";
case deploymentFailed: return "deploymentFailed";
case success: return "success";
@@ -246,7 +246,8 @@ class JobControllerApiHandlerHelper {
}
/**
- * @return Response with all job types that have recorded runs for the application _and_ the status for the last run of that type
+ * Returns response with all job types that have recorded runs for the application
+ * _and_ the status for the last run of that type
*/
static HttpResponse overviewResponse(Controller controller, TenantAndApplicationId id, URI baseUriForDeployments) {
Application application = controller.applications().requireApplication(id);
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentContext.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentContext.java
index 1e41421de53..83397768264 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentContext.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentContext.java
@@ -49,7 +49,6 @@ import java.security.cert.X509Certificate;
import java.time.Duration;
import java.time.Instant;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -299,10 +298,10 @@ public class DeploymentContext {
}
/** Fail current deployment in given job */
- public DeploymentContext outOfCapacity(JobType type) {
+ public DeploymentContext nodeAllocationFailure(JobType type) {
return failDeployment(type,
- new ConfigServerException(ConfigServerException.ErrorCode.OUT_OF_CAPACITY,
- "Out of capacity",
+ new ConfigServerException(ConfigServerException.ErrorCode.NODE_ALLOCATION_FAILURE,
+ "Node allocation failure",
"Failed to deploy application"));
}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java
index a4f9ce01e97..6cd4e3e92c3 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java
@@ -790,7 +790,7 @@ public class DeploymentTriggerTest {
}
@Test
- public void requeueOutOfCapacityStagingJob() {
+ public void requeueNodeAllocationFailureStagingJob() {
ApplicationPackage applicationPackage = new ApplicationPackageBuilder()
.region("us-east-3")
.build();
@@ -826,9 +826,9 @@ public class DeploymentTriggerTest {
tester.readyJobsTrigger().maintain();
assertEquals(3, tester.jobs().active().size());
- // Remove the jobs for app1 and app2, and then let app3 fail with outOfCapacity.
- // All three jobs are now eligible, but the one for app3 should trigger first as an outOfCapacity-retry.
- app3.outOfCapacity(stagingTest);
+ // Remove the jobs for app1 and app2, and then let app3 fail node allocation.
+ // All three jobs are now eligible, but the one for app3 should trigger first as a nodeAllocationFailure-retry.
+ app3.nodeAllocationFailure(stagingTest);
app1.abortJob(stagingTest);
app2.abortJob(stagingTest);
@@ -858,9 +858,9 @@ public class DeploymentTriggerTest {
app1.assertRunning(stagingTest);
assertEquals(2, tester.jobs().active().size());
- // Let the test jobs start, remove everything except system test for app3, which fails with outOfCapacity again.
+ // Let the test jobs start, remove everything except system test for app3, which fails node allocation again.
tester.triggerJobs();
- app3.outOfCapacity(systemTest);
+ app3.nodeAllocationFailure(systemTest);
app1.abortJob(systemTest);
app1.abortJob(stagingTest);
app2.abortJob(systemTest);
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunnerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunnerTest.java
index 4a19a9c5c4d..6b380981e15 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunnerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunnerTest.java
@@ -405,7 +405,7 @@ public class JobRunnerTest {
assertEquals(1, metric.getMetric(context::equals, JobMetrics.success).get().intValue());
assertEquals(1, metric.getMetric(context::equals, JobMetrics.convergenceFailure).get().intValue());
assertEquals(1, metric.getMetric(context::equals, JobMetrics.deploymentFailure).get().intValue());
- assertEquals(1, metric.getMetric(context::equals, JobMetrics.outOfCapacity).get().intValue());
+ assertEquals(1, metric.getMetric(context::equals, JobMetrics.nodeAllocationFailure).get().intValue());
assertEquals(1, metric.getMetric(context::equals, JobMetrics.endpointCertificateTimeout).get().intValue());
assertEquals(1, metric.getMetric(context::equals, JobMetrics.testFailure).get().intValue());
}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/NotificationsSerializerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/NotificationsSerializerTest.java
index 1fec1dbce02..cbb595d2a3b 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/NotificationsSerializerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/NotificationsSerializerTest.java
@@ -36,7 +36,7 @@ public class NotificationsSerializerTest {
Notification.Type.deployment,
Notification.Level.error,
NotificationSource.from(new RunId(ApplicationId.from(tenantName.value(), "app1", "instance1"), JobType.systemTest, 12)),
- List.of("Failed to deploy: Out of capacity")));
+ List.of("Failed to deploy: Node allocation failure")));
Slime serialized = NotificationsSerializer.toSlime(notifications);
assertEquals("{\"notifications\":[" +
@@ -50,7 +50,7 @@ public class NotificationsSerializerTest {
"\"at\":2345000," +
"\"type\":\"deployment\"," +
"\"level\":\"error\"," +
- "\"messages\":[\"Failed to deploy: Out of capacity\"]," +
+ "\"messages\":[\"Failed to deploy: Node allocation failure\"]," +
"\"application\":\"app1\"," +
"\"instance\":\"instance1\"," +
"\"jobId\":\"system-test\"," +
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java
index 9a8fced2288..b4230cb1fc1 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java
@@ -1867,7 +1867,7 @@ public class ApplicationApiTest extends ControllerContainerTest {
NotificationSource.from(new RunId(ApplicationId.from(tenantName.value(), "app2", "instance1"), JobType.systemTest, 12)),
Notification.Type.deployment,
Notification.Level.error,
- "Failed to deploy: Out of capacity");
+ "Failed to deploy: Node allocation failure");
}
private void assertGlobalRouting(DeploymentId deployment, RoutingStatus.Value value, RoutingStatus.Agent agent) {
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/notifications-tenant1-app2.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/notifications-tenant1-app2.json
index 0e0ca7405ca..277831f2a9f 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/notifications-tenant1-app2.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/notifications-tenant1-app2.json
@@ -5,7 +5,7 @@
"level": "error",
"type": "deployment",
"messages": [
- "Failed to deploy: Out of capacity"
+ "Failed to deploy: Node allocation failure"
],
"application": "app2",
"instance": "instance1",
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/notifications-tenant1.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/notifications-tenant1.json
index 7d3dd5e672f..33755843486 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/notifications-tenant1.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/notifications-tenant1.json
@@ -14,7 +14,7 @@
"level": "error",
"type": "deployment",
"messages": [
- "Failed to deploy: Out of capacity"
+ "Failed to deploy: Node allocation failure"
],
"application": "app2",
"instance": "instance1",
diff --git a/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java b/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java
index 1352220166c..11a4d096312 100644
--- a/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java
+++ b/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java
@@ -551,7 +551,7 @@ public abstract class ControllerHttpClient {
case "aborted": return DeploymentLog.Status.aborted;
case "error": return DeploymentLog.Status.error;
case "testFailure": return DeploymentLog.Status.testFailure;
- case "outOfCapacity": return DeploymentLog.Status.outOfCapacity;
+ case "nodeAllocationFailure": return DeploymentLog.Status.nodeAllocationFailure;
case "installationFailed": return DeploymentLog.Status.installationFailed;
case "deploymentFailed": return DeploymentLog.Status.deploymentFailed;
case "endpointCertificateTimeout": return DeploymentLog.Status.endpointCertificateTimeout;
diff --git a/hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java b/hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java
index b7097ae8c9c..ea35732a7d6 100644
--- a/hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java
+++ b/hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java
@@ -117,7 +117,7 @@ public class DeploymentLog {
aborted,
error,
testFailure,
- outOfCapacity,
+ nodeAllocationFailure,
installationFailed,
deploymentFailed,
endpointCertificateTimeout,
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/DynamicProvisioningMaintainer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/DynamicProvisioningMaintainer.java
index e6476cd7373..6eaee7b33de 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/DynamicProvisioningMaintainer.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/DynamicProvisioningMaintainer.java
@@ -8,7 +8,7 @@ import com.yahoo.config.provision.ClusterMembership;
import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.NodeResources;
import com.yahoo.config.provision.NodeType;
-import com.yahoo.config.provision.OutOfCapacityException;
+import com.yahoo.config.provision.NodeAllocationException;
import com.yahoo.jdisc.Metric;
import com.yahoo.lang.MutableInteger;
import com.yahoo.transaction.Mutex;
@@ -121,11 +121,11 @@ public class DynamicProvisioningMaintainer extends NodeRepositoryMaintainer {
List<Node> excessHosts;
try {
excessHosts = provision(nodes);
- } catch (OutOfCapacityException | IllegalStateException e) {
- log.log(Level.WARNING, "Failed to provision preprovision capacity and/or find excess hosts: " + e.getMessage());
+ } catch (NodeAllocationException | IllegalStateException e) {
+ log.log(Level.WARNING, "Failed to allocate preprovisioned capacity and/or find excess hosts: " + e.getMessage());
return; // avoid removing excess hosts
} catch (RuntimeException e) {
- log.log(Level.WARNING, "Failed to provision preprovision capacity and/or find excess hosts", e);
+ log.log(Level.WARNING, "Failed to allocate preprovisioned capacity and/or find excess hosts", e);
return; // avoid removing excess hosts
}
@@ -213,7 +213,7 @@ public class DynamicProvisioningMaintainer extends NodeRepositoryMaintainer {
/**
* @return the nodes in {@code nodeList} plus all hosts provisioned, plus all preprovision capacity
* nodes that were allocated.
- * @throws OutOfCapacityException if there were problems provisioning hosts, and in case message
+ * @throws NodeAllocationException if there were problems provisioning hosts, and in case message
* should be sufficient (avoid no stack trace)
* @throws IllegalStateException if there was an algorithmic problem, and in case message
* should be sufficient (avoid no stack trace).
@@ -251,8 +251,8 @@ public class DynamicProvisioningMaintainer extends NodeRepositoryMaintainer {
.collect(Collectors.toList());
nodeRepository().nodes().addNodes(hosts, Agent.DynamicProvisioningMaintainer);
return hosts;
- } catch (OutOfCapacityException | IllegalArgumentException | IllegalStateException e) {
- throw new OutOfCapacityException("Failed to provision " + count + " " + nodeResources + ": " + e.getMessage());
+ } catch (NodeAllocationException | IllegalArgumentException | IllegalStateException e) {
+ throw new NodeAllocationException("Failed to provision " + count + " " + nodeResources + ": " + e.getMessage());
} catch (RuntimeException e) {
throw new RuntimeException("Failed to provision " + count + " " + nodeResources + ", will retry in " + interval(), e);
}
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupPreparer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupPreparer.java
index ae65f367684..9148a2165a5 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupPreparer.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupPreparer.java
@@ -5,7 +5,7 @@ import com.yahoo.component.Version;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.NodeType;
-import com.yahoo.config.provision.OutOfCapacityException;
+import com.yahoo.config.provision.NodeAllocationException;
import com.yahoo.transaction.Mutex;
import com.yahoo.vespa.hosted.provision.LockedNodeList;
import com.yahoo.vespa.hosted.provision.Node;
@@ -125,8 +125,9 @@ public class GroupPreparer {
}
if (! allocation.fulfilled() && requestedNodes.canFail())
- throw new OutOfCapacityException((cluster.group().isPresent() ? "Out of capacity on " + cluster.group().get() :"") +
- allocation.outOfCapacityDetails());
+ throw new NodeAllocationException((cluster.group().isPresent() ? "Node allocation failure on " +
+ cluster.group().get() : "") +
+ allocation.allocationFailureDetails());
// Carry out and return allocation
nodeRepository.nodes().reserve(allocation.reservableNodes());
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeAllocation.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeAllocation.java
index 6c22a26d88a..7836ca3265e 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeAllocation.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeAllocation.java
@@ -441,7 +441,7 @@ class NodeAllocation {
.collect(Collectors.toList());
}
- public String outOfCapacityDetails() {
+ public String allocationFailureDetails() {
List<String> reasons = new ArrayList<>();
if (rejectedDueToExclusivity > 0)
reasons.add("host exclusivity constraints");
@@ -453,7 +453,7 @@ class NodeAllocation {
reasons.add("insufficient real resources on hosts");
if (reasons.isEmpty()) return "";
- return ": Not enough nodes available due to " + String.join(", ", reasons);
+ return ": Not enough suitable nodes available due to " + String.join(", ", reasons);
}
private static Integer parseIndex(String hostname) {
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Preparer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Preparer.java
index c98ff31ecb6..838d6751d09 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Preparer.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Preparer.java
@@ -4,7 +4,7 @@ package com.yahoo.vespa.hosted.provision.provisioning;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.ClusterMembership;
import com.yahoo.config.provision.ClusterSpec;
-import com.yahoo.config.provision.OutOfCapacityException;
+import com.yahoo.config.provision.NodeAllocationException;
import com.yahoo.vespa.hosted.provision.LockedNodeList;
import com.yahoo.vespa.hosted.provision.Node;
import com.yahoo.vespa.hosted.provision.NodeList;
@@ -40,10 +40,10 @@ class Preparer {
prepareLoadBalancer(application, cluster, requestedNodes);
return nodes;
}
- catch (OutOfCapacityException e) {
- throw new OutOfCapacityException("Could not satisfy " + requestedNodes +
- ( wantedGroups > 1 ? " (in " + wantedGroups + " groups)" : "") +
- " in " + application + " " + cluster + ": " + e.getMessage());
+ catch (NodeAllocationException e) {
+ throw new NodeAllocationException("Could not satisfy " + requestedNodes +
+ ( wantedGroups > 1 ? " (in " + wantedGroups + " groups)" : "") +
+ " in " + application + " " + cluster + ": " + e.getMessage());
}
}
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockHostProvisioner.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockHostProvisioner.java
index 49fc3c2b7b2..0a125c5fb95 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockHostProvisioner.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockHostProvisioner.java
@@ -7,7 +7,7 @@ import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.Flavor;
import com.yahoo.config.provision.NodeResources;
import com.yahoo.config.provision.NodeType;
-import com.yahoo.config.provision.OutOfCapacityException;
+import com.yahoo.config.provision.NodeAllocationException;
import com.yahoo.vespa.hosted.provision.Node;
import com.yahoo.vespa.hosted.provision.node.Address;
import com.yahoo.vespa.hosted.provision.node.IP;
@@ -59,7 +59,7 @@ public class MockHostProvisioner implements HostProvisioner {
Optional<ClusterSpec.Type> clusterType) {
Flavor hostFlavor = this.hostFlavor.orElseGet(() -> flavors.stream().filter(f -> compatible(f, resources))
.findFirst()
- .orElseThrow(() -> new OutOfCapacityException("No host flavor matches " + resources)));
+ .orElseThrow(() -> new NodeAllocationException("No host flavor matches " + resources)));
List<ProvisionedHost> hosts = new ArrayList<>();
for (int index : provisionIndices) {
String hostHostname = hostType == NodeType.host ? "hostname" + index : hostType.name() + index;
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/DynamicAllocationTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/DynamicAllocationTest.java
index 583ccdda656..2cc687e51d3 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/DynamicAllocationTest.java
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/DynamicAllocationTest.java
@@ -11,7 +11,7 @@ import com.yahoo.config.provision.Flavor;
import com.yahoo.config.provision.HostSpec;
import com.yahoo.config.provision.NodeResources;
import com.yahoo.config.provision.NodeType;
-import com.yahoo.config.provision.OutOfCapacityException;
+import com.yahoo.config.provision.NodeAllocationException;
import com.yahoo.config.provision.RegionName;
import com.yahoo.config.provision.SystemName;
import com.yahoo.config.provision.Zone;
@@ -220,7 +220,7 @@ public class DynamicAllocationTest {
assertEquals(2, hostsWithChildren.size());
}
- @Test(expected = OutOfCapacityException.class)
+ @Test(expected = NodeAllocationException.class)
public void multiple_groups_are_on_separate_parent_hosts() {
ProvisioningTester tester = new ProvisioningTester.Builder().zone(new Zone(Environment.prod, RegionName.from("us-east"))).flavorsConfig(flavorsConfig()).build();
tester.makeReadyNodes(5, "host-small", NodeType.host, 32);
@@ -257,7 +257,7 @@ public class DynamicAllocationTest {
try {
hosts = tester.prepare(application1, clusterSpec, 4, 1, flavor);
fail("Was able to deploy with 4 nodes, should not be able to use spare capacity");
- } catch (OutOfCapacityException ignored) { }
+ } catch (NodeAllocationException ignored) { }
tester.fail(hosts.get(0));
hosts = tester.prepare(application1, clusterSpec, 3, 1, flavor);
@@ -283,7 +283,7 @@ public class DynamicAllocationTest {
try {
tester.prepare(application1, clusterSpec, 4, 1, flavor);
fail("Should not be able to deploy 4 nodes on 4 hosts because 1 is suspended");
- } catch (OutOfCapacityException ignored) { }
+ } catch (NodeAllocationException ignored) { }
// Resume the host, the deployment goes through
tester.orchestrator().resume(randomHost);
@@ -319,7 +319,7 @@ public class DynamicAllocationTest {
tester.activate(application1, Set.copyOf(hosts));
}
- @Test(expected = OutOfCapacityException.class)
+ @Test(expected = NodeAllocationException.class)
public void allocation_should_fail_when_host_is_not_in_allocatable_state() {
ProvisioningTester tester = new ProvisioningTester.Builder().zone(new Zone(Environment.prod, RegionName.from("us-east"))).flavorsConfig(flavorsConfig()).build();
tester.makeProvisionedNodes(3, "host-small", NodeType.host, 32).forEach(node ->
@@ -377,7 +377,7 @@ public class DynamicAllocationTest {
tester.activate(application, hosts);
}
- private void provisionFastAndSlowThenDeploy(NodeResources.DiskSpeed requestDiskSpeed, boolean expectOutOfCapacity) {
+ private void provisionFastAndSlowThenDeploy(NodeResources.DiskSpeed requestDiskSpeed, boolean expectNodeAllocationFailure) {
ProvisioningTester tester = new ProvisioningTester.Builder().zone(new Zone(Environment.prod, RegionName.from("us-east"))).flavorsConfig(flavorsConfig()).build();
tester.makeReadyNodes(2, new Flavor(new NodeResources(1, 8, 120, 1, NodeResources.DiskSpeed.fast)), NodeType.host, 10, true);
tester.makeReadyNodes(2, new Flavor(new NodeResources(1, 8, 120, 1, NodeResources.DiskSpeed.slow)), NodeType.host, 10, true);
@@ -389,12 +389,12 @@ public class DynamicAllocationTest {
try {
List<HostSpec> hosts = tester.prepare(application, cluster, 4, 1, resources);
- if (expectOutOfCapacity) fail("Expected out of capacity");
+ if (expectNodeAllocationFailure) fail("Expected node allocation fail");
assertEquals(4, hosts.size());
tester.activate(application, hosts);
}
- catch (OutOfCapacityException e) {
- if ( ! expectOutOfCapacity) throw e;
+ catch (NodeAllocationException e) {
+ if ( ! expectNodeAllocationFailure) throw e;
}
}
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/InPlaceResizeProvisionTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/InPlaceResizeProvisionTest.java
index 70f6d3abf6f..a03811778d2 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/InPlaceResizeProvisionTest.java
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/InPlaceResizeProvisionTest.java
@@ -7,7 +7,7 @@ import com.yahoo.config.provision.Environment;
import com.yahoo.config.provision.HostSpec;
import com.yahoo.config.provision.NodeResources;
import com.yahoo.config.provision.NodeType;
-import com.yahoo.config.provision.OutOfCapacityException;
+import com.yahoo.config.provision.NodeAllocationException;
import com.yahoo.config.provision.RegionName;
import com.yahoo.config.provision.Zone;
import com.yahoo.vespa.flags.InMemoryFlagSource;
@@ -133,8 +133,8 @@ public class InPlaceResizeProvisionTest {
// Attempt to increase resources of the other app
try {
new PrepareHelper(tester, app).prepare(container1, 4, 1, largeResources);
- fail("Expected to fail due to out of capacity");
- } catch (OutOfCapacityException ignored) { }
+ fail("Expected to fail node allocation");
+ } catch (NodeAllocationException ignored) { }
// Add 2 more parent host, now we should be able to do the same deployment that failed earlier
// 2 of the nodes will be increased in-place and 2 will be allocated to the new hosts.
@@ -211,7 +211,7 @@ public class InPlaceResizeProvisionTest {
assertSizeAndResources(listCluster(content1).not().retired(), 8, halvedResources);
}
- @Test(expected = OutOfCapacityException.class)
+ @Test(expected = NodeAllocationException.class)
public void cannot_inplace_decrease_resources_while_increasing_cluster_size() {
addParentHosts(6, mediumResources.with(fast).with(local));
@@ -221,7 +221,7 @@ public class InPlaceResizeProvisionTest {
new PrepareHelper(tester, app).prepare(content1, 6, 1, smallResources);
}
- @Test(expected = OutOfCapacityException.class)
+ @Test(expected = NodeAllocationException.class)
public void cannot_inplace_change_resources_while_decreasing_cluster_size() {
addParentHosts(4, largeResources.with(fast).with(local));
@@ -231,7 +231,7 @@ public class InPlaceResizeProvisionTest {
new PrepareHelper(tester, app).prepare(container1, 2, 1, smallResources);
}
- @Test(expected = OutOfCapacityException.class)
+ @Test(expected = NodeAllocationException.class)
public void cannot_inplace_change_resources_while_changing_topology() {
addParentHosts(4, largeResources.with(fast).with(local));
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java
index c9b384b95a6..d0eb55469b6 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java
@@ -14,7 +14,7 @@ import com.yahoo.config.provision.HostFilter;
import com.yahoo.config.provision.HostSpec;
import com.yahoo.config.provision.NodeResources;
import com.yahoo.config.provision.NodeType;
-import com.yahoo.config.provision.OutOfCapacityException;
+import com.yahoo.config.provision.NodeAllocationException;
import com.yahoo.config.provision.ParentHostUnavailableException;
import com.yahoo.config.provision.RegionName;
import com.yahoo.config.provision.SystemName;
@@ -333,9 +333,9 @@ public class ProvisioningTest {
// redeploy a too large application
try {
SystemState state2 = prepare(application1, 3, 0, 3, 0, defaultResources, tester);
- fail("Expected out of capacity exception");
+ fail("Expected node allocation exception");
}
- catch (OutOfCapacityException expected) {
+ catch (NodeAllocationException expected) {
}
// deploy first state again
@@ -626,7 +626,7 @@ public class ProvisioningTest {
prepare(application, 2, 2, 3, 3, defaultResources, tester);
fail("Expected exception");
}
- catch (OutOfCapacityException e) {
+ catch (NodeAllocationException e) {
assertTrue(e.getMessage().startsWith("Could not satisfy request"));
}
}
@@ -653,7 +653,7 @@ public class ProvisioningTest {
try {
prepare(application, 2, 0, 2, 0, defaultResources, tester);
fail("Expected exception");
- } catch (OutOfCapacityException e) {
+ } catch (NodeAllocationException e) {
assertTrue(e.getMessage().startsWith("Could not satisfy request"));
}
}
@@ -826,11 +826,11 @@ public class ProvisioningTest {
ApplicationId application = ProvisioningTester.applicationId();
tester.makeReadyHosts(2, defaultResources).activateTenantHosts();
- // Deploy fails with out of capacity
+ // Node allocation fails
try {
prepare(application, 2, 0, 2, 0, defaultResources, tester);
fail("Expected exception");
- } catch (OutOfCapacityException ignored) {}
+ } catch (NodeAllocationException ignored) {}
assertEquals("Reserved a subset of required nodes", 2,
tester.getNodes(application, Node.State.reserved).size());
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/VirtualNodeProvisioningTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/VirtualNodeProvisioningTest.java
index 9a056541c20..1255cb20cd2 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/VirtualNodeProvisioningTest.java
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/VirtualNodeProvisioningTest.java
@@ -14,7 +14,7 @@ import com.yahoo.config.provision.HostSpec;
import com.yahoo.config.provision.InstanceName;
import com.yahoo.config.provision.NodeResources;
import com.yahoo.config.provision.NodeType;
-import com.yahoo.config.provision.OutOfCapacityException;
+import com.yahoo.config.provision.NodeAllocationException;
import com.yahoo.config.provision.ProvisionLock;
import com.yahoo.config.provision.RegionName;
import com.yahoo.config.provision.SystemName;
@@ -155,7 +155,7 @@ public class VirtualNodeProvisioningTest {
assertEquals(2, nodes.stream().filter(n -> n.allocation().get().membership().retired()).count());
}
- @Test(expected = OutOfCapacityException.class)
+ @Test(expected = NodeAllocationException.class)
public void fail_when_too_few_distinct_parent_hosts() {
ProvisioningTester tester = new ProvisioningTester.Builder().build();
tester.makeReadyChildren(2, resources1, "parentHost1");
@@ -192,10 +192,10 @@ public class VirtualNodeProvisioningTest {
tester.makeReadyChildren(1, resources1, "parentHost1");
tester.makeReadyChildren(2, resources1, "parentHost2");
- OutOfCapacityException expectedException = null;
+ NodeAllocationException expectedException = null;
try {
tester.prepare(applicationId, contentClusterSpec, contentNodeCount, groups, resources1);
- } catch (OutOfCapacityException e) {
+ } catch (NodeAllocationException e) {
expectedException = e;
}
assertNotNull(expectedException);
@@ -279,7 +279,7 @@ public class VirtualNodeProvisioningTest {
ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("myContent")).vespaVersion(wantedVespaVersion).build(),
nodeCount, 1, resources2);
fail("Expected the allocation to fail due to parent hosts not being active yet");
- } catch (OutOfCapacityException expected) { }
+ } catch (NodeAllocationException expected) { }
// Activate the hosts, thereby allocating the parents
tester.activateTenantHosts();
@@ -321,7 +321,7 @@ public class VirtualNodeProvisioningTest {
5, 1, resources);
fail("Expected exception");
}
- catch (OutOfCapacityException e) {
+ catch (NodeAllocationException e) {
// Success: Not enough nonreserved hosts left
}
@@ -349,8 +349,8 @@ public class VirtualNodeProvisioningTest {
tester.prepare(applicationId,
ClusterSpec.request(ClusterSpec.Type.container, ClusterSpec.Id.from("myContent")).vespaVersion(wantedVespaVersion).build(),
6, 1, resources);
- fail("Expected to fail due to out of capacity");
- } catch (OutOfCapacityException ignored) { }
+ fail("Expected to fail node allocation");
+ } catch (NodeAllocationException ignored) { }
// Same cluster, but content type is now 'content'
List<HostSpec> nodes = tester.prepare(applicationId,
@@ -447,8 +447,8 @@ public class VirtualNodeProvisioningTest {
"Could not satisfy request for 3 nodes with " +
"[vcpu: 1.0, memory: 4.0 Gb, disk 100.0 Gb, bandwidth: 1.0 Gbps] " +
"in tenant2.app2 container cluster 'myContainer' 6.39: " +
- "Out of capacity on group 0: " +
- "Not enough nodes available due to host exclusivity constraints",
+ "Node allocation failure on group 0: " +
+ "Not enough suitable nodes available due to host exclusivity constraints",
e.getMessage());
}
@@ -470,11 +470,11 @@ public class VirtualNodeProvisioningTest {
2, 1,
resources2.with(NodeResources.StorageType.remote));
}
- catch (OutOfCapacityException e) {
+ catch (NodeAllocationException e) {
assertEquals("Could not satisfy request for 2 nodes with " +
"[vcpu: 1.0, memory: 4.0 Gb, disk 100.0 Gb, bandwidth: 1.0 Gbps, storage type: remote] " +
"in tenant.app1 content cluster 'myContent'" +
- " 6.42: Out of capacity on group 0",
+ " 6.42: Node allocation failure on group 0",
e.getMessage());
}
}
diff --git a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java
index ea645a9dd2b..6b4fe40d719 100644
--- a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java
+++ b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java
@@ -60,7 +60,7 @@ public class DeployMojo extends AbstractVespaDeploymentMojo {
case success: return;
case error: throw new MojoExecutionException("Unexpected error during deployment; see log for details");
case aborted: throw new MojoFailureException("Deployment was aborted, probably by a newer deployment");
- case outOfCapacity: throw new MojoFailureException("No capacity left in zone; please contact the Vespa team");
+ case nodeAllocationFailure: throw new MojoFailureException("Specified node capacity could not be fulfilled for you tenant; contact Vespa Ckoud support");
case deploymentFailed: throw new MojoFailureException("Deployment failed; see log for details");
case installationFailed: throw new MojoFailureException("Installation failed; see Vespa log for details");
case running: throw new MojoFailureException("Deployment not completed");