diff options
-rw-r--r-- | config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigValueChangeValidatorTest.java | 32 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/config/proton.def | 6 |
2 files changed, 31 insertions, 7 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigValueChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigValueChangeValidatorTest.java index cbb725987eb..f9944f563c4 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigValueChangeValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigValueChangeValidatorTest.java @@ -65,6 +65,14 @@ public class ConfigValueChangeValidatorTest { } @Test + public void requireThatDocumentTypesCanBeAddedWithoutNeedForRestart() { + List<ConfigChangeAction> changes = getConfigChanges( + createVespaModel("", Arrays.asList("foo")), + createVespaModel("", Arrays.asList("foo", "bar"))); + assertEquals(0, changes.size()); + } + + @Test public void requireThatValidatorDetectsConfigChangeFromService() { MockRoot oldRoot = createRootWithChildren(new SimpleConfigProducer("p", 0) .withChildren(new ServiceWithAnnotation("s1", 1), new ServiceWithAnnotation("s2", 2))); @@ -162,6 +170,10 @@ public class ConfigValueChangeValidatorTest { } private static VespaModel createVespaModel(String configSegment) { + return createVespaModel(configSegment, Arrays.asList("music")); + } + + private static VespaModel createVespaModel(String configSegment, List<String> docTypes) { // Note that the configSegment is here located on root. return new VespaModelCreatorWithMockPkg( null, @@ -178,9 +190,7 @@ public class ConfigValueChangeValidatorTest { " </jdisc>\n" + " <content id='basicsearch' version='1.0'>\n" + " <redundancy>1</redundancy>\n" + - " <documents>\n" + - " <document type='music' mode='index'/>\n" + - " </documents>\n" + + createDocumentsSegment(docTypes) + "\n" + " <group>\n" + " <node hostalias='node1' distribution-key='0'/>\n" + " </group>\n" + @@ -191,10 +201,24 @@ public class ConfigValueChangeValidatorTest { " </engine>\n" + " </content>\n" + "</services>", - Collections.singletonList("search music { document music { } }") + createSearchDefinitions(docTypes) ).create(); } + private static String createDocumentsSegment(List<String> docTypes) { + return "<documents>\n" + + docTypes.stream() + .map(type -> "<document type='" + type + "' mode='index'/>") + .collect(Collectors.joining("\n")) + + "</documents>"; + } + + private static List<String> createSearchDefinitions(List<String> docTypes) { + return docTypes.stream() + .map(type -> "search " + type + " { document " + type + " { } }") + .collect(Collectors.toList()); + } + private static String createQrStartConfigSegment(boolean verboseGc, int heapsize) { return "<config name='search.config.qr-start'>\n" + " <jvm>\n" + diff --git a/searchcore/src/vespa/searchcore/config/proton.def b/searchcore/src/vespa/searchcore/config/proton.def index 8c01c45dac8..2fd991538ab 100644 --- a/searchcore/src/vespa/searchcore/config/proton.def +++ b/searchcore/src/vespa/searchcore/config/proton.def @@ -279,13 +279,13 @@ summary.read.mmap.advise enum {NORMAL, RANDOM, SEQUENTIAL} default=NORMAL restar summary.compact2buckets bool default=true restart ## The name of the input document type -documentdb[].inputdoctypename string restart +documentdb[].inputdoctypename string ## The configid used to subscribe to config for this database. -documentdb[].configid string restart +documentdb[].configid string ## How many seconds is allowed from document is received to it is visible in the index. documentdb[].visibilitydelay double default=0.0 ## Whether this document type is globally distributed or not. -documentdb[].global bool default=false restart +documentdb[].global bool default=false ## The interval of when periodic tasks should be run periodic.interval double default=3600.0 |