summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2024-01-12 14:15:02 +0100
committerGitHub <noreply@github.com>2024-01-12 14:15:02 +0100
commitff55a745737d5977790c6c436bf29e3d151e0126 (patch)
treed3d29868238cd23d4673619c69c480ba3a30c22a /config-model
parentcd3983f228f4847cf5d4d39c7cc20fdee2c2b1a2 (diff)
parent469d7dc346f3c900953e9cd8110c6fa070ff5e74 (diff)
Merge pull request #29875 from vespa-engine/jonmv/two-phase-deploy
Always delay config until after restart when loading models, for rest…
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/application/validation/Validation.java18
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/RestartChangesDefersConfigChangesTest.java48
2 files changed, 0 insertions, 66 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/Validation.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/Validation.java
index dc7a2651e1f..56b7e6ee0c8 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/Validation.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/Validation.java
@@ -74,8 +74,6 @@ public class Validation {
}
else if (deployState.getPreviousModel().isPresent() && (deployState.getPreviousModel().get() instanceof VespaModel)) {
validateChanges(execution);
- // TODO: Why is this done here? It won't be done on more than one config server?
- deferConfigChangesForClustersToBeRestarted(execution.actions, model);
}
execution.throwIfFailed();
@@ -138,22 +136,6 @@ public class Validation {
new RestartOnDeployForOnnxModelChangesValidator().validate(execution);
}
- private static void deferConfigChangesForClustersToBeRestarted(List<ConfigChangeAction> actions, VespaModel model) {
- Set<ClusterSpec.Id> clustersToBeRestarted = actions.stream()
- .filter(action -> action.getType() == ConfigChangeAction.Type.RESTART)
- .map(action -> action.clusterId())
- .collect(Collectors.toCollection(() -> new LinkedHashSet<>()));
- for (var clusterToRestart : clustersToBeRestarted) {
- var containerCluster = model.getContainerClusters().get(clusterToRestart.value());
- if (containerCluster != null)
- containerCluster.setDeferChangesUntilRestart(true);
-
- var contentCluster = model.getContentClusters().get(clusterToRestart.value());
- if (contentCluster != null)
- contentCluster.setDeferChangesUntilRestart(true);
- }
- }
-
public interface Context {
/** Auxiliary deploy state of the application. */
DeployState deployState();
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/RestartChangesDefersConfigChangesTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/RestartChangesDefersConfigChangesTest.java
deleted file mode 100644
index 35681095144..00000000000
--- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/RestartChangesDefersConfigChangesTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.model.application.validation.change;
-
-import com.yahoo.config.model.provision.InMemoryProvisioner;
-import com.yahoo.config.provision.Environment;
-import com.yahoo.config.provision.NodeResources;
-import com.yahoo.container.ComponentsConfig;
-import com.yahoo.vespa.model.VespaModel;
-import com.yahoo.vespa.model.application.validation.ValidationTester;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-/**
- * @author bratseth
- */
-public class RestartChangesDefersConfigChangesTest {
-
- @Test
- void changes_requiring_restart_defers_config_changes() {
- ValidationTester tester = new ValidationTester(new InMemoryProvisioner(5,
- new NodeResources(1, 3, 9, 1),
- true));
- VespaModel gen1 = tester.deploy(null, getServices(5, 3), Environment.prod, null).getFirst();
-
- // Change node count - no restart
- VespaModel gen2 = tester.deploy(gen1, getServices(4, 3), Environment.prod, null).getFirst();
- var config2 = new ComponentsConfig.Builder();
- gen2.getContainerClusters().get("default").getContainers().get(0).getConfig(config2);
- assertFalse(config2.getApplyOnRestart());
-
- // Change memory amount - requires restart
- VespaModel gen3 = tester.deploy(gen2, getServices(4, 2), Environment.prod, null).getFirst();
- var config3 = new ComponentsConfig.Builder();
- gen3.getContainerClusters().get("default").getContainers().get(0).getConfig(config3);
- assertTrue(config3.getApplyOnRestart());
- }
-
- private static String getServices(int nodes, int memory) {
- return "<services version='1.0'>" +
- " <container id='default' version='1.0'>" +
- " <nodes count='" + nodes + "'><resources vcpu='1' memory='" + memory + "Gb' disk='9Gb'/></nodes>" +
- " </container>" +
- "</services>";
- }
-
-}