Skip to content

Commit e87b894

Browse files
authored
Fix bbq index feature exposure for testing & remove feature flag (#114832)
We actually don't need a cluster feature, a capability added if the feature flag is enabled is enough for testing. closes #114787
1 parent 2f1f24d commit e87b894

File tree

4 files changed

+6
-23
lines changed

4 files changed

+6
-23
lines changed

muted-tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,6 @@ tests:
408408
- class: org.elasticsearch.xpack.enrich.EnrichIT
409409
method: testDeleteExistingPipeline
410410
issue: https://github.com/elastic/elasticsearch/issues/114775
411-
- class: org.elasticsearch.test.rest.ClientYamlTestSuiteIT
412-
issue: https://github.com/elastic/elasticsearch/issues/114787
413411
- class: org.elasticsearch.xpack.inference.rest.ServerSentEventsRestActionListenerTests
414412
method: testNoStream
415413
issue: https://github.com/elastic/elasticsearch/issues/114788

server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
package org.elasticsearch.index.mapper;
1111

12-
import org.elasticsearch.common.util.set.Sets;
1312
import org.elasticsearch.features.FeatureSpecification;
1413
import org.elasticsearch.features.NodeFeature;
1514
import org.elasticsearch.index.IndexSettings;
@@ -29,7 +28,7 @@ public class MapperFeatures implements FeatureSpecification {
2928

3029
@Override
3130
public Set<NodeFeature> getFeatures() {
32-
Set<NodeFeature> features = Set.of(
31+
return Set.of(
3332
BWC_WORKAROUND_9_0,
3433
IgnoredSourceFieldMapper.TRACK_IGNORED_SOURCE,
3534
PassThroughObjectMapper.PASS_THROUGH_PRIORITY,
@@ -53,13 +52,9 @@ public Set<NodeFeature> getFeatures() {
5352
IndexSettings.IGNORE_ABOVE_INDEX_LEVEL_SETTING,
5453
SourceFieldMapper.SYNTHETIC_SOURCE_COPY_TO_INSIDE_OBJECTS_FIX,
5554
TimeSeriesRoutingHashFieldMapper.TS_ROUTING_HASH_FIELD_PARSES_BYTES_REF,
56-
FlattenedFieldMapper.IGNORE_ABOVE_WITH_ARRAYS_SUPPORT
55+
FlattenedFieldMapper.IGNORE_ABOVE_WITH_ARRAYS_SUPPORT,
56+
DenseVectorFieldMapper.BBQ_FORMAT
5757
);
58-
// BBQ is currently behind a feature flag for testing
59-
if (DenseVectorFieldMapper.BBQ_FEATURE_FLAG.isEnabled()) {
60-
return Sets.union(features, Set.of(DenseVectorFieldMapper.BBQ_FORMAT));
61-
}
62-
return features;
6358
}
6459

6560
@Override

server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import org.apache.lucene.util.BytesRef;
3737
import org.apache.lucene.util.VectorUtil;
3838
import org.elasticsearch.common.ParsingException;
39-
import org.elasticsearch.common.util.FeatureFlag;
4039
import org.elasticsearch.common.xcontent.support.XContentMapValues;
4140
import org.elasticsearch.features.NodeFeature;
4241
import org.elasticsearch.index.IndexVersion;
@@ -110,7 +109,6 @@ public static boolean isNotUnitVector(float magnitude) {
110109
public static final NodeFeature INT4_QUANTIZATION = new NodeFeature("mapper.vectors.int4_quantization");
111110
public static final NodeFeature BIT_VECTORS = new NodeFeature("mapper.vectors.bit_vectors");
112111
public static final NodeFeature BBQ_FORMAT = new NodeFeature("mapper.vectors.bbq");
113-
public static final FeatureFlag BBQ_FEATURE_FLAG = new FeatureFlag("bbq_index_format");
114112

115113
public static final IndexVersion MAGNITUDE_STORED_INDEX_VERSION = IndexVersions.V_7_5_0;
116114
public static final IndexVersion INDEXED_BY_DEFAULT_INDEX_VERSION = IndexVersions.FIRST_DETACHED_INDEX_VERSION;
@@ -2259,9 +2257,6 @@ private static IndexOptions parseIndexOptions(String fieldName, Object propNode)
22592257
throw new MapperParsingException("Unknown vector index options type [" + type + "] for field [" + fieldName + "]");
22602258
}
22612259
VectorIndexType parsedType = vectorIndexType.get();
2262-
if ((parsedType == VectorIndexType.BBQ_FLAT || parsedType == VectorIndexType.BBQ_HNSW) && BBQ_FEATURE_FLAG.isEnabled() == false) {
2263-
throw new MapperParsingException("Unknown vector index options type [" + type + "] for field [" + fieldName + "]");
2264-
}
22652260
return parsedType.parseIndexOptions(fieldName, indexOptionsMap);
22662261
}
22672262

server/src/test/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapperTests.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363

6464
import static org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsFormat.DEFAULT_BEAM_WIDTH;
6565
import static org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsFormat.DEFAULT_MAX_CONN;
66-
import static org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapper.BBQ_FEATURE_FLAG;
6766
import static org.hamcrest.Matchers.containsString;
6867
import static org.hamcrest.Matchers.equalTo;
6968
import static org.hamcrest.Matchers.instanceOf;
@@ -1228,11 +1227,9 @@ public void testInvalidParameters() {
12281227
e.getMessage(),
12291228
containsString("Failed to parse mapping: Mapping definition for [field] has unsupported parameters: [foo : {}]")
12301229
);
1231-
List<String> floatOnlyQuantizations = new ArrayList<>(Arrays.asList("int4_hnsw", "int8_hnsw", "int8_flat", "int4_flat"));
1232-
if (BBQ_FEATURE_FLAG.isEnabled()) {
1233-
floatOnlyQuantizations.add("bbq_hnsw");
1234-
floatOnlyQuantizations.add("bbq_flat");
1235-
}
1230+
List<String> floatOnlyQuantizations = new ArrayList<>(
1231+
Arrays.asList("int4_hnsw", "int8_hnsw", "int8_flat", "int4_flat", "bbq_hnsw", "bbq_flat")
1232+
);
12361233
for (String quantizationKind : floatOnlyQuantizations) {
12371234
e = expectThrows(
12381235
MapperParsingException.class,
@@ -1946,7 +1943,6 @@ public void testKnnQuantizedHNSWVectorsFormat() throws IOException {
19461943
}
19471944

19481945
public void testKnnBBQHNSWVectorsFormat() throws IOException {
1949-
assumeTrue("BBQ vectors are not supported in the current version", BBQ_FEATURE_FLAG.isEnabled());
19501946
final int m = randomIntBetween(1, DEFAULT_MAX_CONN + 10);
19511947
final int efConstruction = randomIntBetween(1, DEFAULT_BEAM_WIDTH + 10);
19521948
final int dims = randomIntBetween(64, 4096);
@@ -1985,7 +1981,6 @@ public void testKnnBBQHNSWVectorsFormat() throws IOException {
19851981
}
19861982

19871983
public void testInvalidVectorDimensionsBBQ() {
1988-
assumeTrue("BBQ vectors are not supported in the current version", BBQ_FEATURE_FLAG.isEnabled());
19891984
for (String quantizedFlatFormat : new String[] { "bbq_hnsw", "bbq_flat" }) {
19901985
MapperParsingException e = expectThrows(MapperParsingException.class, () -> createDocumentMapper(fieldMapping(b -> {
19911986
b.field("type", "dense_vector");

0 commit comments

Comments
 (0)