aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2022-08-24 15:00:43 +0200
committerTor Brede Vekterli <vekterli@yahooinc.com>2022-08-24 15:00:43 +0200
commit2380b98596ffcf07150a2935858c4204849e199c (patch)
tree6956e40414e2562a76fd0580f9fb9835e2e26673 /config-model/src/test
parent26d0b997cc573bac2a1d7eda7a2494449452e121 (diff)
Add feature flag for two-phase document GC in content clusters
Diffstat (limited to 'config-model/src/test')
-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 17ce43bba2c..ac291fc578f 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
@@ -1165,6 +1165,32 @@ public class ContentClusterTest extends ContentBaseTest {
return (new StorDistributormanagerConfig(builder)).use_unordered_merge_chaining();
}
+ private boolean resolveTwoPhaseGcConfigWithFeatureFlag(Boolean flagEnableTwoPhase) {
+ var props = new TestProperties();
+ if (flagEnableTwoPhase != null) {
+ props.setUseTwoPhaseDocumentGc(flagEnableTwoPhase);
+ }
+ VespaModel model = createEnd2EndOneNode(props);
+
+ ContentCluster cc = model.getContentClusters().get("storage");
+ var builder = new StorDistributormanagerConfig.Builder();
+ cc.getDistributorNodes().getConfig(builder);
+
+ return (new StorDistributormanagerConfig(builder)).enable_two_phase_garbage_collection();
+ }
+
+ @Test
+ public void two_phase_garbage_collection_config_is_controlled_by_properties() {
+ assertFalse(resolveTwoPhaseGcConfigWithFeatureFlag(false));
+ assertTrue(resolveTwoPhaseGcConfigWithFeatureFlag(true));
+ }
+
+ // TODO change once gradual rollout complete
+ @Test
+ public void two_phase_garbage_collection_config_is_disabled_by_default() {
+ assertFalse(resolveTwoPhaseGcConfigWithFeatureFlag(null));
+ }
+
@Test
void testDedicatedClusterControllers() {
VespaModel noContentModel = createEnd2EndOneNode(new TestProperties().setHostedVespa(true)