diff options
author | Geir Storli <geirst@verizonmedia.com> | 2020-07-02 17:02:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-02 17:02:26 +0200 |
commit | 5ea9ab0b823b7bf634f07e89ad900cefc301d1e2 (patch) | |
tree | ef660e19573d0a55666ff8d7abfc07515dc2e1da /config-model | |
parent | 12fbf5b3265de130d3374c239a19fe1cd9425e73 (diff) | |
parent | 6c765d0f5f2266171beec0c3df620c961fd79b0d (diff) |
Merge pull request #13785 from vespa-engine/toregge/require-restart-if-distance-metric-is-changed-without-hnsw-index-enabled
Require restart if distance metric is changed when hnsw index is not enabled.
Diffstat (limited to 'config-model')
2 files changed, 4 insertions, 3 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidator.java index 4f3e100ce75..5d790c74f18 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidator.java @@ -96,8 +96,8 @@ public class AttributeChangeValidator { validateAttributeSetting(currAttr, nextAttr, Attribute::densePostingListThreshold, "dense-posting-list-threshold", result); validateAttributeSetting(currAttr, nextAttr, Attribute::isEnabledOnlyBitVector, "rank: filter", result); validateAttributeSetting(currAttr, nextAttr, AttributeChangeValidator::hasHnswIndex, "indexing: index", result); + validateAttributeSetting(currAttr, nextAttr, Attribute::distanceMetric, "distance-metric", result); if (hasHnswIndex(currAttr) && hasHnswIndex(nextAttr)) { - validateAttributeSetting(currAttr, nextAttr, Attribute::distanceMetric, "distance-metric", result); validateAttributeHnswIndexSetting(currAttr, nextAttr, HnswIndexParams::maxLinksPerNode, "max-links-per-node", result); validateAttributeHnswIndexSetting(currAttr, nextAttr, HnswIndexParams::neighborsToExploreAtInsert, "neighbors-to-explore-at-insert", result); } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidatorTest.java index 5da36d82a62..e00b34d4a79 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidatorTest.java @@ -168,11 +168,12 @@ public class AttributeChangeValidatorTest { } @Test - public void changing_distance_metric_without_hnsw_index_enabled_is_ok() throws Exception { + public void changing_distance_metric_without_hnsw_index_enabled_requires_restart() throws Exception { new Fixture("field f1 type tensor(x[2]) { indexing: attribute }", "field f1 type tensor(x[2]) { indexing: attribute \n attribute { " + "distance-metric: geodegrees \n } }"). - assertValidation(); + assertValidation(newRestartAction("Field 'f1' changed: change property " + + "'distance-metric' from 'EUCLIDEAN' to 'GEODEGREES'")); } @Test |