diff options
36 files changed, 144 insertions, 302 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/ConfigChangeAction.java b/config-model-api/src/main/java/com/yahoo/config/model/api/ConfigChangeAction.java index 70a54918216..87a150a6c3c 100644 --- a/config-model-api/src/main/java/com/yahoo/config/model/api/ConfigChangeAction.java +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/ConfigChangeAction.java @@ -39,16 +39,11 @@ public interface ConfigChangeAction { /** Returns the list of services where the action must be performed */ List<ServiceInfo> getServices(); - /** Returns whether this change should be allowed. */ - // TODO jonmv: remove in 2021. - boolean allowed(); - /** When this is non-empty, validation may fail unless this validation id is allowed by validation overrides. */ default Optional<ValidationId> validationId() { return Optional.empty(); } /** The id of the cluster that needs this action applied */ - // TODO: Remove this default implementation after October 2020 - default ClusterSpec.Id clusterId() { return null; } + ClusterSpec.Id clusterId(); /** Returns whether this change should be ignored for internal redeploy */ default boolean ignoreForInternalRedeploy() { diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/ConfigChangeRestartAction.java b/config-model-api/src/main/java/com/yahoo/config/model/api/ConfigChangeRestartAction.java index f178180b6e0..c13399a42f5 100644 --- a/config-model-api/src/main/java/com/yahoo/config/model/api/ConfigChangeRestartAction.java +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/ConfigChangeRestartAction.java @@ -11,8 +11,4 @@ public interface ConfigChangeRestartAction extends ConfigChangeAction { @Override default Type getType() { return Type.RESTART; } - /** Restarts are handled automatically so they are allowed */ - @Override - default boolean allowed() { return true; } - } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/IndexingModeChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/IndexingModeChangeValidator.java index 9babc6846e0..385a678d452 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/IndexingModeChangeValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/IndexingModeChangeValidator.java @@ -46,22 +46,22 @@ public class IndexingModeChangeValidator implements ChangeValidator { ContentSearchCluster currentSearchCluster = currentCluster.getSearch(); ContentSearchCluster nextSearchCluster = nextCluster.getSearch(); findDocumentTypesWithActionableIndexingModeChange( - actions, overrides, nextCluster, now, + actions, nextCluster, toDocumentTypeNames(currentSearchCluster.getDocumentTypesWithStreamingCluster()), toDocumentTypeNames(nextSearchCluster.getDocumentTypesWithIndexedCluster()), "streaming", "indexed"); findDocumentTypesWithActionableIndexingModeChange( - actions, overrides, nextCluster, now, + actions, nextCluster, toDocumentTypeNames(currentSearchCluster.getDocumentTypesWithIndexedCluster()), toDocumentTypeNames(nextSearchCluster.getDocumentTypesWithStreamingCluster()), "indexed", "streaming"); findDocumentTypesWithActionableIndexingModeChange( - actions, overrides, nextCluster, now, + actions, nextCluster, toDocumentTypeNames(currentSearchCluster.getDocumentTypesWithStoreOnly()), toDocumentTypeNames(nextSearchCluster.getDocumentTypesWithIndexedCluster()), "store-only", "indexed"); findDocumentTypesWithActionableIndexingModeChange( - actions, overrides, nextCluster, now, + actions, nextCluster, toDocumentTypeNames(currentSearchCluster.getDocumentTypesWithIndexedCluster()), toDocumentTypeNames(nextSearchCluster.getDocumentTypesWithStoreOnly()), "indexed", "store-only"); @@ -69,7 +69,7 @@ public class IndexingModeChangeValidator implements ChangeValidator { } private static void findDocumentTypesWithActionableIndexingModeChange( - List<ConfigChangeAction> actions, ValidationOverrides overrides, ContentCluster nextCluster, Instant now, + List<ConfigChangeAction> actions, ContentCluster nextCluster, Set<String> currentTypes, Set<String> nextTypes, String currentIndexMode, String nextIndexingMode) { for (String type : nextTypes) { if (currentTypes.contains(type)) { @@ -79,13 +79,12 @@ public class IndexingModeChangeValidator implements ChangeValidator { actions.add(VespaReindexAction.of( nextCluster.id(), ValidationId.indexModeChange, - overrides, String.format( "Document type '%s' in cluster '%s' changed indexing mode from '%s' to '%s'", type, nextCluster.getName(), currentIndexMode, nextIndexingMode), services, - type, - now)); + type + )); } } } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidator.java index d85d9bd2db5..2f13caa4e09 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidator.java @@ -78,7 +78,7 @@ public class StreamingSearchClusterChangeValidator implements ChangeValidator { NewDocumentType nextDocType, ValidationOverrides overrides, Instant now) { - return new DocumentTypeChangeValidator(id, currentDocType, nextDocType).validate(overrides, now); + return new DocumentTypeChangeValidator(id, currentDocType, nextDocType).validate(); } private static NewDocumentType getDocumentType(ContentCluster cluster, StreamingSearchCluster streamingCluster) { diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/VespaRefeedAction.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/VespaRefeedAction.java index c7e09845b08..6a335447a31 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/VespaRefeedAction.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/VespaRefeedAction.java @@ -26,30 +26,28 @@ public class VespaRefeedAction extends VespaConfigChangeAction implements Config */ private final ValidationId validationId; private final String documentType; - private final boolean allowed; - private VespaRefeedAction(ClusterSpec.Id id, ValidationId validationId, String message, List<ServiceInfo> services, String documentType, boolean allowed) { + private VespaRefeedAction(ClusterSpec.Id id, ValidationId validationId, String message, List<ServiceInfo> services, String documentType) { super(id, message, services); this.validationId = validationId; this.documentType = documentType; - this.allowed = allowed; } /** Creates a refeed action with some missing information */ // TODO: We should require document type or model its absence properly - public static VespaRefeedAction of(ClusterSpec.Id id, ValidationId validationId, ValidationOverrides overrides, String message, Instant now) { - return new VespaRefeedAction(id, validationId, message, List.of(), "", overrides.allows(validationId, now)); + public static VespaRefeedAction of(ClusterSpec.Id id, ValidationId validationId, String message) { + return new VespaRefeedAction(id, validationId, message, List.of(), ""); } /** Creates a refeed action */ - public static VespaRefeedAction of(ClusterSpec.Id id, ValidationId validationId, ValidationOverrides overrides, String message, - List<ServiceInfo> services, String documentType, Instant now) { - return new VespaRefeedAction(id, validationId, message, services, documentType, overrides.allows(validationId, now)); + public static VespaRefeedAction of(ClusterSpec.Id id, ValidationId validationId, String message, + List<ServiceInfo> services, String documentType) { + return new VespaRefeedAction(id, validationId, message, services, documentType); } @Override public VespaConfigChangeAction modifyAction(String newMessage, List<ServiceInfo> newServices, String documentType) { - return new VespaRefeedAction(clusterId(), validationId, newMessage, newServices, documentType, allowed); + return new VespaRefeedAction(clusterId(), validationId, newMessage, newServices, documentType); } @Override @@ -59,9 +57,6 @@ public class VespaRefeedAction extends VespaConfigChangeAction implements Config public String getDocumentType() { return documentType; } @Override - public boolean allowed() { return allowed; } - - @Override public boolean ignoreForInternalRedeploy() { return false; } @@ -78,7 +73,6 @@ public class VespaRefeedAction extends VespaConfigChangeAction implements Config VespaRefeedAction other = (VespaRefeedAction)o; if ( ! this.documentType.equals(other.documentType)) return false; if ( ! this.validationId.equals(other.validationId)) return false; - if ( ! this.allowed == other.allowed) return false; return true; } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/VespaReindexAction.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/VespaReindexAction.java index b9c1b554fde..8b4060e7d19 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/VespaReindexAction.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/VespaReindexAction.java @@ -2,12 +2,10 @@ package com.yahoo.vespa.model.application.validation.change; import com.yahoo.config.application.api.ValidationId; -import com.yahoo.config.application.api.ValidationOverrides; import com.yahoo.config.model.api.ConfigChangeReindexAction; import com.yahoo.config.model.api.ServiceInfo; import com.yahoo.config.provision.ClusterSpec; -import java.time.Instant; import java.util.List; import java.util.Objects; import java.util.Optional; @@ -26,34 +24,30 @@ public class VespaReindexAction extends VespaConfigChangeAction implements Confi */ private final ValidationId validationId; private final String documentType; - private final boolean allowed; - private VespaReindexAction(ClusterSpec.Id id, ValidationId validationId, String message, List<ServiceInfo> services, String documentType, boolean allowed) { + private VespaReindexAction(ClusterSpec.Id id, ValidationId validationId, String message, List<ServiceInfo> services, String documentType) { super(id, message, services); this.validationId = validationId; this.documentType = documentType; - this.allowed = allowed; } - public static VespaReindexAction of( - ClusterSpec.Id id, ValidationId validationId, ValidationOverrides overrides, String message, Instant now) { - return new VespaReindexAction(id, validationId, message, List.of(), /*documentType*/null, overrides.allows(validationId, now)); + public static VespaReindexAction of(ClusterSpec.Id id, ValidationId validationId, String message) { + return new VespaReindexAction(id, validationId, message, List.of(), /*documentType*/null); } public static VespaReindexAction of( - ClusterSpec.Id id, ValidationId validationId, ValidationOverrides overrides, String message, - List<ServiceInfo> services, String documentType, Instant now) { - return new VespaReindexAction(id, validationId, message, services, documentType, overrides.allows(validationId, now)); + ClusterSpec.Id id, ValidationId validationId, String message, + List<ServiceInfo> services, String documentType) { + return new VespaReindexAction(id, validationId, message, services, documentType); } @Override public VespaConfigChangeAction modifyAction(String newMessage, List<ServiceInfo> newServices, String documentType) { - return new VespaReindexAction(clusterId(), validationId, newMessage, newServices, documentType, allowed); + return new VespaReindexAction(clusterId(), validationId, newMessage, newServices, documentType); } @Override public Optional<ValidationId> validationId() { return Optional.of(validationId); } @Override public String getDocumentType() { return documentType; } - @Override public boolean allowed() { return allowed; } @Override public boolean ignoreForInternalRedeploy() { return false; } @Override public String toString() { return super.toString() + ", documentType='" + documentType + "'"; } @@ -63,10 +57,10 @@ public class VespaReindexAction extends VespaConfigChangeAction implements Confi if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; VespaReindexAction that = (VespaReindexAction) o; - return allowed == that.allowed && - Objects.equals(validationId, that.validationId) && - Objects.equals(documentType, that.documentType); + return Objects.equals(validationId, that.validationId) && + Objects.equals(documentType, that.documentType); } - @Override public int hashCode() { return Objects.hash(super.hashCode(), validationId, documentType, allowed); } + @Override public int hashCode() { return Objects.hash(super.hashCode(), validationId, documentType); } + } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidator.java index 3dcfbe3629d..ce435a4c157 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidator.java @@ -72,7 +72,7 @@ public class DocumentDatabaseChangeValidator { private List<VespaConfigChangeAction> validateDocumentTypeChanges(ValidationOverrides overrides, Instant now) { return new DocumentTypeChangeValidator(id, currentDocType, nextDocType) - .validate(overrides, now); + .validate(); } } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidator.java index 20eb608cec5..5b7fdfad0f7 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidator.java @@ -6,11 +6,9 @@ import com.yahoo.config.provision.ClusterSpec; import com.yahoo.document.StructDataType; import com.yahoo.documentmodel.NewDocumentType; import com.yahoo.document.Field; -import com.yahoo.config.application.api.ValidationOverrides; import com.yahoo.vespa.model.application.validation.change.VespaConfigChangeAction; import com.yahoo.vespa.model.application.validation.change.VespaRefeedAction; -import java.time.Instant; import java.util.List; import java.util.stream.Collectors; @@ -137,17 +135,16 @@ public class DocumentTypeChangeValidator { this.nextDocType = nextDocType; } - public List<VespaConfigChangeAction> validate(ValidationOverrides overrides, Instant now) { + public List<VespaConfigChangeAction> validate() { return currentDocType.getAllFields().stream(). map(field -> createFieldChange(field, nextDocType)). filter(fieldChange -> fieldChange.valid() && fieldChange.changedType()). map(fieldChange -> VespaRefeedAction.of(id, ValidationId.fieldTypeChange, - overrides, new ChangeMessageBuilder(fieldChange.fieldName()). addChange("data type", fieldChange.currentTypeName(), - fieldChange.nextTypeName()).build(), - now)). + fieldChange.nextTypeName()).build() + )). collect(Collectors.toList()); } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidator.java index ea1c1a1d09e..e3f3abf0747 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidator.java @@ -41,21 +41,20 @@ public class IndexingScriptChangeValidator { String fieldName = nextField.getName(); ImmutableSDField currentField = currentSearch.getConcreteField(fieldName); if (currentField != null) { - validateScripts(currentField, nextField, overrides, now).ifPresent(r -> result.add(r)); + validateScripts(currentField, nextField).ifPresent(r -> result.add(r)); } } return result; } - private Optional<VespaConfigChangeAction> validateScripts(ImmutableSDField currentField, ImmutableSDField nextField, - ValidationOverrides overrides, Instant now) { + private Optional<VespaConfigChangeAction> validateScripts(ImmutableSDField currentField, ImmutableSDField nextField) { ScriptExpression currentScript = currentField.getIndexingScript(); ScriptExpression nextScript = nextField.getIndexingScript(); if ( ! equalScripts(currentScript, nextScript)) { ChangeMessageBuilder messageBuilder = new ChangeMessageBuilder(nextField.getName()); new IndexingScriptChangeMessageBuilder(currentSearch, currentField, nextSearch, nextField).populate(messageBuilder); messageBuilder.addChange("indexing script", currentScript.toString(), nextScript.toString()); - return Optional.of(VespaReindexAction.of(id, ValidationId.indexingChange, overrides, messageBuilder.build(), now)); + return Optional.of(VespaReindexAction.of(id, ValidationId.indexingChange, messageBuilder.build())); } return Optional.empty(); } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigChangeTestUtils.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigChangeTestUtils.java index 90f3f2383e4..2157839ef5c 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigChangeTestUtils.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/ConfigChangeTestUtils.java @@ -4,7 +4,6 @@ package com.yahoo.vespa.model.application.validation.change; import com.yahoo.config.application.api.ValidationId; import com.yahoo.config.model.api.ConfigChangeAction; import com.yahoo.config.model.api.ServiceInfo; -import com.yahoo.config.application.api.ValidationOverrides; import com.yahoo.config.provision.ClusterSpec; import java.time.Instant; @@ -26,25 +25,21 @@ public class ConfigChangeTestUtils { } public static VespaConfigChangeAction newRefeedAction(ClusterSpec.Id id, ValidationId validationId, String message) { - return VespaRefeedAction.of(id, validationId, ValidationOverrides.empty, message, Instant.now()); + return VespaRefeedAction.of(id, validationId, message); } - public static VespaConfigChangeAction newRefeedAction(ClusterSpec.Id id, ValidationId validationId, ValidationOverrides overrides, String message, Instant now) { - return VespaRefeedAction.of(id, validationId, overrides, message, now); + public static VespaConfigChangeAction newRefeedAction(ClusterSpec.Id id, ValidationId validationId, String message, + List<ServiceInfo> services, String documentType) { + return VespaRefeedAction.of(id, validationId, message, services, documentType); } - public static VespaConfigChangeAction newRefeedAction(ClusterSpec.Id id, ValidationId validationId, ValidationOverrides overrides, String message, - List<ServiceInfo> services, String documentType, Instant now) { - return VespaRefeedAction.of(id, validationId, overrides, message, services, documentType, now); + public static VespaConfigChangeAction newReindexAction(ClusterSpec.Id id, ValidationId validationId, String message) { + return VespaReindexAction.of(id, validationId, message); } - public static VespaConfigChangeAction newReindexAction(ClusterSpec.Id id, ValidationId validationId, ValidationOverrides overrides, String message, Instant now) { - return VespaReindexAction.of(id, validationId, overrides, message, now); - } - - public static VespaConfigChangeAction newReindexAction(ClusterSpec.Id id, ValidationId validationId, ValidationOverrides overrides, String message, - List<ServiceInfo> services, String documentType, Instant now) { - return VespaReindexAction.of(id, validationId, overrides, message, services, documentType, now); + public static VespaConfigChangeAction newReindexAction(ClusterSpec.Id id, ValidationId validationId, String message, + List<ServiceInfo> services, String documentType) { + return VespaReindexAction.of(id, validationId, message, services, documentType); } public static List<ConfigChangeAction> normalizeServicesInActions(List<ConfigChangeAction> result) { diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/IndexedSearchClusterChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/IndexedSearchClusterChangeValidatorTest.java index 3c787f4c241..2b211c561d9 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/IndexedSearchClusterChangeValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/IndexedSearchClusterChangeValidatorTest.java @@ -148,8 +148,7 @@ public class IndexedSearchClusterChangeValidatorTest { Fixture f = Fixture.newOneDocFixture(STRING_FIELD, INT_FIELD); f.assertValidation(List.of(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, - ValidationOverrides.empty, - "Document type 'd1': " + FIELD_TYPE_CHANGE_MSG, FOO_SERVICE, "d1", Instant.now()))); + "Document type 'd1': " + FIELD_TYPE_CHANGE_MSG, FOO_SERVICE, "d1"))); } } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/IndexingModeChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/IndexingModeChangeValidatorTest.java index 58c37736403..ba9dfcdc388 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/IndexingModeChangeValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/IndexingModeChangeValidatorTest.java @@ -1,7 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.application.validation.change; -import com.yahoo.config.application.api.ValidationOverrides; import com.yahoo.config.application.api.ValidationOverrides.ValidationException; import com.yahoo.config.model.api.ConfigChangeAction; import com.yahoo.config.model.api.ConfigChangeReindexAction; @@ -12,7 +11,6 @@ import org.junit.Test; import java.util.List; import java.util.stream.Collectors; -import java.util.stream.Stream; import static java.util.stream.Collectors.joining; import static org.junit.Assert.assertEquals; @@ -53,9 +51,9 @@ public class IndexingModeChangeValidatorTest { List<ConfigChangeAction> changeActions = tester.deploy(oldModel, getServices("streaming"), Environment.prod, validationOverrides).getSecond(); - assertReindexingChange(true, // allowed=true due to validation override - "Document type 'music' in cluster 'default' changed indexing mode from 'indexed' to 'streaming'", - changeActions); + assertReindexingChange( // allowed=true due to validation override + "Document type 'music' in cluster 'default' changed indexing mode from 'indexed' to 'streaming'", + changeActions); } @Test @@ -67,17 +65,16 @@ public class IndexingModeChangeValidatorTest { List<ConfigChangeAction> changeActions = tester.deploy(oldModel, getServices("store-only"), Environment.prod, validationOverrides).getSecond(); - assertReindexingChange(true, // allowed=true due to validation override - "Document type 'music' in cluster 'default' changed indexing mode from 'indexed' to 'store-only'", - changeActions); + assertReindexingChange( // allowed=true due to validation override + "Document type 'music' in cluster 'default' changed indexing mode from 'indexed' to 'store-only'", + changeActions); } - private void assertReindexingChange(boolean allowed, String message, List<ConfigChangeAction> changeActions) { + private void assertReindexingChange(String message, List<ConfigChangeAction> changeActions) { List<ConfigChangeAction> reindexingActions = changeActions.stream() .filter(a -> a instanceof ConfigChangeReindexAction) .collect(Collectors.toList()); assertEquals(1, reindexingActions.size()); - assertEquals(allowed, reindexingActions.get(0).allowed()); assertTrue(reindexingActions.get(0) instanceof ConfigChangeReindexAction); assertEquals("indexing-mode-change", ((ConfigChangeReindexAction)reindexingActions.get(0)).name()); assertEquals(message, reindexingActions.get(0).getMessage()); diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidatorTest.java index ed9603e9f35..18aac032fe7 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidatorTest.java @@ -166,9 +166,8 @@ public class StreamingSearchClusterChangeValidatorTest { private static VespaConfigChangeAction createFieldTypeChangeRefeedAction(String docType, List<ServiceInfo> service) { return ConfigChangeTestUtils.newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, - ValidationOverrides.empty, - "Document type '" + docType + "': Field 'f1' changed: data type: 'string' -> 'int'", - service, docType, Instant.now()); + "Document type '" + docType + "': Field 'f1' changed: data type: 'string' -> 'int'", + service, docType); } private static VespaConfigChangeAction createAddFastAccessRestartAction() { 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 0efa0a3f4d0..1f64d41e371 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 @@ -48,6 +48,7 @@ public class DocumentDatabaseChangeValidatorTest { "field f2 type string { indexing: index | summary } " + "field f3 type string { indexing: summary } " + "field f4 type array<s> { struct-field s1 { indexing: attribute } }"); + Instant.now(); f.assertValidation(Arrays.asList( newRestartAction(ClusterSpec.Id.from("test"), "Field 'f1' changed: add attribute aspect"), @@ -55,13 +56,9 @@ public class DocumentDatabaseChangeValidatorTest { "Field 'f4.s1' changed: add attribute aspect"), newReindexAction(ClusterSpec.Id.from("test"), ValidationId.indexingChange, - ValidationOverrides.empty, - "Field 'f2' changed: add index aspect, indexing script: '{ input f2 | summary f2; }' -> " + - "'{ input f2 | tokenize normalize stem:\"BEST\" | index f2 | summary f2; }'", Instant.now()), - newRefeedAction(ClusterSpec.Id.from("test"), - ValidationId.fieldTypeChange, - ValidationOverrides.empty, - "Field 'f3' changed: data type: 'int' -> 'string'", Instant.now()))); + "Field 'f2' changed: add index aspect, indexing script: '{ input f2 | summary f2; }' -> " + + "'{ input f2 | tokenize normalize stem:\"BEST\" | index f2 | summary f2; }'"), + newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f3' changed: data type: 'int' -> 'string'"))); } @Test diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java index 91c5dddf655..8ee2a924503 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java @@ -9,7 +9,6 @@ import com.yahoo.document.ReferenceDataType; import com.yahoo.document.StructDataType; import com.yahoo.documentmodel.NewDocumentType; import com.yahoo.searchdefinition.FieldSets; -import com.yahoo.config.application.api.ValidationOverrides; import com.yahoo.vespa.model.application.validation.change.VespaConfigChangeAction; import com.yahoo.vespa.model.application.validation.change.VespaRefeedAction; import org.junit.Test; @@ -43,7 +42,7 @@ public class DocumentTypeChangeValidatorTest { @Override public List<VespaConfigChangeAction> validate() { - return validator.validate(ValidationOverrides.empty, Instant.now()); + return validator.validate(); } } @@ -66,21 +65,16 @@ public class DocumentTypeChangeValidatorTest { public void requireThatDataTypeChangeIsNotOK() throws Exception { Fixture f = new Fixture("field f1 type string { indexing: summary }", "field f1 type int { indexing: summary }"); - f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), - ValidationId.fieldTypeChange, - ValidationOverrides.empty, - "Field 'f1' changed: data type: 'string' -> 'int'", - Instant.now())); + Instant.now(); + f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f1' changed: data type: 'string' -> 'int'")); } @Test public void requireThatAddingCollectionTypeIsNotOK() throws Exception { Fixture f = new Fixture("field f1 type string { indexing: summary }", "field f1 type array<string> { indexing: summary }"); - f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), - ValidationId.fieldTypeChange, - ValidationOverrides.empty, - "Field 'f1' changed: data type: 'string' -> 'Array<string>'", Instant.now())); + Instant.now(); + f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f1' changed: data type: 'string' -> 'Array<string>'")); } @@ -95,34 +89,26 @@ public class DocumentTypeChangeValidatorTest { public void requireThatNestedDataTypeChangeIsNotOK() throws Exception { Fixture f = new Fixture("field f1 type array<string> { indexing: summary }", "field f1 type array<int> { indexing: summary }"); - f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), - ValidationId.fieldTypeChange, - ValidationOverrides.empty, - "Field 'f1' changed: data type: 'Array<string>' -> 'Array<int>'", Instant.now())); + Instant.now(); + f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f1' changed: data type: 'Array<string>' -> 'Array<int>'")); } @Test public void requireThatChangedCollectionTypeIsNotOK() throws Exception { Fixture f = new Fixture("field f1 type array<string> { indexing: summary }", "field f1 type weightedset<string> { indexing: summary }"); - f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), - ValidationId.fieldTypeChange, - ValidationOverrides.empty, - "Field 'f1' changed: data type: 'Array<string>' -> 'WeightedSet<string>'", Instant.now())); + Instant.now(); + f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f1' changed: data type: 'Array<string>' -> 'WeightedSet<string>'")); } @Test public void requireThatMultipleDataTypeChangesIsNotOK() throws Exception { Fixture f = new Fixture("field f1 type string { indexing: summary } field f2 type int { indexing: summary }" , "field f2 type string { indexing: summary } field f1 type int { indexing: summary }"); - f.assertValidation(Arrays.asList(newRefeedAction(ClusterSpec.Id.from("test"), - ValidationId.fieldTypeChange, - ValidationOverrides.empty, - "Field 'f1' changed: data type: 'string' -> 'int'", Instant.now()), - newRefeedAction(ClusterSpec.Id.from("test"), - ValidationId.fieldTypeChange, - ValidationOverrides.empty, - "Field 'f2' changed: data type: 'int' -> 'string'", Instant.now()))); + Instant.now(); + Instant.now(); + f.assertValidation(Arrays.asList(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f1' changed: data type: 'string' -> 'int'"), + newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f2' changed: data type: 'int' -> 'string'"))); } @Test @@ -157,40 +143,32 @@ public class DocumentTypeChangeValidatorTest { public void requireThatDataTypeChangeInStructFieldIsNotOK() throws Exception { Fixture f = new Fixture("struct s1 { field f1 type string {} } field f2 type s1 { indexing: summary }", "struct s1 { field f1 type int {} } field f2 type s1 { indexing: summary }"); - f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), - ValidationId.fieldTypeChange, - ValidationOverrides.empty, - "Field 'f2' changed: data type: 's1:{f1:string}' -> 's1:{f1:int}'", Instant.now())); + Instant.now(); + f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f2' changed: data type: 's1:{f1:string}' -> 's1:{f1:int}'")); } @Test public void requireThatNestedDataTypeChangeInStructFieldIsNotOK() throws Exception { Fixture f = new Fixture("struct s1 { field f1 type array<string> {} } field f2 type s1 { indexing: summary }", "struct s1 { field f1 type array<int> {} } field f2 type s1 { indexing: summary }"); - f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), - ValidationId.fieldTypeChange, - ValidationOverrides.empty, - "Field 'f2' changed: data type: 's1:{f1:Array<string>}' -> 's1:{f1:Array<int>}'", Instant.now())); + Instant.now(); + f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f2' changed: data type: 's1:{f1:Array<string>}' -> 's1:{f1:Array<int>}'")); } @Test public void requireThatDataTypeChangeInNestedStructFieldIsNotOK() throws Exception { Fixture f = new Fixture("struct s1 { field f1 type string {} } struct s2 { field f2 type s1 {} } field f3 type s2 { indexing: summary }", "struct s1 { field f1 type int {} } struct s2 { field f2 type s1 {} } field f3 type s2 { indexing: summary }"); - f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), - ValidationId.fieldTypeChange, - ValidationOverrides.empty, - "Field 'f3' changed: data type: 's2:{s1:{f1:string}}' -> 's2:{s1:{f1:int}}'", Instant.now())); + Instant.now(); + f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f3' changed: data type: 's2:{s1:{f1:string}}' -> 's2:{s1:{f1:int}}'")); } @Test public void requireThatMultipleDataTypeChangesInStructFieldIsNotOK() throws Exception { Fixture f = new Fixture("struct s1 { field f1 type string {} field f2 type int {} } field f3 type s1 { indexing: summary }", "struct s1 { field f1 type int {} field f2 type string {} } field f3 type s1 { indexing: summary }"); - f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), - ValidationId.fieldTypeChange, - ValidationOverrides.empty, - "Field 'f3' changed: data type: 's1:{f1:string,f2:int}' -> 's1:{f1:int,f2:string}'", Instant.now())); + Instant.now(); + f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f3' changed: data type: 's1:{f1:string,f2:int}' -> 's1:{f1:int,f2:string}'")); } @Test @@ -198,7 +176,7 @@ public class DocumentTypeChangeValidatorTest { var validator = new DocumentTypeChangeValidator(ClusterSpec.Id.from("test"), createDocumentTypeWithReferenceField("oldDoc"), createDocumentTypeWithReferenceField("newDoc")); - List<VespaConfigChangeAction> result = validator.validate(ValidationOverrides.empty, Instant.now()); + List<VespaConfigChangeAction> result = validator.validate(); assertEquals(1, result.size()); VespaConfigChangeAction action = result.get(0); assertTrue(action instanceof VespaRefeedAction); @@ -211,21 +189,17 @@ public class DocumentTypeChangeValidatorTest { @Test public void changing_tensor_type_of_tensor_field_requires_refeed() throws Exception { + Instant.now(); new Fixture( "field f1 type tensor(x[2]) { indexing: attribute }", "field f1 type tensor(x[3]) { indexing: attribute }") - .assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), - ValidationId.fieldTypeChange, - ValidationOverrides.empty, - "Field 'f1' changed: data type: 'tensor(x[2])' -> 'tensor(x[3])'", Instant.now())); + .assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f1' changed: data type: 'tensor(x[2])' -> 'tensor(x[3])'")); + Instant.now(); new Fixture( "field f1 type tensor(x[5]) { indexing: attribute }", "field f1 type tensor(x[3]) { indexing: attribute }") - .assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), - ValidationId.fieldTypeChange, - ValidationOverrides.empty, - "Field 'f1' changed: data type: 'tensor(x[5])' -> 'tensor(x[3])'", Instant.now())); + .assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f1' changed: data type: 'tensor(x[5])' -> 'tensor(x[3])'")); } private static NewDocumentType createDocumentTypeWithReferenceField(String nameReferencedDocumentType) { diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidatorTest.java index 574558d9d12..2e1ec53f886 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidatorTest.java @@ -58,11 +58,9 @@ public class IndexingScriptChangeValidatorTest { private static VespaConfigChangeAction expectedReindexingAction(String field, String changedMsg, String fromScript, String toScript) { return VespaReindexAction.of(ClusterSpec.Id.from("test"), ValidationId.indexingChange, - ValidationOverrides.empty, - "Field '" + field + "' changed: " + + "Field '" + field + "' changed: " + (changedMsg.isEmpty() ? "" : changedMsg + ", ") + - "indexing script: '" + fromScript + "' -> '" + toScript + "'", - Instant.now()); + "indexing script: '" + fromScript + "' -> '" + toScript + "'"); } @Test 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 04efffab438..0bc4ecbfdfd 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 @@ -36,7 +36,7 @@ public class StructFieldAttributeChangeValidatorTestCase { public List<VespaConfigChangeAction> validate() { List<VespaConfigChangeAction> result = new ArrayList<>(); result.addAll(structFieldAttributeValidator.validate(ValidationOverrides.empty, Instant.now())); - result.addAll(docTypeValidator.validate(ValidationOverrides.empty, Instant.now())); + result.addAll(docTypeValidator.validate()); return result; } } diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java index b53447a1fd2..6cc05a0f69e 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java @@ -1009,21 +1009,19 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye RestartActions restartActions = actions.getRestartActions(); if ( ! restartActions.isEmpty()) { logger.log(Level.WARNING, "Change(s) between active and new application that require restart:\n" + - restartActions.format()); + restartActions.format()); } RefeedActions refeedActions = actions.getRefeedActions(); if ( ! refeedActions.isEmpty()) { - boolean allAllowed = refeedActions.getEntries().stream().allMatch(RefeedActions.Entry::allowed); - logger.log(allAllowed ? Level.INFO : Level.WARNING, + logger.log(Level.WARNING, "Change(s) between active and new application that may require re-feed:\n" + - refeedActions.format()); + refeedActions.format()); } ReindexActions reindexActions = actions.getReindexActions(); if ( ! reindexActions.isEmpty()) { - boolean allAllowed = reindexActions.getEntries().stream().allMatch(ReindexActions.Entry::allowed); - logger.log(allAllowed ? Level.INFO : Level.WARNING, - "Change(s) between active and new application that may require re-index:\n" + - reindexActions.format()); + logger.log(Level.WARNING, + "Change(s) between active and new application that may require re-index:\n" + + reindexActions.format()); } } diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/ConfigChangeActionsSlimeConverter.java b/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/ConfigChangeActionsSlimeConverter.java index ec48b671a5b..1a0d109b6c9 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/ConfigChangeActionsSlimeConverter.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/ConfigChangeActionsSlimeConverter.java @@ -42,7 +42,6 @@ public class ConfigChangeActionsSlimeConverter { for (RefeedActions.Entry entry : actions.getRefeedActions().getEntries()) { Cursor entryCursor = refeedCursor.addObject(); entryCursor.setString("name", entry.name()); - entryCursor.setBool("allowed", entry.allowed()); entryCursor.setString("documentType", entry.getDocumentType()); entryCursor.setString("clusterName", entry.getClusterName()); messagesToSlime(entryCursor, entry.getMessages()); @@ -55,7 +54,6 @@ public class ConfigChangeActionsSlimeConverter { for (ReindexActions.Entry entry : actions.getReindexActions().getEntries()) { Cursor entryCursor = refeedCursor.addObject(); entryCursor.setString("name", entry.name()); - entryCursor.setBool("allowed", entry.allowed()); entryCursor.setString("documentType", entry.getDocumentType()); entryCursor.setString("clusterName", entry.getClusterName()); messagesToSlime(entryCursor, entry.getMessages()); diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/RefeedActions.java b/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/RefeedActions.java index c20b8527f2e..b2221cbcf6c 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/RefeedActions.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/RefeedActions.java @@ -5,7 +5,13 @@ import com.yahoo.config.model.api.ConfigChangeAction; import com.yahoo.config.model.api.ConfigChangeRefeedAction; import com.yahoo.config.model.api.ServiceInfo; -import java.util.*; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; /** * Represents all actions to re-feed document types in order to handle config changes. @@ -17,15 +23,13 @@ public class RefeedActions { public static class Entry { private final String name; - private final boolean allowed; private final String documentType; private final String clusterName; private final Set<ServiceInfo> services = new LinkedHashSet<>(); private final Set<String> messages = new TreeSet<>(); - private Entry(String name, boolean allowed, String documentType, String clusterName) { + private Entry(String name, String documentType, String clusterName) { this.name = name; - this.allowed = allowed; this.documentType = documentType; this.clusterName = clusterName; } @@ -42,8 +46,6 @@ public class RefeedActions { public String name() { return name; } - public boolean allowed() { return allowed; } - public String getDocumentType() { return documentType; } public String getClusterName() { return clusterName; } @@ -54,12 +56,12 @@ public class RefeedActions { } - private Entry addEntry(String name, boolean allowed, String documentType, ServiceInfo service) { + private Entry addEntry(String name, String documentType, ServiceInfo service) { String clusterName = service.getProperty("clustername").orElse(""); - String entryId = name + "." + allowed + "." + clusterName + "." + documentType; + String entryId = name + "." + "." + clusterName + "." + documentType; Entry entry = actions.get(entryId); if (entry == null) { - entry = new Entry(name, allowed, documentType, clusterName); + entry = new Entry(name, documentType, clusterName); actions.put(entryId, entry); } return entry; @@ -75,7 +77,7 @@ public class RefeedActions { if (action.getType().equals(ConfigChangeAction.Type.REFEED)) { ConfigChangeRefeedAction refeedAction = (ConfigChangeRefeedAction) action; for (ServiceInfo service : refeedAction.getServices()) { - addEntry(refeedAction.name(), refeedAction.allowed(), refeedAction.getDocumentType(), service). + addEntry(refeedAction.name(), refeedAction.getDocumentType(), service). addService(service). addMessage(action.getMessage()); } diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/RefeedActionsFormatter.java b/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/RefeedActionsFormatter.java index 425276cebd6..6e2e23ab6be 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/RefeedActionsFormatter.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/RefeedActionsFormatter.java @@ -18,8 +18,6 @@ public class RefeedActionsFormatter { public String format() { StringBuilder builder = new StringBuilder(); for (RefeedActions.Entry entry : actions.getEntries()) { - if (entry.allowed()) - builder.append("(allowed) "); builder.append(entry.name() + ": Consider removing data and re-feed document type '" + entry.getDocumentType() + "' in cluster '" + entry.getClusterName() + "' because:\n"); int counter = 1; diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/ReindexActions.java b/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/ReindexActions.java index e328f9595b7..6ed1c43623f 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/ReindexActions.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/ReindexActions.java @@ -27,7 +27,7 @@ public class ReindexActions { if (action.getType().equals(ConfigChangeAction.Type.REINDEX)) { ConfigChangeReindexAction reindexChange = (ConfigChangeReindexAction) action; for (ServiceInfo service : reindexChange.getServices()) { - addEntry(reindexChange.name(), reindexChange.allowed(), reindexChange.getDocumentType(), service). + addEntry(reindexChange.name(), reindexChange.getDocumentType(), service). addService(service). addMessage(action.getMessage()); } @@ -35,12 +35,12 @@ public class ReindexActions { } } - private Entry addEntry(String name, boolean allowed, String documentType, ServiceInfo service) { + private Entry addEntry(String name, String documentType, ServiceInfo service) { String clusterName = service.getProperty("clustername").orElse(""); - String entryId = name + "." + allowed + "." + clusterName + "." + documentType; + String entryId = name + "." + "." + clusterName + "." + documentType; Entry entry = actions.get(entryId); if (entry == null) { - entry = new Entry(name, allowed, documentType, clusterName); + entry = new Entry(name, documentType, clusterName); actions.put(entryId, entry); } return entry; @@ -53,15 +53,13 @@ public class ReindexActions { public static class Entry { private final String name; - private final boolean allowed; private final String documentType; private final String clusterName; private final Set<ServiceInfo> services = new LinkedHashSet<>(); private final Set<String> messages = new TreeSet<>(); - private Entry(String name, boolean allowed, String documentType, String clusterName) { + private Entry(String name, String documentType, String clusterName) { this.name = name; - this.allowed = allowed; this.documentType = documentType; this.clusterName = clusterName; } @@ -77,7 +75,6 @@ public class ReindexActions { } public String name() { return name; } - public boolean allowed() { return allowed; } public String getDocumentType() { return documentType; } public String getClusterName() { return clusterName; } public Set<ServiceInfo> getServices() { return services; } diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/ReindexActionsFormatter.java b/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/ReindexActionsFormatter.java index e89bfd522cd..bdd01404f64 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/ReindexActionsFormatter.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/configchange/ReindexActionsFormatter.java @@ -17,8 +17,6 @@ class ReindexActionsFormatter { String format() { StringBuilder builder = new StringBuilder(); for (ReindexActions.Entry entry : actions.getEntries()) { - if (entry.allowed()) - builder.append("(allowed) "); builder.append(entry.name() + ": Consider re-indexing document type '" + entry.getDocumentType() + "' in cluster '" + entry.getClusterName() + "' because:\n"); int counter = 1; diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/ConfigChangeActionsBuilder.java b/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/ConfigChangeActionsBuilder.java index 9724e92e34c..876b169742f 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/ConfigChangeActionsBuilder.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/ConfigChangeActionsBuilder.java @@ -16,7 +16,6 @@ import java.util.List; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; /** * @author geirst @@ -44,20 +43,16 @@ public class ConfigChangeActionsBuilder { } - ConfigChangeActionsBuilder refeed(ValidationId validationId, boolean allowed, String message, String documentType, String clusterName, String serviceName) { + ConfigChangeActionsBuilder refeed(ValidationId validationId, String message, String documentType, String clusterName, String serviceName) { actions.add(new MockRefeedAction(validationId, - allowed, message, List.of(createService(clusterName, "myclustertype", "myservicetype", serviceName)), documentType)); return this; } - ConfigChangeActionsBuilder reindex(ValidationId validationId, boolean allowed, String message, String documentType, String clusterName, String serviceName) { + ConfigChangeActionsBuilder reindex(ValidationId validationId, String message, String documentType, String clusterName, String serviceName) { List<ServiceInfo> services = List.of(createService(clusterName, "myclustertype", "myservicetype", serviceName)); - ValidationOverrides overrides = mock(ValidationOverrides.class); - when(overrides.allows((String) any(), any())).thenReturn(allowed); - when(overrides.allows((ValidationId) any(), any())).thenReturn(allowed); - actions.add(VespaReindexAction.of(ClusterSpec.Id.from(clusterName), validationId, overrides, message, services, documentType, Instant.now())); + actions.add(VespaReindexAction.of(ClusterSpec.Id.from(clusterName), validationId, message, services, documentType)); return this; } diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/ConfigChangeActionsSlimeConverterTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/ConfigChangeActionsSlimeConverterTest.java index 33e60a4ce39..d75f95d4c48 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/ConfigChangeActionsSlimeConverterTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/ConfigChangeActionsSlimeConverterTest.java @@ -89,8 +89,8 @@ public class ConfigChangeActionsSlimeConverterTest { @Test public void json_representation_of_refeed_actions() throws IOException { ConfigChangeActions actions = new ConfigChangeActionsBuilder(). - refeed(CHANGE_ID, true, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_TYPE). - refeed(CHANGE_ID_2, false, CHANGE_MSG, DOC_TYPE_2, CLUSTER, SERVICE_TYPE).build(); + refeed(CHANGE_ID, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_TYPE). + refeed(CHANGE_ID_2, CHANGE_MSG, DOC_TYPE_2, CLUSTER, SERVICE_TYPE).build(); assertEquals("{\n" + " \"configChangeActions\": {\n" + " \"restart\": [\n" + @@ -98,7 +98,6 @@ public class ConfigChangeActionsSlimeConverterTest { " \"refeed\": [\n" + " {\n" + " \"name\": \"field-type-change\",\n" + - " \"allowed\": true,\n" + " \"documentType\": \"music\",\n" + " \"clusterName\": \"foo\",\n" + " \"messages\": [\n" + @@ -115,7 +114,6 @@ public class ConfigChangeActionsSlimeConverterTest { " },\n" + " {\n" + " \"name\": \"indexing-change\",\n" + - " \"allowed\": false,\n" + " \"documentType\": \"book\",\n" + " \"clusterName\": \"foo\",\n" + " \"messages\": [\n" + @@ -141,7 +139,7 @@ public class ConfigChangeActionsSlimeConverterTest { @Test public void json_representation_of_reindex_actions() throws IOException { ConfigChangeActions actions = new ConfigChangeActionsBuilder(). - reindex(CHANGE_ID, true, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_TYPE).build(); + reindex(CHANGE_ID, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_TYPE).build(); assertEquals( "{\n" + " \"configChangeActions\": {\n" + @@ -152,7 +150,6 @@ public class ConfigChangeActionsSlimeConverterTest { " \"reindex\": [\n" + " {\n" + " \"name\": \"field-type-change\",\n" + - " \"allowed\": true,\n" + " \"documentType\": \"music\",\n" + " \"clusterName\": \"foo\",\n" + " \"messages\": [\n" + diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/MockRefeedAction.java b/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/MockRefeedAction.java index a17138d8693..615d4c86c1d 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/MockRefeedAction.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/MockRefeedAction.java @@ -4,6 +4,7 @@ package com.yahoo.vespa.config.server.configchange; import com.yahoo.config.application.api.ValidationId; import com.yahoo.config.model.api.ConfigChangeRefeedAction; import com.yahoo.config.model.api.ServiceInfo; +import com.yahoo.config.provision.ClusterSpec; import java.util.List; import java.util.Optional; @@ -14,13 +15,11 @@ import java.util.Optional; public class MockRefeedAction extends MockConfigChangeAction implements ConfigChangeRefeedAction { private final ValidationId validationId; - private final boolean allowed; private final String documentType; - public MockRefeedAction(ValidationId validationId, boolean allowed, String message, List<ServiceInfo> services, String documentType) { + public MockRefeedAction(ValidationId validationId, String message, List<ServiceInfo> services, String documentType) { super(message, services); this.validationId = validationId; - this.allowed = allowed; this.documentType = documentType; } @@ -28,7 +27,9 @@ public class MockRefeedAction extends MockConfigChangeAction implements ConfigCh public Optional<ValidationId> validationId() { return Optional.of(validationId); } @Override - public boolean allowed() { return allowed; } + public ClusterSpec.Id clusterId() { + return null; + } @Override public boolean ignoreForInternalRedeploy() { diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/RefeedActionsFormatterTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/RefeedActionsFormatterTest.java index 246d4b88163..4b898b501ec 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/RefeedActionsFormatterTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/RefeedActionsFormatterTest.java @@ -15,7 +15,7 @@ public class RefeedActionsFormatterTest { @Test public void formatting_of_single_action() { RefeedActions actions = new ConfigChangeActionsBuilder(). - refeed(CHANGE_ID, false, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). + refeed(CHANGE_ID, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). build().getRefeedActions(); assertEquals("field-type-change: Consider removing data and re-feed document type 'music' in cluster 'foo' because:\n" + " 1) change\n", @@ -25,11 +25,11 @@ public class RefeedActionsFormatterTest { @Test public void formatting_of_multiple_actions() { RefeedActions actions = new ConfigChangeActionsBuilder(). - refeed(CHANGE_ID, false, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). - refeed(CHANGE_ID, false, CHANGE_MSG_2, DOC_TYPE, CLUSTER, SERVICE_NAME). - refeed(CHANGE_ID_2, false, CHANGE_MSG_2, DOC_TYPE, CLUSTER, SERVICE_NAME). - refeed(CHANGE_ID_2, true, CHANGE_MSG_2, DOC_TYPE, CLUSTER, SERVICE_NAME). - refeed(CHANGE_ID, false, CHANGE_MSG_2, DOC_TYPE_2, CLUSTER, SERVICE_NAME). + refeed(CHANGE_ID, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). + refeed(CHANGE_ID, CHANGE_MSG_2, DOC_TYPE, CLUSTER, SERVICE_NAME). + refeed(CHANGE_ID_2, CHANGE_MSG_2, DOC_TYPE, CLUSTER, SERVICE_NAME). + refeed(CHANGE_ID_2, CHANGE_MSG_2, DOC_TYPE, CLUSTER, SERVICE_NAME). + refeed(CHANGE_ID, CHANGE_MSG_2, DOC_TYPE_2, CLUSTER, SERVICE_NAME). build().getRefeedActions(); assertEquals("field-type-change: Consider removing data and re-feed document type 'book' in cluster 'foo' because:\n" + " 1) other change\n" + @@ -37,8 +37,6 @@ public class RefeedActionsFormatterTest { " 1) change\n" + " 2) other change\n" + "indexing-change: Consider removing data and re-feed document type 'music' in cluster 'foo' because:\n" + - " 1) other change\n" + - "(allowed) indexing-change: Consider removing data and re-feed document type 'music' in cluster 'foo' because:\n" + " 1) other change\n", new RefeedActionsFormatter(actions).format()); } diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/RefeedActionsTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/RefeedActionsTest.java index befb2c06106..24e81dc3f99 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/RefeedActionsTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/RefeedActionsTest.java @@ -33,8 +33,8 @@ public class RefeedActionsTest { @Test public void action_with_multiple_reasons() { List<RefeedActions.Entry> entries = new ConfigChangeActionsBuilder(). - refeed(ValidationId.indexModeChange, false, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). - refeed(ValidationId.indexModeChange, false, CHANGE_MSG_2, DOC_TYPE, CLUSTER, SERVICE_NAME). + refeed(ValidationId.indexModeChange, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). + refeed(ValidationId.indexModeChange, CHANGE_MSG_2, DOC_TYPE, CLUSTER, SERVICE_NAME). build().getRefeedActions().getEntries(); assertThat(entries.size(), is(1)); assertThat(toString(entries.get(0)), equalTo("music.foo:[baz][change,other change]")); @@ -43,8 +43,8 @@ public class RefeedActionsTest { @Test public void actions_with_multiple_services() { List<RefeedActions.Entry> entries = new ConfigChangeActionsBuilder(). - refeed(ValidationId.indexModeChange, false, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). - refeed(ValidationId.indexModeChange, false, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME_2). + refeed(ValidationId.indexModeChange, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). + refeed(ValidationId.indexModeChange, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME_2). build().getRefeedActions().getEntries(); assertThat(entries.size(), is(1)); assertThat(toString(entries.get(0)), equalTo("music.foo:[baz,qux][change]")); @@ -53,8 +53,8 @@ public class RefeedActionsTest { @Test public void actions_with_multiple_document_types() { List<RefeedActions.Entry> entries = new ConfigChangeActionsBuilder(). - refeed(ValidationId.indexModeChange, false, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). - refeed(ValidationId.indexModeChange, false, CHANGE_MSG, DOC_TYPE_2, CLUSTER, SERVICE_NAME). + refeed(ValidationId.indexModeChange, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). + refeed(ValidationId.indexModeChange, CHANGE_MSG, DOC_TYPE_2, CLUSTER, SERVICE_NAME). build().getRefeedActions().getEntries(); assertThat(entries.size(), is(2)); assertThat(toString(entries.get(0)), equalTo("book.foo:[baz][change]")); @@ -64,8 +64,8 @@ public class RefeedActionsTest { @Test public void actions_with_multiple_clusters() { List<RefeedActions.Entry> entries = new ConfigChangeActionsBuilder(). - refeed(ValidationId.indexModeChange, false, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). - refeed(ValidationId.indexModeChange, false, CHANGE_MSG, DOC_TYPE, CLUSTER_2, SERVICE_NAME). + refeed(ValidationId.indexModeChange, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). + refeed(ValidationId.indexModeChange, CHANGE_MSG, DOC_TYPE, CLUSTER_2, SERVICE_NAME). build().getRefeedActions().getEntries(); assertThat(entries.size(), is(2)); assertThat(toString(entries.get(0)), equalTo("music.bar:[baz][change]")); diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/ReindexActionsFormatterTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/ReindexActionsFormatterTest.java index 6650b9c523d..b07d002a431 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/ReindexActionsFormatterTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/configchange/ReindexActionsFormatterTest.java @@ -21,7 +21,7 @@ public class ReindexActionsFormatterTest { @Test public void formatting_of_single_action() { ReindexActions actions = new ConfigChangeActionsBuilder(). - reindex(CHANGE_ID, false, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). + reindex(CHANGE_ID, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). build().getReindexActions(); assertEquals("field-type-change: Consider re-indexing document type 'music' in cluster 'foo' because:\n" + " 1) change\n", @@ -31,11 +31,11 @@ public class ReindexActionsFormatterTest { @Test public void formatting_of_multiple_actions() { ReindexActions actions = new ConfigChangeActionsBuilder(). - reindex(CHANGE_ID, false, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). - reindex(CHANGE_ID, false, CHANGE_MSG_2, DOC_TYPE, CLUSTER, SERVICE_NAME). - reindex(CHANGE_ID_2, false, CHANGE_MSG_2, DOC_TYPE, CLUSTER, SERVICE_NAME). - reindex(CHANGE_ID_2, true, CHANGE_MSG_2, DOC_TYPE, CLUSTER, SERVICE_NAME). - reindex(CHANGE_ID, false, CHANGE_MSG_2, DOC_TYPE_2, CLUSTER, SERVICE_NAME). + reindex(CHANGE_ID, CHANGE_MSG, DOC_TYPE, CLUSTER, SERVICE_NAME). + reindex(CHANGE_ID, CHANGE_MSG_2, DOC_TYPE, CLUSTER, SERVICE_NAME). + reindex(CHANGE_ID_2, CHANGE_MSG_2, DOC_TYPE, CLUSTER, SERVICE_NAME). + reindex(CHANGE_ID_2, CHANGE_MSG_2, DOC_TYPE, CLUSTER, SERVICE_NAME). + reindex(CHANGE_ID, CHANGE_MSG_2, DOC_TYPE_2, CLUSTER, SERVICE_NAME). build().getReindexActions(); assertEquals("field-type-change: Consider re-indexing document type 'book' in cluster 'foo' because:\n" + " 1) other change\n" + @@ -43,8 +43,6 @@ public class ReindexActionsFormatterTest { " 1) change\n" + " 2) other change\n" + "indexing-change: Consider re-indexing document type 'music' in cluster 'foo' because:\n" + - " 1) other change\n" + - "(allowed) indexing-change: Consider re-indexing document type 'music' in cluster 'foo' because:\n" + " 1) other change\n", new ReindexActionsFormatter(actions).format()); } diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java index f7d1b37dcc5..341fa7109da 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java @@ -4,7 +4,6 @@ package com.yahoo.vespa.config.server.deploy; import com.yahoo.cloud.config.ConfigserverConfig; import com.yahoo.component.Version; import com.yahoo.config.application.api.ValidationId; -import com.yahoo.config.application.api.ValidationOverrides; import com.yahoo.config.model.api.ConfigChangeAction; import com.yahoo.config.model.api.ModelContext; import com.yahoo.config.model.api.ModelCreateResult; @@ -27,7 +26,6 @@ import com.yahoo.vespa.config.server.http.InvalidApplicationException; import com.yahoo.vespa.config.server.http.v2.PrepareResult; import com.yahoo.vespa.config.server.model.TestModelFactory; import com.yahoo.vespa.config.server.session.PrepareParams; -import com.yahoo.vespa.config.server.session.Session; import com.yahoo.vespa.model.application.validation.change.VespaReindexAction; import com.yahoo.vespa.model.application.validation.change.VespaRestartAction; import org.junit.Rule; @@ -404,8 +402,8 @@ public class HostedDeployTest { ManualClock clock = new ManualClock(Instant.EPOCH); List<ModelFactory> modelFactories = List.of( new ConfigChangeActionsModelFactory(Version.fromString("6.1.0"), - VespaReindexAction.of(ClusterSpec.Id.from("test"), ValidationId.indexModeChange, ValidationOverrides.all, - "reindex please", services, "music", clock.instant()), + VespaReindexAction.of(ClusterSpec.Id.from("test"), ValidationId.indexModeChange, + "reindex please", services, "music"), new VespaRestartAction(ClusterSpec.Id.from("test"), "change", services))); DeployTester tester = createTester(hosts, modelFactories, prodZone, clock); diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/configserverbindings/RefeedAction.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/configserverbindings/RefeedAction.java index faa2c39ee65..799bc814abe 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/configserverbindings/RefeedAction.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/configserverbindings/RefeedAction.java @@ -14,7 +14,6 @@ import java.util.List; public class RefeedAction { public final String name; - public final boolean allowed; public final String documentType; public final String clusterName; public final List<ServiceInfo> services; @@ -22,13 +21,11 @@ public class RefeedAction { @JsonCreator public RefeedAction(@JsonProperty("name") String name, - @JsonProperty("allowed") boolean allowed, @JsonProperty("documentType") String documentType, @JsonProperty("clusterName") String clusterName, @JsonProperty("services") List<ServiceInfo> services, @JsonProperty("messages") List<String> messages) { this.name = name; - this.allowed = allowed; this.documentType = documentType; this.clusterName = clusterName; this.services = services; @@ -39,7 +36,6 @@ public class RefeedAction { public String toString() { return "RefeedAction{" + "name='" + name + '\'' + - ", allowed=" + allowed + ", documentType='" + documentType + '\'' + ", clusterName='" + clusterName + '\'' + ", services=" + services + diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/configserverbindings/ReindexAction.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/configserverbindings/ReindexAction.java index c5735fbd4a6..c2b28a94c66 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/configserverbindings/ReindexAction.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/configserverbindings/ReindexAction.java @@ -14,7 +14,6 @@ import java.util.List; public class ReindexAction { public final String name; - public final boolean allowed; public final String documentType; public final String clusterName; public final List<ServiceInfo> services; @@ -22,13 +21,11 @@ public class ReindexAction { @JsonCreator public ReindexAction(@JsonProperty("name") String name, - @JsonProperty("allowed") boolean allowed, @JsonProperty("documentType") String documentType, @JsonProperty("clusterName") String clusterName, @JsonProperty("services") List<ServiceInfo> services, @JsonProperty("messages") List<String> messages) { this.name = name; - this.allowed = allowed; this.documentType = documentType; this.clusterName = clusterName; this.services = services; @@ -39,7 +36,6 @@ public class ReindexAction { public String toString() { return "ReindexAction{" + "name='" + name + '\'' + - ", allowed=" + allowed + ", documentType='" + documentType + '\'' + ", clusterName='" + clusterName + '\'' + ", services=" + services + diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/PrepareResponse.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/PrepareResponse.java index 6054e05149b..5c946538625 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/PrepareResponse.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/PrepareResponse.java @@ -15,7 +15,6 @@ import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) public class PrepareResponse { public TenantId tenant; - @JsonProperty("activate") public URI activationUri; public String message; public List<Log> log; public ConfigChangeActions configChangeActions; diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java index 9b959bf1765..ed1e442f266 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java @@ -219,43 +219,11 @@ public class InternalStepRunner implements StepRunner { LogEntry.typeOf(LogLevel.parse(entry.level)), entry.message)) .collect(toList())); - if ( ! prepareResponse.configChangeActions.refeedActions.stream().allMatch(action -> action.allowed)) { - List<String> messages = new ArrayList<>(); - messages.add("Deploy failed due to non-compatible changes that require re-feed."); - messages.add("Your options are:"); - messages.add("1. Revert the incompatible changes."); - messages.add("2. If you think it is safe in your case, you can override this validation, see"); - messages.add(" http://docs.vespa.ai/documentation/reference/validation-overrides.html"); - messages.add("3. Deploy as a new application under a different name."); - messages.add("Illegal actions:"); - prepareResponse.configChangeActions.refeedActions.stream() - .filter(action -> ! action.allowed) - .flatMap(action -> action.messages.stream()) - .forEach(messages::add); - logger.log(messages); - return Optional.of(deploymentFailed); - } - - if ( ! prepareResponse.configChangeActions.reindexActions.stream().allMatch(action -> action.allowed)) { - List<String> messages = new ArrayList<>(); - messages.add("Deploy failed due to non-compatible changes that require re-index."); - messages.add("Your options are:"); - messages.add("1. Revert the incompatible changes."); - messages.add("2. If you think it is safe in your case, you can override this validation, see"); - messages.add(" http://docs.vespa.ai/documentation/reference/validation-overrides.html"); - messages.add("3. Deploy as a new application under a different name."); - messages.add("Illegal actions:"); - prepareResponse.configChangeActions.reindexActions.stream() - .filter(action -> ! action.allowed) - .flatMap(action -> action.messages.stream()) - .forEach(messages::add); - logger.log(messages); - return Optional.of(deploymentFailed); - } logger.log("Deployment successful."); if (prepareResponse.message != null) logger.log(prepareResponse.message); + return Optional.of(running); } catch (ConfigServerException e) { diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java index 1c0dca26f5a..a68622eebb8 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java @@ -2054,7 +2054,6 @@ public class ApplicationApiHandler extends LoggingRequestHandler { for (RefeedAction refeedAction : result.prepareResponse().configChangeActions.refeedActions) { Cursor refeedActionObject = refeedActionsArray.addObject(); refeedActionObject.setString("name", refeedAction.name); - refeedActionObject.setBool("allowed", refeedAction.allowed); refeedActionObject.setString("documentType", refeedAction.documentType); refeedActionObject.setString("clusterName", refeedAction.clusterName); serviceInfosToSlime(refeedAction.services, refeedActionObject.setArray("services")); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java index 7b248052eac..d54971f5b1d 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java @@ -125,34 +125,7 @@ public class InternalStepRunnerTest { } @Test - public void reindexRequirementBlocksDeployment() { - tester.configServer().setConfigChangeActions(new ConfigChangeActions(List.of(), - List.of(), - List.of(new ReindexAction("Reindex", - false, - "doctype", - "cluster", - Collections.emptyList(), - List.of("Reindex it!"))))); - tester.jobs().deploy(app.instanceId(), JobType.devUsEast1, Optional.empty(), applicationPackage); - assertEquals(failed, tester.jobs().last(app.instanceId(), JobType.devUsEast1).get().stepStatuses().get(Step.deployReal)); - } - - @Test - public void refeedRequirementBlocksDeployment() { - tester.configServer().setConfigChangeActions(new ConfigChangeActions(List.of(), - List.of(new RefeedAction("Refeed", - false, - "doctype", - "cluster", - Collections.emptyList(), - singletonList("Refeed it!"))), - List.of())); - tester.jobs().deploy(app.instanceId(), JobType.devUsEast1, Optional.empty(), applicationPackage); - assertEquals(failed, tester.jobs().last(app.instanceId(), JobType.devUsEast1).get().stepStatuses().get(Step.deployReal)); - } - - @Test + // TODO jonmv: Change to only wait for restarts, and remove triggering of restarts from runner. public void restartsServicesAndWaitsForRestartAndReboot() { RunId id = app.newRun(JobType.productionUsCentral1); ZoneId zone = id.type().zone(system()); |