diff options
Diffstat (limited to 'config-model')
19 files changed, 150 insertions, 52 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java index 1b35460523e..1bda8a509f1 100644 --- a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java +++ b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java @@ -87,6 +87,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea private List<DataplaneToken> dataplaneTokens; private int contentLayerMetadataFeatureLevel = 0; private boolean dynamicHeapSize = false; + private long mergingMaxMemoryUsagePerNode = -1; @Override public ModelContext.FeatureFlags featureFlags() { return this; } @Override public boolean multitenant() { return multitenant; } @@ -146,6 +147,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea @Override public List<DataplaneToken> dataplaneTokens() { return dataplaneTokens; } @Override public int contentLayerMetadataFeatureLevel() { return contentLayerMetadataFeatureLevel; } @Override public boolean dynamicHeapSize() { return dynamicHeapSize; } + @Override public long mergingMaxMemoryUsagePerNode() { return mergingMaxMemoryUsagePerNode; } public TestProperties sharedStringRepoNoReclaim(boolean sharedStringRepoNoReclaim) { this.sharedStringRepoNoReclaim = sharedStringRepoNoReclaim; @@ -383,6 +385,11 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea public TestProperties setDynamicHeapSize(boolean b) { this.dynamicHeapSize = b; return this; } + public TestProperties setMergingMaxMemoryUsagePerNode(long maxUsage) { + this.mergingMaxMemoryUsagePerNode = maxUsage; + return this; + } + public static class Spec implements ConfigServerSpec { private final String hostName; diff --git a/config-model/src/main/java/com/yahoo/schema/processing/AddExtraFieldsToDocument.java b/config-model/src/main/java/com/yahoo/schema/processing/AddExtraFieldsToDocument.java index 52652de81d4..67297245ff1 100644 --- a/config-model/src/main/java/com/yahoo/schema/processing/AddExtraFieldsToDocument.java +++ b/config-model/src/main/java/com/yahoo/schema/processing/AddExtraFieldsToDocument.java @@ -70,7 +70,7 @@ public class AddExtraFieldsToDocument extends Processor { } private void addSdField(Schema schema, SDDocumentType document, SDField field, boolean validate) { - if (! field.hasIndex() && field.getAttributes().isEmpty()) { + if (! field.hasIndex() && field.getAttributes().isEmpty() && !field.doesSummarying()) { return; } for (Attribute atr : field.getAttributes().values()) { diff --git a/config-model/src/main/java/com/yahoo/schema/processing/IndexingOutputs.java b/config-model/src/main/java/com/yahoo/schema/processing/IndexingOutputs.java index 3dd2ffdb02e..071c2878ae8 100644 --- a/config-model/src/main/java/com/yahoo/schema/processing/IndexingOutputs.java +++ b/config-model/src/main/java/com/yahoo/schema/processing/IndexingOutputs.java @@ -137,6 +137,15 @@ public class IndexingOutputs extends Processor { for (String fieldName : summaryFields) { ret.add(new SummaryExpression(fieldName)); } + /* + * Write to summary field source. AddExtraFieldsToDocument processor adds the "copy" + * summary transform to summary fields without a corresponding explicitly declared + * document field (2023-11-01). Future vespa versions will stop adding document + * fields for those summary fields. + */ + if (!summaryFields.contains(field.getName())) { + ret.add(new SummaryExpression(field.getName())); + } } else { throw new UnsupportedOperationException(exp.getClass().getName()); } diff --git a/config-model/src/main/java/com/yahoo/schema/processing/IndexingValidation.java b/config-model/src/main/java/com/yahoo/schema/processing/IndexingValidation.java index 9a98958fca9..3f336544a99 100644 --- a/config-model/src/main/java/com/yahoo/schema/processing/IndexingValidation.java +++ b/config-model/src/main/java/com/yahoo/schema/processing/IndexingValidation.java @@ -131,10 +131,18 @@ public class IndexingValidation extends Processor { } else if (exp instanceof SummaryExpression) { SummaryField field = schema.getSummaryField(fieldName); if (field == null) { - throw new VerificationException(exp, "Summary field '" + fieldName + "' not found."); + // Use document field if summary field is not found + SDField sdField = schema.getConcreteField(fieldName); + if (sdField != null && sdField.doesSummarying()) { + fieldDesc = "document field"; + fieldType = sdField.getDataType(); + } else { + throw new VerificationException(exp, "Summary field '" + fieldName + "' not found."); + } + } else { + fieldDesc = "summary field"; + fieldType = field.getDataType(); } - fieldDesc = "summary field"; - fieldType = field.getDataType(); } else { throw new UnsupportedOperationException(); } diff --git a/config-model/src/main/java/com/yahoo/schema/processing/TextMatch.java b/config-model/src/main/java/com/yahoo/schema/processing/TextMatch.java index 7dd968c5454..8ae3ec7a3fa 100644 --- a/config-model/src/main/java/com/yahoo/schema/processing/TextMatch.java +++ b/config-model/src/main/java/com/yahoo/schema/processing/TextMatch.java @@ -47,13 +47,7 @@ public class TextMatch extends Processor { } if (fieldType != DataType.STRING) continue; - Set<String> dynamicSummary = new TreeSet<>(); - Set<String> staticSummary = new TreeSet<>(); - new IndexingOutputs(schema, deployLogger, rankProfileRegistry, queryProfiles).findSummaryTo(schema, - field, - dynamicSummary, - staticSummary); - MyVisitor visitor = new MyVisitor(dynamicSummary); + MyVisitor visitor = new MyVisitor(); visitor.visit(script); if ( ! visitor.requiresTokenize) continue; @@ -78,23 +72,15 @@ public class TextMatch extends Processor { private static class MyVisitor extends ExpressionVisitor { - final Set<String> dynamicSummaryFields; boolean requiresTokenize = false; - MyVisitor(Set<String> dynamicSummaryFields) { - this.dynamicSummaryFields = dynamicSummaryFields; - } + MyVisitor() { } @Override protected void doVisit(Expression exp) { if (exp instanceof IndexExpression) { requiresTokenize = true; } - if (exp instanceof SummaryExpression && - dynamicSummaryFields.contains(((SummaryExpression)exp).getFieldName())) - { - requiresTokenize = true; - } } } diff --git a/config-model/src/main/java/com/yahoo/schema/processing/TypedTransformProvider.java b/config-model/src/main/java/com/yahoo/schema/processing/TypedTransformProvider.java index 63eee474095..34dcc9139b3 100644 --- a/config-model/src/main/java/com/yahoo/schema/processing/TypedTransformProvider.java +++ b/config-model/src/main/java/com/yahoo/schema/processing/TypedTransformProvider.java @@ -39,9 +39,17 @@ public abstract class TypedTransformProvider extends ValueTransformProvider { } else if (exp instanceof SummaryExpression) { Field field = schema.getSummaryField(fieldName); - if (field == null) - throw new IllegalArgumentException("Summary field '" + fieldName + "' not found."); - fieldType = field.getDataType(); + if (field == null) { + // Use document field if summary field is not found + var sdField = schema.getConcreteField(fieldName); + if (sdField != null && sdField.doesSummarying()) { + fieldType = sdField.getDataType(); + } else { + throw new IllegalArgumentException("Summary field '" + fieldName + "' not found."); + } + } else { + fieldType = field.getDataType(); + } } else { throw new UnsupportedOperationException(); diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorServerProducer.java b/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorServerProducer.java index b88ab0c5a45..1865db0ec1c 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorServerProducer.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorServerProducer.java @@ -1,6 +1,7 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.content.storagecluster; +import com.yahoo.config.model.api.ModelContext; import com.yahoo.vespa.config.content.core.StorServerConfig; import com.yahoo.vespa.model.builder.xml.dom.ModelElement; import com.yahoo.vespa.model.content.cluster.ContentCluster; @@ -10,10 +11,10 @@ import com.yahoo.vespa.model.content.cluster.ContentCluster; */ public class StorServerProducer implements StorServerConfig.Producer { public static class Builder { - StorServerProducer build(ModelElement element) { + StorServerProducer build(ModelContext.Properties properties, ModelElement element) { ModelElement tuning = element.child("tuning"); - StorServerProducer producer = new StorServerProducer(ContentCluster.getClusterId(element)); + StorServerProducer producer = new StorServerProducer(ContentCluster.getClusterId(element), properties.featureFlags()); if (tuning == null) return producer; ModelElement merges = tuning.child("merges"); @@ -28,6 +29,7 @@ public class StorServerProducer implements StorServerConfig.Producer { private final String clusterName; private Integer maxMergesPerNode; private Integer queueSize; + private Long mergingMaxMemoryUsagePerNode; private StorServerProducer setMaxMergesPerNode(Integer value) { if (value != null) { @@ -42,8 +44,9 @@ public class StorServerProducer implements StorServerConfig.Producer { return this; } - StorServerProducer(String clusterName) { + StorServerProducer(String clusterName, ModelContext.FeatureFlags featureFlags) { this.clusterName = clusterName; + this.mergingMaxMemoryUsagePerNode = featureFlags.mergingMaxMemoryUsagePerNode(); } @Override @@ -60,5 +63,10 @@ public class StorServerProducer implements StorServerConfig.Producer { if (queueSize != null) { builder.max_merge_queue_size(queueSize); } + if (mergingMaxMemoryUsagePerNode != null) { + builder.merge_throttling_memory_limit( + new StorServerConfig.Merge_throttling_memory_limit.Builder() + .max_usage_bytes(mergingMaxMemoryUsagePerNode)); + } } } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorageCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorageCluster.java index ce2899877a7..701da93a329 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorageCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/StorageCluster.java @@ -35,7 +35,7 @@ public class StorageCluster extends TreeConfigProducer<StorageNode> return new StorageCluster(ancestor, ContentCluster.getClusterId(clusterElem), new FileStorProducer.Builder().build(deployState.getProperties(), cluster, clusterElem), - new StorServerProducer.Builder().build(clusterElem), + new StorServerProducer.Builder().build(deployState.getProperties(), clusterElem), new StorVisitorProducer.Builder().build(clusterElem), new PersistenceProducer.Builder().build(clusterElem)); } diff --git a/config-model/src/test/derived/bolding_dynamic_summary/documenttypes.cfg b/config-model/src/test/derived/bolding_dynamic_summary/documenttypes.cfg index f88a22d8979..3e043d3dad8 100644 --- a/config-model/src/test/derived/bolding_dynamic_summary/documenttypes.cfg +++ b/config-model/src/test/derived/bolding_dynamic_summary/documenttypes.cfg @@ -48,14 +48,14 @@ doctype[].idx 10015 doctype[].internalid -877171244 doctype[].inherits[].idx 10000 doctype[].contentstruct 10016 -doctype[].fieldsets{[]}.fields[] "arr_1" -doctype[].fieldsets{[]}.fields[] "arr_2" -doctype[].fieldsets{[]}.fields[] "arr_3" -doctype[].fieldsets{[]}.fields[] "arr_4" -doctype[].fieldsets{[]}.fields[] "str_1" -doctype[].fieldsets{[]}.fields[] "str_2" -doctype[].fieldsets{[]}.fields[] "str_3" -doctype[].fieldsets{[]}.fields[] "str_4" +doctype[].fieldsets{[document]}.fields[] "arr_1" +doctype[].fieldsets{[document]}.fields[] "arr_2" +doctype[].fieldsets{[document]}.fields[] "arr_3" +doctype[].fieldsets{[document]}.fields[] "arr_4" +doctype[].fieldsets{[document]}.fields[] "str_1" +doctype[].fieldsets{[document]}.fields[] "str_2" +doctype[].fieldsets{[document]}.fields[] "str_3" +doctype[].fieldsets{[document]}.fields[] "str_4" doctype[].arraytype[].idx 10017 doctype[].arraytype[].elementtype 10012 doctype[].arraytype[].internalid -1486737430 diff --git a/config-model/src/test/derived/complex/ilscripts.cfg b/config-model/src/test/derived/complex/ilscripts.cfg index f7f6c9dd720..6074333bd24 100644 --- a/config-model/src/test/derived/complex/ilscripts.cfg +++ b/config-model/src/test/derived/complex/ilscripts.cfg @@ -27,7 +27,7 @@ ilscript[].content[] "clear_state | guard { input location | tokenize normalize ilscript[].content[] "clear_state | guard { input yEaR | to_array | attribute year_arr; }" ilscript[].content[] "clear_state | guard { input yEaR - 1900 | attribute year_sub; }" ilscript[].content[] "clear_state | guard { input title | tokenize normalize stem:\"BEST\" | index title | summary title; }" -ilscript[].content[] "clear_state | guard { input dyntitle | tokenize normalize stem:\"BEST\" | summary dyntitle; }" +ilscript[].content[] "clear_state | guard { input dyntitle | summary dyntitle; }" ilscript[].content[] "clear_state | guard { input special1 | tokenize normalize | index special1; }" ilscript[].content[] "clear_state | guard { input special2 | tokenize normalize | index special2; }" ilscript[].content[] "clear_state | guard { input special3 | tokenize normalize | index special3; }" diff --git a/config-model/src/test/derived/multiplesummaries/ilscripts.cfg b/config-model/src/test/derived/multiplesummaries/ilscripts.cfg index 6429932ab0e..514dfffac9d 100644 --- a/config-model/src/test/derived/multiplesummaries/ilscripts.cfg +++ b/config-model/src/test/derived/multiplesummaries/ilscripts.cfg @@ -14,13 +14,13 @@ ilscript[].docfield[] "h" ilscript[].docfield[] "loc" ilscript[].docfield[] "mytags" ilscript[].content[] "clear_state | guard { input loc | to_pos | zcurve | attribute loc_pos_zcurve; }" -ilscript[].content[] "clear_state | guard { input a | tokenize normalize stem:\"BEST\" | summary abolded2 | summary aboldeddynamic | summary adynamic2 | attribute a; }" -ilscript[].content[] "clear_state | guard { input adynamic | tokenize normalize stem:\"BEST\" | summary adynamic | attribute adynamic; }" -ilscript[].content[] "clear_state | guard { input abolded | tokenize normalize stem:\"BEST\" | summary abolded | attribute abolded; }" +ilscript[].content[] "clear_state | guard { input a | summary abolded2 | summary aboldeddynamic | summary adynamic2 | summary a | attribute a; }" +ilscript[].content[] "clear_state | guard { input adynamic | summary adynamic | attribute adynamic; }" +ilscript[].content[] "clear_state | guard { input abolded | summary abolded | attribute abolded; }" ilscript[].content[] "clear_state | guard { input b | summary anotherb | summary b; }" ilscript[].content[] "clear_state | guard { input c | summary c | attribute c; }" -ilscript[].content[] "clear_state | guard { input d | tokenize normalize stem:\"BEST\" | summary d; }" -ilscript[].content[] "clear_state | guard { input e | tokenize normalize stem:\"BEST\" | summary dynamice | summary e; }" +ilscript[].content[] "clear_state | guard { input d | summary d; }" +ilscript[].content[] "clear_state | guard { input e | summary dynamice | summary e; }" ilscript[].content[] "clear_state | guard { input f | summary f; }" ilscript[].content[] "clear_state | guard { input g | summary g; }" ilscript[].content[] "clear_state | guard { input h | summary h; }" diff --git a/config-model/src/test/derived/music/ilscripts.cfg b/config-model/src/test/derived/music/ilscripts.cfg index 7a02d836db5..ba292c4013a 100644 --- a/config-model/src/test/derived/music/ilscripts.cfg +++ b/config-model/src/test/derived/music/ilscripts.cfg @@ -39,7 +39,7 @@ ilscript[].docfield[] "powermetalvalue" ilscript[].docfield[] "progvalue" ilscript[].content[] "clear_state | guard { input hiphopvalue | split \";\" | attribute hiphopvalue_arr; }" ilscript[].content[] "clear_state | guard { input metalvalue | split \";\" | attribute metalvalue_arr; }" -ilscript[].content[] "clear_state | guard { input bgndata | tokenize normalize stem:\"BEST\" | summary bgndata; }" +ilscript[].content[] "clear_state | guard { input bgndata | summary bgndata; }" ilscript[].content[] "clear_state | guard { input sales | summary sales | attribute sales; }" ilscript[].content[] "clear_state | guard { input pto | summary pto | attribute pto; }" ilscript[].content[] "clear_state | guard { input keys | tokenize normalize stem:\"BEST\" | index keys; }" @@ -66,7 +66,7 @@ ilscript[].content[] "clear_state | guard { input artist | tokenize normalize st ilscript[].content[] "clear_state | guard { input artistspid | summary artistspid; }" ilscript[].content[] "clear_state | guard { input title | tokenize normalize stem:\"BEST\" | summary title | index title; }" ilscript[].content[] "clear_state | guard { input newestedition | summary newestedition | attribute newestedition; }" -ilscript[].content[] "clear_state | guard { input bgnpto | tokenize normalize stem:\"BEST\" | summary bgnpto; }" +ilscript[].content[] "clear_state | guard { input bgnpto | summary bgnpto; }" ilscript[].content[] "clear_state | guard { input year | summary year | attribute year; }" ilscript[].content[] "clear_state | guard { input did | summary did | attribute did; }" ilscript[].content[] "clear_state | guard { input scorekey | summary scorekey; }" diff --git a/config-model/src/test/derived/newrank/ilscripts.cfg b/config-model/src/test/derived/newrank/ilscripts.cfg index 6986f12f62a..ec46d9acc68 100644 --- a/config-model/src/test/derived/newrank/ilscripts.cfg +++ b/config-model/src/test/derived/newrank/ilscripts.cfg @@ -33,7 +33,7 @@ ilscript[].docfield[] "year" ilscript[].docfield[] "did" ilscript[].docfield[] "scorekey" ilscript[].docfield[] "cbid" -ilscript[].content[] "clear_state | guard { input bgndata | tokenize normalize stem:\"BEST\" | summary bgndata; }" +ilscript[].content[] "clear_state | guard { input bgndata | summary bgndata; }" ilscript[].content[] "clear_state | guard { input sales | summary sales | attribute sales; }" ilscript[].content[] "clear_state | guard { input pto | summary pto | attribute pto; }" ilscript[].content[] "clear_state | guard { input keys | tokenize normalize stem:\"BEST\" | index keys; }" @@ -60,7 +60,7 @@ ilscript[].content[] "clear_state | guard { input artist | tokenize normalize st ilscript[].content[] "clear_state | guard { input artistspid | summary artistspid; }" ilscript[].content[] "clear_state | guard { input title | tokenize normalize stem:\"BEST\" | summary title | index title; }" ilscript[].content[] "clear_state | guard { input newestedition | summary newestedition | attribute newestedition; }" -ilscript[].content[] "clear_state | guard { input bgnpto | tokenize normalize stem:\"BEST\" | summary bgnpto; }" +ilscript[].content[] "clear_state | guard { input bgnpto | summary bgnpto; }" ilscript[].content[] "clear_state | guard { input year | summary year | attribute year; }" ilscript[].content[] "clear_state | guard { input did | summary did | attribute did; }" ilscript[].content[] "clear_state | guard { input scorekey | summary scorekey | attribute scorekey; }" diff --git a/config-model/src/test/java/com/yahoo/schema/AbstractSchemaTestCase.java b/config-model/src/test/java/com/yahoo/schema/AbstractSchemaTestCase.java index 55aa437dcb7..42005efaa8d 100644 --- a/config-model/src/test/java/com/yahoo/schema/AbstractSchemaTestCase.java +++ b/config-model/src/test/java/com/yahoo/schema/AbstractSchemaTestCase.java @@ -47,6 +47,7 @@ public abstract class AbstractSchemaTestCase { StringBuilder b = new StringBuilder(); try (BufferedReader r = IOUtils.createReader(file)) { int character; + int lastChar = -1; boolean lastWasNewline = false; boolean inBrackets = false; while (-1 != (character = r.read())) { @@ -72,8 +73,9 @@ public abstract class AbstractSchemaTestCase { inBrackets = false; if (! inBrackets) b.appendCodePoint(character); - if (character == '[') + if (character == '[' && lastChar != '{') inBrackets = true; + lastChar = character; } } return b.toString(); diff --git a/config-model/src/test/java/com/yahoo/schema/processing/AddExtraFieldsToDocumentTest.java b/config-model/src/test/java/com/yahoo/schema/processing/AddExtraFieldsToDocumentTest.java index 43b403c42c6..aad6df62993 100644 --- a/config-model/src/test/java/com/yahoo/schema/processing/AddExtraFieldsToDocumentTest.java +++ b/config-model/src/test/java/com/yahoo/schema/processing/AddExtraFieldsToDocumentTest.java @@ -49,6 +49,29 @@ public class AddExtraFieldsToDocumentTest { assertNull(schema.getDocument().getField("my_c")); } + @Test + public void testExtraFieldIsAddedWhenBeingASummarySource() throws ParseException { + var sd = """ + search renamed { + document renamed { + field foo type string { } + } + field bar type string { + indexing: input foo | summary + summary baz { } + } + field bar2 type string { + indexing: input foo + summary baz2 { } + } + } + """; + var builder = ApplicationBuilder.createFromString(sd); + var schema = builder.getSchema(); + assertNotNull(schema.getDocument().getDocumentType().getField("bar")); + assertNull(schema.getDocument().getDocumentType().getField("bar2")); + } + private void assertSummary(Schema schema, String dsName, String name, SummaryTransform transform, String source) { var docsum = schema.getSummary(dsName); var field = docsum.getSummaryField(name); diff --git a/config-model/src/test/java/com/yahoo/schema/processing/IndexingOutputsTestCase.java b/config-model/src/test/java/com/yahoo/schema/processing/IndexingOutputsTestCase.java index 58956b89a07..76680f4ce9a 100644 --- a/config-model/src/test/java/com/yahoo/schema/processing/IndexingOutputsTestCase.java +++ b/config-model/src/test/java/com/yahoo/schema/processing/IndexingOutputsTestCase.java @@ -62,4 +62,23 @@ public class IndexingOutputsTestCase { } } + @Test + void requireThatSummaryFieldSourceIsPopulated() throws ParseException { + var sd = """ + search renamed { + document renamed { + field foo type string { } + } + field bar type string { + indexing: input foo | summary + summary baz { } + summary dyn_baz { dynamic } + } + } + """; + var builder = ApplicationBuilder.createFromString(sd); + var schema = builder.getSchema(); + assertEquals("{ input foo | summary baz | summary dyn_baz | summary bar; }", + schema.getConcreteField("bar").getIndexingScript().toString()); + } } diff --git a/config-model/src/test/java/com/yahoo/schema/processing/IndexingScriptRewriterTestCase.java b/config-model/src/test/java/com/yahoo/schema/processing/IndexingScriptRewriterTestCase.java index 62f36a37d87..0b561563421 100644 --- a/config-model/src/test/java/com/yahoo/schema/processing/IndexingScriptRewriterTestCase.java +++ b/config-model/src/test/java/com/yahoo/schema/processing/IndexingScriptRewriterTestCase.java @@ -48,7 +48,7 @@ public class IndexingScriptRewriterTestCase extends AbstractSchemaTestCase { void testDynamicSummaryRewriting() { SDField field = createField("test", DataType.STRING, "{ summary }"); field.addSummaryField(createDynamicSummaryField(field, "dyn")); - assertIndexingScript("{ input test | tokenize normalize stem:\"BEST\" | summary dyn; }", field); + assertIndexingScript("{ input test | summary dyn | summary test; }", field); } @Test @@ -113,7 +113,7 @@ public class IndexingScriptRewriterTestCase extends AbstractSchemaTestCase { "clear_state | guard { input chatter | tokenize normalize stem:\"BEST\" | index chatter; }", "clear_state | guard { input description | tokenize normalize stem:\"BEST\" | summary description | summary dyndesc | index description; }", "clear_state | guard { input exactemento_src | lowercase | tokenize normalize stem:\"BEST\" | index exactemento | summary exactemento; }", - "clear_state | guard { input longdesc | tokenize normalize stem:\"BEST\" | summary dyndesc2 | summary dynlong | summary longdesc | summary longstat; }", + "clear_state | guard { input longdesc | summary dyndesc2 | summary dynlong | summary longdesc | summary longstat; }", "clear_state | guard { input measurement | attribute measurement | summary measurement; }", "clear_state | guard { input measurement | to_array | attribute measurement_arr; }", "clear_state | guard { input popularity | attribute popularity; }", 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 0c2a26d9c1d..6b58cac3f6c 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 @@ -116,12 +116,10 @@ public class IndexingScriptChangeValidatorTest { } @Test - void requireThatSettingDynamicSummaryRequireReindexing() throws Exception { + void requireThatSettingDynamicSummaryIsOk() throws Exception { new Fixture(FIELD + " { indexing: summary }", FIELD + " { indexing: summary \n summary: dynamic }"). - assertValidation(expectedReindexingAction("summary field 'f1' transform: 'none' -> 'dynamicteaser'", - "{ input f1 | summary f1; }", - "{ input f1 | tokenize normalize stem:\"BEST\" | summary f1; }")); + assertValidation(); } @Test diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java index e1c4620e9b7..e7b2c549fa5 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java @@ -185,6 +185,36 @@ public class StorageClusterTest { } @Test + void merge_throttler_memory_limit_config_has_expected_defaults() { + var config = configFromProperties(new TestProperties()); + var limit = config.merge_throttling_memory_limit(); + + assertEquals(-1L, limit.max_usage_bytes()); // TODO change default + assertMergeAutoScaleConfigHasExpectedValues(limit); + } + + void assertMergeAutoScaleConfigHasExpectedValues(StorServerConfig.Merge_throttling_memory_limit limit) { + assertEquals(128L*1024*1024, limit.auto_lower_bound_bytes()); + assertEquals(2L*1024*1024*1024, limit.auto_upper_bound_bytes()); + assertEquals(0.03, limit.auto_phys_mem_scale_factor(), 0.000001); + } + + @Test + void merge_throttler_memory_limit_is_controlled_by_feature_flag() { + var config = configFromProperties(new TestProperties().setMergingMaxMemoryUsagePerNode(-1)); + assertEquals(-1L, config.merge_throttling_memory_limit().max_usage_bytes()); + + config = configFromProperties(new TestProperties().setMergingMaxMemoryUsagePerNode(0)); + assertEquals(0L, config.merge_throttling_memory_limit().max_usage_bytes()); + + config = configFromProperties(new TestProperties().setMergingMaxMemoryUsagePerNode(1_234_456_789)); + assertEquals(1_234_456_789L, config.merge_throttling_memory_limit().max_usage_bytes()); + + // Feature flag should not affect the other config values + assertMergeAutoScaleConfigHasExpectedValues(config.merge_throttling_memory_limit()); + } + + @Test void testVisitors() { StorVisitorConfig.Builder builder = new StorVisitorConfig.Builder(); parse(cluster("bees", |