aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@vespa.ai>2024-06-03 14:18:02 +0000
committerTor Brede Vekterli <vekterli@vespa.ai>2024-06-03 14:18:02 +0000
commitc591269b058d2573dc3968b3d869bcc6c27a4adf (patch)
tree7877e8e306276a36e70da737ef4b5a8190b13964 /config-model/src/test/java
parenta583af74d94ba8ab9562f9847443747a954a0fd8 (diff)
Add feature flag for enforcing strictly increasing cluster state versions
Applies to `stor-server` config for both distributors and storage nodes. Defaults to `false` for now.
Diffstat (limited to 'config-model/src/test/java')
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java
index 5dca5a9eaa1..adcfcda0713 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java
@@ -1576,6 +1576,32 @@ public class ContentClusterTest extends ContentBaseTest {
assertEquals(warnings, "");
}
+ private void checkStrictlyIncreasingClusterStateVersionConfig(Boolean flagValue, boolean expected) throws Exception {
+ var props = new TestProperties();
+ if (flagValue != null) {
+ props.setEnforceStrictlyIncreasingClusterStateVersions(flagValue);
+ }
+ var cc = createOneNodeCluster(props);
+
+ // stor-server config should be the same for both distributors and storage nodes
+ var builder = new StorServerConfig.Builder();
+ cc.getStorageCluster().getConfig(builder);
+ var cfg = builder.build();
+ assertEquals(expected, cfg.require_strictly_increasing_cluster_state_versions());
+
+ builder = new StorServerConfig.Builder();
+ cc.getDistributorNodes().getConfig(builder);
+ cfg = builder.build();
+ assertEquals(expected, cfg.require_strictly_increasing_cluster_state_versions());
+ }
+
+ @Test
+ void strictly_increasing_cluster_state_versions_config_controlled_by_feature_flag() throws Exception {
+ checkStrictlyIncreasingClusterStateVersionConfig(null, false); // TODO change default
+ checkStrictlyIncreasingClusterStateVersionConfig(false, false);
+ checkStrictlyIncreasingClusterStateVersionConfig(true, true);
+ }
+
private String servicesWithGroups(int groupCount, double minGroupUpRatio) {
String services = String.format("<?xml version='1.0' encoding='UTF-8' ?>" +
"<services version='1.0'>" +