summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2019-07-02 13:28:02 +0200
committerGeir Storli <geirst@verizonmedia.com>2019-07-02 13:28:02 +0200
commitd23d87fafa89ba81f72d858624ebdd69c349b1cc (patch)
tree63851461c59c713660f9dd80b09ead8e1bdda82e /config-model
parentb6241e25aaefb59ee9b0251ce7284175fe647592 (diff)
Improve error message when changing global document flag.
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/GlobalDocumentChangeValidator.java6
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/GlobalDocumentChangeValidatorTest.java4
2 files changed, 7 insertions, 3 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/GlobalDocumentChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/GlobalDocumentChangeValidator.java
index 73bf3a4fe3e..198030d1f44 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/GlobalDocumentChangeValidator.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/GlobalDocumentChangeValidator.java
@@ -41,8 +41,10 @@ public class GlobalDocumentChangeValidator implements ChangeValidator {
boolean currentIsGlobal = currentCluster.isGloballyDistributed(currentDocumentType);
boolean nextIsGlobal = nextCluster.isGloballyDistributed(nextDocumentType);
if (currentIsGlobal != nextIsGlobal) {
- throw new IllegalStateException(String.format("Document type %s in cluster %s changed global from %s to %s",
- documentTypeName, clusterName, currentIsGlobal, nextIsGlobal));
+ throw new IllegalStateException(String.format("Document type %s in cluster %s changed global from %s to %s. " +
+ "Add validation override '%s' to force this change through. " +
+ "First, stop services on all content nodes. Then, deploy with validation override. Finally, start services on all content nodes.",
+ documentTypeName, clusterName, currentIsGlobal, nextIsGlobal, ValidationId.globalDocumentChange.value()));
}
}
});
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/GlobalDocumentChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/GlobalDocumentChangeValidatorTest.java
index bc6863c9a7c..68b21222fc5 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/GlobalDocumentChangeValidatorTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/GlobalDocumentChangeValidatorTest.java
@@ -40,7 +40,9 @@ public class GlobalDocumentChangeValidatorTest {
assertTrue(allowed);
} catch (IllegalStateException e) {
assertFalse(allowed);
- assertEquals("Document type music in cluster default changed global from " + oldGlobal + " to " + newGlobal,
+ assertEquals("Document type music in cluster default changed global from " + oldGlobal + " to " + newGlobal + ". " +
+ "Add validation override 'global-document-change' to force this change through. " +
+ "First, stop services on all content nodes. Then, deploy with validation override. Finally, start services on all content nodes.",
e.getMessage());
}
}