aboutsummaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-06-19 12:07:18 +0200
committerJon Bratseth <bratseth@oath.com>2018-06-19 12:07:18 +0200
commitaebc3edabe3e06a90600b5204f2a9d5b2506ce2e (patch)
treec48f4ca5846519e85d4c02653944ea2d091fceff /configserver
parent0f4b4c99881aed25e9c9b946c74c4be80ee242ab (diff)
Reuse allocation decisions
During deployment we first prepare the application on one config server then notifies the other config servers (by setting state=PREPARED) that they should load it. That will cause allocation requests against the node repo to be done once over on the those config servers. These simultaneous requests against the node repo may cause ut to time out waiting for the node repo's application lock if these requests take a somewhat long time. This change reads existing allocations instead of redoing allocation requests against the node repo. The existing allocation is saved (on the first config server) before state=PREPARED is set.
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSession.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSession.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSession.java
index 454b98ddc05..9374d68a6ac 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSession.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSession.java
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.session;
+import com.yahoo.config.application.api.ApplicationPackage;
import com.yahoo.config.provision.*;
import com.yahoo.lang.SettableOptional;
import com.yahoo.vespa.config.server.*;
@@ -54,10 +55,15 @@ public class RemoteSession extends Session {
}
private ApplicationSet loadApplication() {
+ ApplicationPackage applicationPackage = zooKeeperClient.loadApplicationPackage();
+
+ // Read hosts allocated on the config server instance which created this
+ Optional<AllocatedHosts> allocatedHosts = applicationPackage.getAllocatedHosts();
+
return ApplicationSet.fromList(applicationLoader.buildModels(zooKeeperClient.readApplicationId(),
zooKeeperClient.readVespaVersion(),
zooKeeperClient.loadApplicationPackage(),
- new SettableOptional<>(),
+ new SettableOptional<>(allocatedHosts),
clock.instant()));
}