diff options
Diffstat (limited to 'configserver')
3 files changed, 19 insertions, 10 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java index 0e17a31886b..3a9e5a55191 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java @@ -5,7 +5,6 @@ import com.google.common.io.Files; import com.google.inject.Inject; import com.yahoo.cloud.config.ConfigserverConfig; import com.yahoo.component.Version; -import com.yahoo.component.Vtag; import com.yahoo.config.FileReference; import com.yahoo.config.application.api.ApplicationFile; import com.yahoo.config.application.api.ApplicationMetaData; @@ -71,8 +70,10 @@ import java.time.Duration; import java.time.Instant; import java.util.Arrays; import java.util.Collection; +import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.logging.Level; @@ -326,7 +327,8 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye Deployment deployment = deployFromPreparedSession(localSession, tenant, timeoutBudget.timeLeft()); deployment.setIgnoreSessionStaleFailure(ignoreSessionStaleFailure); deployment.activate(); - return localSession.getApplicationId(); + ApplicationId applicationId = localSession.getApplicationId(); + return applicationId; } private Deployment deployFromPreparedSession(LocalSession session, Tenant tenant, Duration timeout) { @@ -444,6 +446,10 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye return fileReferencesToDelete; } + public Set<FileReference> getFileReferences(ApplicationId applicationId) { + return getOptionalApplication(applicationId).map(app -> app.getModel().fileReferences()).orElse(Set.of()); + } + public ApplicationFile getApplicationFileFromSession(TenantName tenantName, long sessionId, String path, LocalSession.Mode mode) { Tenant tenant = tenantRepository.getTenant(tenantName); return getLocalSession(tenant, sessionId).getApplicationFile(Path.fromString(path), mode); diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/Deployment.java b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/Deployment.java index b6e1d1873c9..9e81d3c0525 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/Deployment.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/Deployment.java @@ -3,6 +3,7 @@ package com.yahoo.vespa.config.server.deploy; import com.yahoo.component.Version; import com.yahoo.config.application.api.DeployLogger; +import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.HostFilter; import com.yahoo.config.provision.Provisioner; import com.yahoo.log.LogLevel; @@ -120,14 +121,12 @@ public class Deployment implements com.yahoo.config.provision.Deployment { TimeoutBudget timeoutBudget = new TimeoutBudget(clock, timeout); - try (Lock lock = tenant.getApplicationRepo().lock(session.getApplicationId())) { + ApplicationId applicationId = session.getApplicationId(); + try (Lock lock = tenant.getApplicationRepo().lock(applicationId)) { validateSessionStatus(session); NestedTransaction transaction = new NestedTransaction(); - transaction.add(deactivateCurrentActivateNew(applicationRepository.getActiveSession(session.getApplicationId()), session, ignoreSessionStaleFailure)); - - if (hostProvisioner.isPresent()) { - hostProvisioner.get().activate(transaction, session.getApplicationId(), session.getAllocatedHosts().getHosts()); - } + transaction.add(deactivateCurrentActivateNew(applicationRepository.getActiveSession(applicationId), session, ignoreSessionStaleFailure)); + hostProvisioner.ifPresent(provisioner -> provisioner.activate(transaction, applicationId, session.getAllocatedHosts().getHosts())); transaction.commit(); } catch (RuntimeException e) { throw e; @@ -139,8 +138,9 @@ public class Deployment implements com.yahoo.config.provision.Deployment { log.log(LogLevel.INFO, session.logPre() + "Session " + session.getSessionId() + " activated successfully using " + - ( hostProvisioner.isPresent() ? hostProvisioner.get() : "no host provisioner" ) + - ". Config generation " + session.getMetaData().getGeneration()); + (hostProvisioner.isPresent() ? hostProvisioner.get() : "no host provisioner") + + ". Config generation " + session.getMetaData().getGeneration() + + ". File references used: " + applicationRepository.getFileReferences(applicationId)); } /** diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java index 1ff6d67fe5b..3610de172a2 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java @@ -36,11 +36,13 @@ public class LbServicesProducer implements LbServicesConfig.Producer { private final Map<TenantName, Set<ApplicationInfo>> models; private final Zone zone; private final BooleanFlag dynamicUpstreamConnectionCache; + private final BooleanFlag healthCheckOn4081; public LbServicesProducer(Map<TenantName, Set<ApplicationInfo>> models, Zone zone, FlagSource flagSource) { this.models = models; this.zone = zone; this.dynamicUpstreamConnectionCache = Flags.DYNAMIC_UPSTREAM_CONNECTION_CACHE.bindTo(flagSource); + this.healthCheckOn4081 = Flags.HEALTH_CHECK_ON_4081.bindTo(flagSource); } @Override @@ -68,6 +70,7 @@ public class LbServicesProducer implements LbServicesConfig.Producer { LbServicesConfig.Tenants.Applications.Builder ab = new LbServicesConfig.Tenants.Applications.Builder(); ab.activeRotation(getActiveRotation(app)); ab.dynamicUpstreamConnectionCache(dynamicUpstreamConnectionCache.with(FetchVector.Dimension.APPLICATION_ID, app.getApplicationId().serializedForm()).value()); + ab.healthCheckOn4081(healthCheckOn4081.with(FetchVector.Dimension.APPLICATION_ID, app.getApplicationId().serializedForm()).value()); app.getModel().getHosts().stream() .sorted((a, b) -> a.getHostname().compareTo(b.getHostname())) .forEach(hostInfo -> ab.hosts(hostInfo.getHostname(), getHostsConfig(hostInfo))); |