From 10473dd015629fbf17512c982bbe57651ce54413 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Thu, 27 Apr 2023 09:09:21 +0200 Subject: Derive searchable-copies automatically with groups > 2 --- .../vespa/model/content/ContentClusterTest.java | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'config-model/src/test') 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 12a6ac00f48..71dd3223da2 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 @@ -160,6 +160,54 @@ public class ContentClusterTest extends ContentBaseTest { assertEquals(5, protonConfig.distribution().redundancy()); } + @Test + void testImplicitSearchableCopies() { + ContentCluster cc = parse("" + + "\n" + + " " + + " 3\n" + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + "" + ); + DistributionConfig.Builder distributionBuilder = new DistributionConfig.Builder(); + cc.getConfig(distributionBuilder); + DistributionConfig distributionConfig = distributionBuilder.build(); + assertEquals(3, distributionConfig.cluster("storage").ready_copies()); + + StorDistributionConfig.Builder storBuilder = new StorDistributionConfig.Builder(); + cc.getConfig(storBuilder); + StorDistributionConfig storConfig = new StorDistributionConfig(storBuilder); + assertEquals(3, storConfig.ready_copies()); + + ProtonConfig.Builder protonBuilder = new ProtonConfig.Builder(); + cc.getSearch().getConfig(protonBuilder); + ProtonConfig protonConfig = new ProtonConfig(protonBuilder); + assertEquals(1, protonConfig.distribution().searchablecopies()); + } + @Test void testMinRedundancy() { { // Groups ensures redundancy -- cgit v1.2.3