Skip to content

Commit bf2984e

Browse files
authored
Merge branch 'main' into rn-test2
2 parents f847935 + b76eed9 commit bf2984e

File tree

122 files changed

+4191
-3068
lines changed

Some content is hidden

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

122 files changed

+4191
-3068
lines changed

benchmarks/src/main/java/org/elasticsearch/benchmark/vector/scorer/VectorScorerFloat32OperationBenchmark.java

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.lang.foreign.Arena;
3232
import java.lang.foreign.MemorySegment;
3333
import java.lang.foreign.ValueLayout;
34+
import java.lang.invoke.MethodHandle;
3435
import java.nio.ByteOrder;
3536
import java.util.concurrent.ThreadLocalRandom;
3637
import java.util.concurrent.TimeUnit;
@@ -72,13 +73,8 @@ private interface LuceneFunction {
7273
float run(float[] vec1, float[] vec2);
7374
}
7475

75-
@FunctionalInterface
76-
private interface NativeFunction {
77-
float run(MemorySegment vec1, MemorySegment vec2, int length);
78-
}
79-
8076
private LuceneFunction luceneImpl;
81-
private NativeFunction nativeImpl;
77+
private MethodHandle nativeImpl;
8278

8379
@Setup(Level.Iteration)
8480
public void init() {
@@ -105,11 +101,11 @@ public void init() {
105101
case EUCLIDEAN -> VectorUtil::squareDistance;
106102
default -> throw new UnsupportedOperationException("Not used");
107103
};
108-
nativeImpl = switch (function) {
109-
case DOT_PRODUCT -> VectorScorerFloat32OperationBenchmark::dotProductFloat32;
110-
case EUCLIDEAN -> VectorScorerFloat32OperationBenchmark::squareDistanceFloat32;
111-
default -> throw new UnsupportedOperationException("Not used");
112-
};
104+
nativeImpl = vectorSimilarityFunctions.getHandle(switch (function) {
105+
case DOT_PRODUCT -> VectorSimilarityFunctions.Function.DOT_PRODUCT;
106+
case EUCLIDEAN -> VectorSimilarityFunctions.Function.SQUARE_DISTANCE;
107+
default -> throw new IllegalArgumentException(function.toString());
108+
}, VectorSimilarityFunctions.DataType.FLOAT32, VectorSimilarityFunctions.Operation.SINGLE);
113109
}
114110

115111
@TearDown
@@ -131,29 +127,21 @@ public float luceneWithCopy() {
131127

132128
@Benchmark
133129
public float nativeWithNativeSeg() {
134-
return nativeImpl.run(nativeSegA, nativeSegB, size);
130+
try {
131+
return (float) nativeImpl.invokeExact(nativeSegA, nativeSegB, size);
132+
} catch (Throwable t) {
133+
throw rethrow(t);
134+
}
135135
}
136136

137137
@Benchmark
138138
public float nativeWithHeapSeg() {
139-
return nativeImpl.run(heapSegA, heapSegB, size);
140-
}
141-
142-
static final VectorSimilarityFunctions vectorSimilarityFunctions = NativeAccess.instance().getVectorSimilarityFunctions().orElseThrow();
143-
144-
static float dotProductFloat32(MemorySegment a, MemorySegment b, int length) {
145139
try {
146-
return (float) vectorSimilarityFunctions.dotProductHandleFloat32().invokeExact(a, b, length);
147-
} catch (Throwable e) {
148-
throw rethrow(e);
140+
return (float) nativeImpl.invokeExact(heapSegA, heapSegB, size);
141+
} catch (Throwable t) {
142+
throw rethrow(t);
149143
}
150144
}
151145

152-
static float squareDistanceFloat32(MemorySegment a, MemorySegment b, int length) {
153-
try {
154-
return (float) vectorSimilarityFunctions.squareDistanceHandleFloat32().invokeExact(a, b, length);
155-
} catch (Throwable e) {
156-
throw rethrow(e);
157-
}
158-
}
146+
static final VectorSimilarityFunctions vectorSimilarityFunctions = NativeAccess.instance().getVectorSimilarityFunctions().orElseThrow();
159147
}

benchmarks/src/main/java/org/elasticsearch/benchmark/vector/scorer/VectorScorerInt7uOperationBenchmark.java

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import java.lang.foreign.Arena;
3232
import java.lang.foreign.MemorySegment;
33+
import java.lang.invoke.MethodHandle;
3334
import java.util.concurrent.TimeUnit;
3435

3536
import static org.elasticsearch.benchmark.vector.scorer.BenchmarkUtils.randomInt7BytesBetween;
@@ -67,13 +68,8 @@ private interface LuceneFunction {
6768
float run(byte[] vec1, byte[] vec2);
6869
}
6970

70-
@FunctionalInterface
71-
private interface NativeFunction {
72-
float run(MemorySegment vec1, MemorySegment vec2, int length);
73-
}
74-
7571
private LuceneFunction luceneImpl;
76-
private NativeFunction nativeImpl;
72+
private MethodHandle nativeImpl;
7773

7874
@Setup(Level.Iteration)
7975
public void init() {
@@ -97,11 +93,11 @@ public void init() {
9793
case EUCLIDEAN -> VectorUtil::squareDistance;
9894
default -> throw new UnsupportedOperationException("Not used");
9995
};
100-
nativeImpl = switch (function) {
101-
case DOT_PRODUCT -> VectorScorerInt7uOperationBenchmark::dotProduct7u;
102-
case EUCLIDEAN -> VectorScorerInt7uOperationBenchmark::squareDistance7u;
103-
default -> throw new UnsupportedOperationException("Not used");
104-
};
96+
nativeImpl = vectorSimilarityFunctions.getHandle(switch (function) {
97+
case DOT_PRODUCT -> VectorSimilarityFunctions.Function.DOT_PRODUCT;
98+
case EUCLIDEAN -> VectorSimilarityFunctions.Function.SQUARE_DISTANCE;
99+
default -> throw new IllegalArgumentException(function.toString());
100+
}, VectorSimilarityFunctions.DataType.INT7, VectorSimilarityFunctions.Operation.SINGLE);
105101
}
106102

107103
@TearDown
@@ -115,30 +111,22 @@ public float lucene() {
115111
}
116112

117113
@Benchmark
118-
public float nativeWithNativeSeg() {
119-
return nativeImpl.run(nativeSegA, nativeSegB, size);
114+
public int nativeWithNativeSeg() {
115+
try {
116+
return (int) nativeImpl.invokeExact(nativeSegA, nativeSegB, size);
117+
} catch (Throwable t) {
118+
throw rethrow(t);
119+
}
120120
}
121121

122122
@Benchmark
123123
public float nativeWithHeapSeg() {
124-
return nativeImpl.run(heapSegA, heapSegB, size);
125-
}
126-
127-
static final VectorSimilarityFunctions vectorSimilarityFunctions = NativeAccess.instance().getVectorSimilarityFunctions().orElseThrow();
128-
129-
static int dotProduct7u(MemorySegment a, MemorySegment b, int length) {
130124
try {
131-
return (int) vectorSimilarityFunctions.dotProductHandle7u().invokeExact(a, b, length);
132-
} catch (Throwable e) {
133-
throw rethrow(e);
125+
return (int) nativeImpl.invokeExact(heapSegA, heapSegB, size);
126+
} catch (Throwable t) {
127+
throw rethrow(t);
134128
}
135129
}
136130

137-
static int squareDistance7u(MemorySegment a, MemorySegment b, int length) {
138-
try {
139-
return (int) vectorSimilarityFunctions.squareDistanceHandle7u().invokeExact(a, b, length);
140-
} catch (Throwable e) {
141-
throw rethrow(e);
142-
}
143-
}
131+
static final VectorSimilarityFunctions vectorSimilarityFunctions = NativeAccess.instance().getVectorSimilarityFunctions().orElseThrow();
144132
}

distribution/docker/src/docker/dockerfiles/cloud_ess_fips/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# Extract Elasticsearch artifact
2626
################################################################################
2727
28-
FROM docker.elastic.co/wolfi/chainguard-base-fips:latest@sha256:c756ffe412df1a84c87d474ba90784e98484c1dc74500051770e67fbce456251 AS builder
28+
FROM docker.elastic.co/wolfi/chainguard-base-fips:latest@sha256:11d66ae7ec7ca1d5a7289750bdd96eb3d8eb592e5b7377f1fc8e4fb556fa7383 AS builder
2929
3030
# Install required packages to extract the Elasticsearch distribution
3131
RUN <%= retry.loop(package_manager, "export DEBIAN_FRONTEND=noninteractive && ${package_manager} update && ${package_manager} update && ${package_manager} add --no-cache curl") %>
@@ -104,7 +104,7 @@ WORKDIR /usr/share/elasticsearch/config
104104
# Add entrypoint
105105
################################################################################
106106

107-
FROM docker.elastic.co/wolfi/chainguard-base-fips:latest@sha256:c756ffe412df1a84c87d474ba90784e98484c1dc74500051770e67fbce456251
107+
FROM docker.elastic.co/wolfi/chainguard-base-fips:latest@sha256:11d66ae7ec7ca1d5a7289750bdd96eb3d8eb592e5b7377f1fc8e4fb556fa7383
108108

109109
RUN <%= retry.loop(package_manager,
110110
"export DEBIAN_FRONTEND=noninteractive && \n" +

distribution/docker/src/docker/dockerfiles/wolfi/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# Extract Elasticsearch artifact
2626
################################################################################
2727
28-
FROM docker.elastic.co/wolfi/chainguard-base:latest@sha256:2eae982b1ace31929369639fe4eefd38f3b12e85a5d5843f541c0cfc14045e27 AS builder
28+
FROM docker.elastic.co/wolfi/chainguard-base:latest@sha256:b5a03b6a754fa2f9a29e44e316a6c4df1f606cd8a3cd8810ce3d6a3a3134428b AS builder
2929
3030
# Install required packages to extract the Elasticsearch distribution
3131
RUN <%= retry.loop(package_manager, "export DEBIAN_FRONTEND=noninteractive && ${package_manager} update && ${package_manager} update && ${package_manager} add --no-cache curl") %>
@@ -80,7 +80,7 @@ RUN sed -i -e 's/ES_DISTRIBUTION_TYPE=tar/ES_DISTRIBUTION_TYPE=docker/' bin/elas
8080
# Add entrypoint
8181
################################################################################
8282

83-
FROM docker.elastic.co/wolfi/chainguard-base:latest@sha256:2eae982b1ace31929369639fe4eefd38f3b12e85a5d5843f541c0cfc14045e27
83+
FROM docker.elastic.co/wolfi/chainguard-base:latest@sha256:b5a03b6a754fa2f9a29e44e316a6c4df1f606cd8a3cd8810ce3d6a3a3134428b
8484

8585
RUN <%= retry.loop(package_manager,
8686
"export DEBIAN_FRONTEND=noninteractive && \n" +

docs/changelog/140478.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 140478
2+
summary: T digest field type docs
3+
area: Mapping
4+
type: enhancement
5+
issues: []

docs/changelog/141179.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 141179
2+
summary: Add `SparseFileTracker.getAbsentBytesWithin`
3+
area: Searchable Snapshots
4+
type: enhancement
5+
issues: []

docs/changelog/141185.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 141185
2+
summary: Add `max_batch_size` setting to EIS dense and sparse service settings
3+
area: Inference
4+
type: enhancement
5+
issues: []

docs/changelog/141237.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 141237
2+
summary: Introduce adaptive block hash for long/int
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

docs/changelog/141323.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 141323
2+
summary: Fix race condition in `CancellableRateLimitedFluxIterator`
3+
area: Snapshot/Restore
4+
type: bug
5+
issues: []

docs/reference/elasticsearch/configuration-reference/discovery-cluster-formation-settings.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ $$$fault-detection-settings$$$`cluster.fault_detection.follower_check.interval`
9797
`cluster.follower_lag.timeout`
9898
: ([Static](docs-content://deploy-manage/stack-settings.md#static-cluster-setting)) Sets how long the master node waits to receive acknowledgements for cluster state updates from lagging nodes. The default value is `90s`. If a node does not successfully apply the cluster state update within this period of time, it is considered to have failed and is removed from the cluster. See [Publishing the cluster state](docs-content://deploy-manage/distributed-architecture/discovery-cluster-formation/cluster-state-overview.md#cluster-state-publishing).
9999

100+
{applies_to}`stack: ga 9.4` The value `-1` means that the master node will wait indefinitely for cluster state updates to be acknowledged.
101+
100102
`cluster.max_voting_config_exclusions`
101103
: ([Dynamic](docs-content://deploy-manage/stack-settings.md#dynamic-cluster-setting)) Sets a limit on the number of voting configuration exclusions at any one time. The default value is `10`. See [*Add and remove nodes in your cluster*](docs-content://deploy-manage/maintenance/add-and-remove-elasticsearch-nodes.md).
102104

0 commit comments

Comments
 (0)