summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2022-01-16 21:35:39 +0100
committerHarald Musum <musum@yahooinc.com>2022-01-16 21:35:39 +0100
commitf3b0bc340c88b953a5f9f7985648e0a03a36ba5c (patch)
treef94abd1baafd7668a2b4dbe71f35393fac0eaed3
parent79d57272a8228e9581d887ca26ecbaa7c7816c53 (diff)
Add feature flag for checking config convergence before restart
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java4
-rw-r--r--flags/src/main/java/com/yahoo/vespa/flags/Flags.java7
2 files changed, 11 insertions, 0 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 80194337daa..c6c5b81019e 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
@@ -147,6 +147,7 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
private final Metric metric;
private final SecretStoreValidator secretStoreValidator;
private final ClusterReindexingStatusClient clusterReindexingStatusClient;
+ private final FlagSource flagSource;
@Inject
public ApplicationRepository(TenantRepository tenantRepository,
@@ -203,6 +204,7 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
this.metric = Objects.requireNonNull(metric);
this.secretStoreValidator = Objects.requireNonNull(secretStoreValidator);
this.clusterReindexingStatusClient = clusterReindexingStatusClient;
+ this.flagSource = flagSource;
}
public static class Builder {
@@ -1016,6 +1018,8 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
return applicationId.orElse(null);
}
+ public FlagSource flagSource() { return flagSource; }
+
private Session validateThatLocalSessionIsNotActive(Tenant tenant, long sessionId) {
Session session = getLocalSession(tenant, sessionId);
if (Session.Status.ACTIVATE.equals(session.getStatus())) {
diff --git a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
index c94bfec948e..1127d0696c8 100644
--- a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
+++ b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
@@ -388,6 +388,13 @@ public class Flags {
"Triggers restart, takes effect immediately",
ZONE_ID, APPLICATION_ID);
+ public static final UnboundBooleanFlag CHECK_CONFIG_CONVERGENCE_BEFORE_RESTARTING = defineFeatureFlag(
+ "check-config-convergence-before-restart", false,
+ List.of("hmusum"), "2022-01-16", "2022-02-16",
+ "Check that config has converged to new generation on all services before restarting services",
+ "Takes effect immediately",
+ ZONE_ID, APPLICATION_ID);
+
/** WARNING: public for testing: All flags should be defined in {@link Flags}. */
public static UnboundBooleanFlag defineFeatureFlag(String flagId, boolean defaultValue, List<String> owners,
String createdAt, String expiresAt, String description,