Skip to content

Commit fa940fd

Browse files
committed
Merge remote-tracking branch 'upstream/main' into fix-rolling-upgrade-tests-2
2 parents dc7c9fb + 69c0082 commit fa940fd

File tree

53 files changed

+212
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+212
-233
lines changed

docs/changelog/135370.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 135370
2+
summary: Add new `pattern_text` field mapper in tech preview
3+
area: Mapping
4+
type: feature
5+
issues: []

muted-tests.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ tests:
7373
- class: org.elasticsearch.xpack.apmdata.APMYamlTestSuiteIT
7474
method: test {yaml=/10_apm/Test template reinstallation}
7575
issue: https://github.com/elastic/elasticsearch/issues/116445
76-
- class: org.elasticsearch.versioning.ConcurrentSeqNoVersioningIT
77-
method: testSeqNoCASLinearizability
78-
issue: https://github.com/elastic/elasticsearch/issues/117249
7976
- class: org.elasticsearch.xpack.inference.InferenceRestIT
8077
method: test {p0=inference/40_semantic_text_query/Query a field that uses the default ELSER 2 endpoint}
8178
issue: https://github.com/elastic/elasticsearch/issues/117027
@@ -621,9 +618,6 @@ tests:
621618
- class: org.elasticsearch.xpack.esql.qa.multi_node.GenerativeIT
622619
method: test
623620
issue: https://github.com/elastic/elasticsearch/issues/134407
624-
- class: org.elasticsearch.index.codec.vectors.cluster.HierarchicalKMeansTests
625-
method: testFewDifferentValues
626-
issue: https://github.com/elastic/elasticsearch/issues/135538
627621

628622
# Examples:
629623
#

server/src/main/java/org/elasticsearch/TransportVersions.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ static TransportVersion def(int id) {
192192
public static final TransportVersion ML_INFERENCE_ELASTIC_RERANK_ADDED_8_19 = def(8_841_0_48);
193193
public static final TransportVersion NONE_CHUNKING_STRATEGY_8_19 = def(8_841_0_49);
194194
public static final TransportVersion IDP_CUSTOM_SAML_ATTRIBUTES_ALLOW_LIST_8_19 = def(8_841_0_50);
195-
public static final TransportVersion SETTINGS_IN_DATA_STREAMS_8_19 = def(8_841_0_51);
196195
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0 = def(9_000_0_00);
197196
public static final TransportVersion REMOVE_SNAPSHOT_FAILURES_90 = def(9_000_0_01);
198197
public static final TransportVersion TRANSPORT_STATS_HANDLING_TIME_REQUIRED_90 = def(9_000_0_02);
@@ -263,7 +262,6 @@ static TransportVersion def(int id) {
263262
public static final TransportVersion SYNONYMS_REFRESH_PARAM = def(9_060_0_00);
264263
public static final TransportVersion DOC_FIELDS_AS_LIST = def(9_061_0_00);
265264
public static final TransportVersion DENSE_VECTOR_OFF_HEAP_STATS = def(9_062_00_0);
266-
public static final TransportVersion SETTINGS_IN_DATA_STREAMS = def(9_064_0_00);
267265
public static final TransportVersion INTRODUCE_FAILURES_LIFECYCLE = def(9_065_0_00);
268266
public static final TransportVersion PROJECT_METADATA_SETTINGS = def(9_066_0_00);
269267
public static final TransportVersion AGGREGATE_METRIC_DOUBLE_BLOCK = def(9_067_0_00);
@@ -280,7 +278,6 @@ static TransportVersion def(int id) {
280278
public static final TransportVersion ML_INFERENCE_HUGGING_FACE_CHAT_COMPLETION_ADDED = def(9_078_0_00);
281279
public static final TransportVersion NODES_STATS_SUPPORTS_MULTI_PROJECT = def(9_079_0_00);
282280
public static final TransportVersion ML_INFERENCE_HUGGING_FACE_RERANK_ADDED = def(9_080_0_00);
283-
public static final TransportVersion SETTINGS_IN_DATA_STREAMS_DRY_RUN = def(9_081_0_00);
284281
public static final TransportVersion ML_INFERENCE_SAGEMAKER_CHAT_COMPLETION = def(9_082_0_00);
285282
public static final TransportVersion ML_INFERENCE_VERTEXAI_CHATCOMPLETION_ADDED = def(9_083_0_00);
286283
public static final TransportVersion INFERENCE_CUSTOM_SERVICE_ADDED = def(9_084_0_00);

server/src/main/java/org/elasticsearch/action/datastreams/UpdateDataStreamSettingsAction.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
package org.elasticsearch.action.datastreams;
1111

1212
import org.elasticsearch.TransportVersion;
13-
import org.elasticsearch.TransportVersions;
1413
import org.elasticsearch.action.ActionResponse;
1514
import org.elasticsearch.action.ActionType;
1615
import org.elasticsearch.action.IndicesRequest;
@@ -42,6 +41,7 @@ public class UpdateDataStreamSettingsAction extends ActionType<UpdateDataStreamS
4241
public static final String NAME = "indices:admin/data_stream/settings/update";
4342
public static final UpdateDataStreamSettingsAction INSTANCE = new UpdateDataStreamSettingsAction();
4443

44+
private static final TransportVersion SETTINGS_IN_DATA_STREAMS = TransportVersion.fromName("settings_in_data_streams");
4545
private static final TransportVersion DATA_STREAM_WRITE_INDEX_ONLY_SETTINGS = TransportVersion.fromName(
4646
"data_stream_write_index_only_settings"
4747
);
@@ -88,8 +88,7 @@ public Request(StreamInput in) throws IOException {
8888
super(in);
8989
this.dataStreamNames = in.readStringArray();
9090
this.settings = Settings.readSettingsFromStream(in);
91-
if (in.getTransportVersion().onOrAfter(TransportVersions.SETTINGS_IN_DATA_STREAMS_DRY_RUN)
92-
|| in.getTransportVersion().isPatchFrom(TransportVersions.SETTINGS_IN_DATA_STREAMS_8_19)) {
91+
if (in.getTransportVersion().supports(SETTINGS_IN_DATA_STREAMS)) {
9392
this.dryRun = in.readBoolean();
9493
} else {
9594
this.dryRun = false;
@@ -101,8 +100,7 @@ public void writeTo(StreamOutput out) throws IOException {
101100
super.writeTo(out);
102101
out.writeStringArray(dataStreamNames);
103102
settings.writeTo(out);
104-
if (out.getTransportVersion().onOrAfter(TransportVersions.SETTINGS_IN_DATA_STREAMS_DRY_RUN)
105-
|| out.getTransportVersion().isPatchFrom(TransportVersions.SETTINGS_IN_DATA_STREAMS_8_19)) {
103+
if (out.getTransportVersion().supports(SETTINGS_IN_DATA_STREAMS)) {
106104
out.writeBoolean(dryRun);
107105
}
108106
}

server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public final class DataStream implements SimpleDiffable<DataStream>, ToXContentO
8686

8787
private static final Logger LOGGER = LogManager.getLogger(DataStream.class);
8888

89+
private static final TransportVersion SETTINGS_IN_DATA_STREAMS = TransportVersion.fromName("settings_in_data_streams");
8990
private static final TransportVersion MAPPINGS_IN_DATA_STREAMS = TransportVersion.fromName("mappings_in_data_streams");
9091

9192
public static final NodeFeature DATA_STREAM_FAILURE_STORE_FEATURE = new NodeFeature("data_stream.failure_store");
@@ -334,8 +335,7 @@ public static DataStream read(StreamInput in) throws IOException {
334335
dataStreamOptions = failureStoreEnabled ? DataStreamOptions.FAILURE_STORE_ENABLED : null;
335336
}
336337
final Settings settings;
337-
if (in.getTransportVersion().onOrAfter(TransportVersions.SETTINGS_IN_DATA_STREAMS)
338-
|| in.getTransportVersion().isPatchFrom(TransportVersions.SETTINGS_IN_DATA_STREAMS_8_19)) {
338+
if (in.getTransportVersion().supports(SETTINGS_IN_DATA_STREAMS)) {
339339
settings = Settings.readSettingsFromStream(in);
340340
} else {
341341
settings = Settings.EMPTY;
@@ -1479,8 +1479,7 @@ public void writeTo(StreamOutput out) throws IOException {
14791479
if (out.getTransportVersion().onOrAfter(DataStream.ADD_DATA_STREAM_OPTIONS_VERSION)) {
14801480
out.writeOptionalWriteable(dataStreamOptions.isEmpty() ? null : dataStreamOptions);
14811481
}
1482-
if (out.getTransportVersion().onOrAfter(TransportVersions.SETTINGS_IN_DATA_STREAMS)
1483-
|| out.getTransportVersion().isPatchFrom(TransportVersions.SETTINGS_IN_DATA_STREAMS_8_19)) {
1482+
if (out.getTransportVersion().supports(SETTINGS_IN_DATA_STREAMS)) {
14841483
settings.writeTo(out);
14851484
}
14861485
if (out.getTransportVersion().supports(MAPPINGS_IN_DATA_STREAMS)) {

server/src/main/java/org/elasticsearch/index/codec/vectors/cluster/HierarchicalKMeans.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public class HierarchicalKMeans {
2424
public static final int MAX_ITERATIONS_DEFAULT = 6;
2525
public static final int SAMPLES_PER_CLUSTER_DEFAULT = 64;
2626
public static final float DEFAULT_SOAR_LAMBDA = 1.0f;
27+
public static final int NO_SOAR_ASSIGNMENT = -1;
2728

2829
final int dimension;
2930
final int maxIterations;

server/src/main/java/org/elasticsearch/index/codec/vectors/cluster/KMeansLocal.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import java.util.Arrays;
2020
import java.util.Random;
2121

22+
import static org.elasticsearch.index.codec.vectors.cluster.HierarchicalKMeans.NO_SOAR_ASSIGNMENT;
23+
2224
/**
2325
* k-means implementation specific to the needs of the {@link HierarchicalKMeans} algorithm that deals specifically
2426
* with finalizing nearby pre-established clusters and generate
@@ -240,7 +242,7 @@ private void assignSpilled(
240242
// TODO: cache these?
241243
float vectorCentroidDist = VectorUtil.squareDistance(vector, currentCentroid);
242244
if (vectorCentroidDist <= SOAR_MIN_DISTANCE) {
243-
spilledAssignments[i] = -1; // no SOAR assignment
245+
spilledAssignments[i] = NO_SOAR_ASSIGNMENT; // no SOAR assignment
244246
continue;
245247
}
246248

server/src/main/java/org/elasticsearch/index/codec/vectors/diskbbq/ES920DiskBBQVectorsWriter.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
import java.util.AbstractList;
3939
import java.util.Arrays;
4040

41+
import static org.elasticsearch.index.codec.vectors.cluster.HierarchicalKMeans.NO_SOAR_ASSIGNMENT;
42+
4143
/**
4244
* Default implementation of {@link IVFVectorsWriter}. It uses {@link HierarchicalKMeans} algorithm to
4345
* partition the vector space, and then stores the centroids and posting list in a sequential
@@ -75,7 +77,7 @@ CentroidOffsetAndLength buildAndWritePostingsLists(
7577
for (int i = 0; i < assignments.length; i++) {
7678
centroidVectorCount[assignments[i]]++;
7779
// if soar assignments are present, count them as well
78-
if (overspillAssignments.length > i && overspillAssignments[i] != -1) {
80+
if (overspillAssignments.length > i && overspillAssignments[i] != NO_SOAR_ASSIGNMENT) {
7981
centroidVectorCount[overspillAssignments[i]]++;
8082
}
8183
}
@@ -95,7 +97,7 @@ CentroidOffsetAndLength buildAndWritePostingsLists(
9597
// if soar assignments are present, add them to the cluster as well
9698
if (overspillAssignments.length > i) {
9799
int s = overspillAssignments[i];
98-
if (s != -1) {
100+
if (s != NO_SOAR_ASSIGNMENT) {
99101
assignmentsByCluster[s][centroidVectorCount[s]++] = i;
100102
}
101103
}
@@ -187,7 +189,7 @@ CentroidOffsetAndLength buildAndWritePostingsLists(
187189
int c = assignments[i];
188190
float[] centroid = centroidSupplier.centroid(c);
189191
float[] vector = floatVectorValues.vectorValue(i);
190-
boolean overspill = overspillAssignments.length > i && overspillAssignments[i] != -1;
192+
boolean overspill = overspillAssignments.length > i && overspillAssignments[i] != NO_SOAR_ASSIGNMENT;
191193
OptimizedScalarQuantizer.QuantizationResult result = quantizer.scalarQuantize(
192194
vector,
193195
scratch,
@@ -220,7 +222,7 @@ CentroidOffsetAndLength buildAndWritePostingsLists(
220222
for (int i = 0; i < assignments.length; i++) {
221223
centroidVectorCount[assignments[i]]++;
222224
// if soar assignments are present, count them as well
223-
if (overspillAssignments.length > i && overspillAssignments[i] != -1) {
225+
if (overspillAssignments.length > i && overspillAssignments[i] != NO_SOAR_ASSIGNMENT) {
224226
centroidVectorCount[overspillAssignments[i]]++;
225227
}
226228
}
@@ -242,7 +244,7 @@ CentroidOffsetAndLength buildAndWritePostingsLists(
242244
// if soar assignments are present, add them to the cluster as well
243245
if (overspillAssignments.length > i) {
244246
int s = overspillAssignments[i];
245-
if (s != -1) {
247+
if (s != NO_SOAR_ASSIGNMENT) {
246248
assignmentsByCluster[s][centroidVectorCount[s]] = i;
247249
isOverspillByCluster[s][centroidVectorCount[s]++] = true;
248250
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9064000,8841051
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9081000

0 commit comments

Comments
 (0)