summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorGeir Storli <geirst@oath.com>2018-01-11 10:51:06 +0100
committerGeir Storli <geirst@oath.com>2018-01-11 10:51:06 +0100
commitf987633a05ecf0a0e15e825e9f67c50570393923 (patch)
tree3187a1afe688c43e61a3913a943f8ee2a1e18647 /config-model
parentb0a55d977127c829c38fa5857ccd6a20dd07c883 (diff)
Deactivate all validation of redundancy when multiple bucket spaces is enabled.
The global distribution config transform in the distributor will ensure that number of ready copies == redundancy == number of nodes.
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/GlobalDistributionValidator.java2
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/content/GlobalDistributionValidatorTest.java10
2 files changed, 9 insertions, 3 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/GlobalDistributionValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/content/GlobalDistributionValidator.java
index 7098e1597f4..4bdef0607a2 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/content/GlobalDistributionValidator.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/content/GlobalDistributionValidator.java
@@ -26,8 +26,8 @@ public class GlobalDistributionValidator {
boolean enableMultipleBucketSpaces) {
if (!enableMultipleBucketSpaces) {
verifyGlobalDocumentsHaveRequiredRedundancy(globallyDistributedDocuments, redundancy);
+ verifySearchableCopiesIsSameAsRedundancy(globallyDistributedDocuments, redundancy);
}
- verifySearchableCopiesIsSameAsRedundancy(globallyDistributedDocuments, redundancy);
verifyReferredDocumentsArePresent(documentDefinitions);
verifyReferredDocumentsAreGlobal(documentDefinitions, globallyDistributedDocuments);
}
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/GlobalDistributionValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/GlobalDistributionValidatorTest.java
index 3666ec41a06..b8252f2f081 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/content/GlobalDistributionValidatorTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/content/GlobalDistributionValidatorTest.java
@@ -41,11 +41,11 @@ public class GlobalDistributionValidatorTest {
}
@Test
- public void validation_of_global_distribution_is_deactivated_if_multiple_bucket_spaces_is_enabled() {
+ public void validation_of_redundancy_is_deactivated_if_multiple_bucket_spaces_is_enabled() {
Fixture fixture = new Fixture()
.addGlobalDocument(createDocumentType("foo"))
.addGlobalDocument(createDocumentType("bar"));
- Redundancy redundancy = createRedundancyWithoutGlobalDistribution();
+ Redundancy redundancy = createRedundancyWithoutGlobalDistributionAndTooFewSearchableCopies();
validate(fixture, redundancy, true);
}
@@ -148,6 +148,12 @@ public class GlobalDistributionValidatorTest {
return redundancy;
}
+ private static Redundancy createRedundancyWithoutGlobalDistributionAndTooFewSearchableCopies() {
+ Redundancy redundancy = new Redundancy(2, 2, 1);
+ redundancy.setTotalNodes(3);
+ return redundancy;
+ }
+
private static NewDocumentType createDocumentType(String name, NewDocumentType... references) {
Set<NewDocumentType.Name> documentReferences = Stream.of(references).map(NewDocumentType::getFullName).collect(toSet());
return new NewDocumentType(new NewDocumentType.Name(name), documentReferences);