diff options
author | Geir Storli <geirst@verizonmedia.com> | 2019-12-12 18:31:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-12 18:31:55 +0100 |
commit | 14b0a54720077edf95d270741d207f9015a1c7aa (patch) | |
tree | a1cdd4d889c9df6f40dcc2b3f46cfe52ca995d90 | |
parent | 770779f5eb1452beefc1a5e0839759be5b1851a7 (diff) | |
parent | 2ca6bcd349163c12e4105c2b77cbf5a09b32702e (diff) |
Merge pull request #11550 from vespa-engine/toregge/adding-attribute-aspect-to-struct-field-requires-service-restart
Update config change validator to require restart (and not refeed) wh…
3 files changed, 11 insertions, 14 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidator.java index 4dfeb808e31..e3f9610d0a4 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidator.java @@ -12,7 +12,7 @@ import com.yahoo.searchdefinition.derived.AttributeFields; import com.yahoo.searchdefinition.document.Attribute; import com.yahoo.searchdefinition.document.ComplexAttributeFieldUtils; import com.yahoo.vespa.model.application.validation.change.VespaConfigChangeAction; -import com.yahoo.vespa.model.application.validation.change.VespaRefeedAction; +import com.yahoo.vespa.model.application.validation.change.VespaRestartAction; import java.time.Instant; import java.util.ArrayList; @@ -65,11 +65,9 @@ public class StructFieldAttributeChangeValidator { return next.structFieldAttributes.stream() .filter(nextAttr -> current.hasFieldForStructFieldAttribute(nextAttr) && !current.hasStructFieldAttribute(nextAttr)) - .map(nextAttr -> VespaRefeedAction.of("field-type-change", - overrides, + .map(nextAttr -> new VespaRestartAction( new ChangeMessageBuilder(nextAttr.getName()) - .addChange("add attribute aspect").build(), - now)) + .addChange("add attribute aspect").build())) .collect(Collectors.toList()); } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidatorTest.java index 43db1c65d37..c24b5250a5d 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidatorTest.java @@ -43,8 +43,7 @@ public class DocumentDatabaseChangeValidatorTest { "field f4 type array<s> { struct-field s1 { indexing: attribute } }"); f.assertValidation(Arrays.asList( newRestartAction("Field 'f1' changed: add attribute aspect"), - newRefeedAction("field-type-change", - "Field 'f4.s1' changed: add attribute aspect"), + newRestartAction("Field 'f4.s1' changed: add attribute aspect"), newRefeedAction("indexing-change", ValidationOverrides.empty, "Field 'f2' changed: add index aspect, indexing script: '{ input f2 | summary f2; }' -> " + diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidatorTestCase.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidatorTestCase.java index c224e801fa3..2d68284c9a5 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidatorTestCase.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidatorTestCase.java @@ -9,7 +9,7 @@ import java.time.Instant; import java.util.ArrayList; import java.util.List; -import static com.yahoo.vespa.model.application.validation.change.ConfigChangeTestUtils.newRefeedAction; +import static com.yahoo.vespa.model.application.validation.change.ConfigChangeTestUtils.newRestartAction; /** * @author geirst @@ -47,24 +47,24 @@ public class StructFieldAttributeChangeValidatorTestCase { } @Test - public void adding_attribute_aspect_to_struct_field_requires_refeed() throws Exception { + public void adding_attribute_aspect_to_struct_field_requires_restart() throws Exception { validate(arrayOfStruct(oneFieldStruct(), ""), arrayOfStruct(oneFieldStruct(), structAttribute("s1")), - newRefeedAction("field-type-change", "Field 'f1.s1' changed: add attribute aspect")); + newRestartAction("Field 'f1.s1' changed: add attribute aspect")); validate(mapOfStruct(oneFieldStruct(), ""), mapOfStruct(oneFieldStruct(), structAttribute("key")), - newRefeedAction("field-type-change", "Field 'f1.key' changed: add attribute aspect")); + newRestartAction("Field 'f1.key' changed: add attribute aspect")); validate(mapOfStruct(oneFieldStruct(), ""), mapOfStruct(oneFieldStruct(), structAttribute("value.s1")), - newRefeedAction("field-type-change", "Field 'f1.value.s1' changed: add attribute aspect")); + newRestartAction("Field 'f1.value.s1' changed: add attribute aspect")); validate(mapOfPrimitive(""), mapOfPrimitive(structAttribute("key")), - newRefeedAction("field-type-change", "Field 'f1.key' changed: add attribute aspect")); + newRestartAction("Field 'f1.key' changed: add attribute aspect")); validate(mapOfPrimitive(""), mapOfPrimitive(structAttribute("value")), - newRefeedAction("field-type-change", "Field 'f1.value' changed: add attribute aspect")); + newRestartAction("Field 'f1.value' changed: add attribute aspect")); } @Test |