diff options
Diffstat (limited to 'configserver/src/main/java/com/yahoo/vespa/config/server/http/v1')
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/http/v1/RoutingStatusApiHandler.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v1/RoutingStatusApiHandler.java b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v1/RoutingStatusApiHandler.java index 957868f2abb..0dc7dbda9a1 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v1/RoutingStatusApiHandler.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v1/RoutingStatusApiHandler.java @@ -4,6 +4,7 @@ package com.yahoo.vespa.config.server.http.v1; import com.google.inject.Inject; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.Deployer; +import com.yahoo.config.provision.Deployment; import com.yahoo.jdisc.http.HttpRequest; import com.yahoo.path.Path; import com.yahoo.restapi.RestApi; @@ -117,11 +118,14 @@ public class RoutingStatusApiHandler extends RestApiRequestHandler<RoutingStatus // Redeploy application so that a new LbServicesConfig containing the updated status is generated and consumed // by routing layer. This is required to update weights for application endpoints when routing status for a // deployment is changed + log.log(Level.INFO, "Changing routing status of " + instance + " from " + + currentStatus.status() + " to " + wantedStatus.status()); changeStatus(upstreamNames, wantedStatus); try { - deployer.deployFromLocalActive(instance, Duration.ofMinutes(1)); + Optional<Deployment> deployment = deployer.deployFromLocalActive(instance, Duration.ofMinutes(1)); + if (deployment.isEmpty()) throw new IllegalArgumentException("No deployment of " + instance + " found"); + deployment.get().activate(); } catch (Exception e) { - log.log(Level.SEVERE, "Failed to redeploy " + instance + ". Reverting routing status to " + currentStatus.status(), e); changeStatus(upstreamNames, currentStatus); @@ -138,6 +142,8 @@ public class RoutingStatusApiHandler extends RestApiRequestHandler<RoutingStatus /** Change routing status of a zone */ private SlimeJsonResponse changeZoneStatus(RestApi.RequestContext context) { boolean in = context.request().getMethod() == HttpRequest.Method.DELETE; + log.log(Level.INFO, "Changing routing status of zone from " + zoneStatus() + " to " + + (in ? RoutingStatus.in : RoutingStatus.out)); if (in) { curator.delete(ZONE_STATUS); return new SlimeJsonResponse(toSlime(RoutingStatus.in)); |