Skip to content

Commit b822d40

Browse files
Merge branch 'main' into 125483
2 parents 4addc41 + 722a1b4 commit b822d40

File tree

273 files changed

+4698
-1416
lines changed

Some content is hidden

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

273 files changed

+4698
-1416
lines changed

.buildkite/pipelines/intake.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ steps:
5656
timeout_in_minutes: 300
5757
matrix:
5858
setup:
59-
BWC_VERSION: ["8.16.6", "8.17.4", "8.18.0", "8.19.0", "9.0.0", "9.1.0"]
59+
BWC_VERSION: ["8.16.7", "8.17.5", "8.18.0", "8.19.0", "9.0.0", "9.1.0"]
6060
agents:
6161
provider: gcp
6262
image: family/elasticsearch-ubuntu-2004

.buildkite/pipelines/periodic-packaging.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ steps:
287287
env:
288288
BWC_VERSION: 8.15.5
289289

290-
- label: "{{matrix.image}} / 8.16.6 / packaging-tests-upgrade"
291-
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.16.6
290+
- label: "{{matrix.image}} / 8.16.7 / packaging-tests-upgrade"
291+
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.16.7
292292
timeout_in_minutes: 300
293293
matrix:
294294
setup:
@@ -301,10 +301,10 @@ steps:
301301
machineType: custom-16-32768
302302
buildDirectory: /dev/shm/bk
303303
env:
304-
BWC_VERSION: 8.16.6
304+
BWC_VERSION: 8.16.7
305305

306-
- label: "{{matrix.image}} / 8.17.4 / packaging-tests-upgrade"
307-
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.17.4
306+
- label: "{{matrix.image}} / 8.17.5 / packaging-tests-upgrade"
307+
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.17.5
308308
timeout_in_minutes: 300
309309
matrix:
310310
setup:
@@ -317,7 +317,7 @@ steps:
317317
machineType: custom-16-32768
318318
buildDirectory: /dev/shm/bk
319319
env:
320-
BWC_VERSION: 8.17.4
320+
BWC_VERSION: 8.17.5
321321

322322
- label: "{{matrix.image}} / 8.18.0 / packaging-tests-upgrade"
323323
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.18.0

.buildkite/pipelines/periodic.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ steps:
306306
- signal_reason: agent_stop
307307
limit: 3
308308

309-
- label: 8.16.6 / bwc
310-
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.16.6#bwcTest
309+
- label: 8.16.7 / bwc
310+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.16.7#bwcTest
311311
timeout_in_minutes: 300
312312
agents:
313313
provider: gcp
@@ -316,7 +316,7 @@ steps:
316316
buildDirectory: /dev/shm/bk
317317
preemptible: true
318318
env:
319-
BWC_VERSION: 8.16.6
319+
BWC_VERSION: 8.16.7
320320
retry:
321321
automatic:
322322
- exit_status: "-1"
@@ -325,8 +325,8 @@ steps:
325325
- signal_reason: agent_stop
326326
limit: 3
327327

328-
- label: 8.17.4 / bwc
329-
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.17.4#bwcTest
328+
- label: 8.17.5 / bwc
329+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.17.5#bwcTest
330330
timeout_in_minutes: 300
331331
agents:
332332
provider: gcp
@@ -335,7 +335,7 @@ steps:
335335
buildDirectory: /dev/shm/bk
336336
preemptible: true
337337
env:
338-
BWC_VERSION: 8.17.4
338+
BWC_VERSION: 8.17.5
339339
retry:
340340
automatic:
341341
- exit_status: "-1"
@@ -486,7 +486,7 @@ steps:
486486
setup:
487487
ES_RUNTIME_JAVA:
488488
- openjdk21
489-
BWC_VERSION: ["8.16.6", "8.17.4", "8.18.0", "8.19.0", "9.0.0", "9.1.0"]
489+
BWC_VERSION: ["8.16.7", "8.17.5", "8.18.0", "8.19.0", "9.0.0", "9.1.0"]
490490
agents:
491491
provider: gcp
492492
image: family/elasticsearch-ubuntu-2004
@@ -533,7 +533,7 @@ steps:
533533
ES_RUNTIME_JAVA:
534534
- openjdk21
535535
- openjdk23
536-
BWC_VERSION: ["8.16.6", "8.17.4", "8.18.0", "8.19.0", "9.0.0", "9.1.0"]
536+
BWC_VERSION: ["8.16.7", "8.17.5", "8.18.0", "8.19.0", "9.0.0", "9.1.0"]
537537
agents:
538538
provider: gcp
539539
image: family/elasticsearch-ubuntu-2004

.ci/bwcVersions

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ BWC_VERSION:
1515
- "8.13.4"
1616
- "8.14.3"
1717
- "8.15.5"
18-
- "8.16.6"
19-
- "8.17.4"
18+
- "8.16.7"
19+
- "8.17.5"
2020
- "8.18.0"
2121
- "8.19.0"
2222
- "9.0.0"

.ci/snapshotBwcVersions

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BWC_VERSION:
2-
- "8.16.6"
3-
- "8.17.4"
2+
- "8.16.7"
3+
- "8.17.5"
44
- "8.18.0"
55
- "8.19.0"
66
- "9.0.0"

benchmarks/src/main/java/org/elasticsearch/benchmark/vector/DistanceFunctionBenchmark.java

+31-16
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import org.elasticsearch.common.logging.LogConfigurator;
1414
import org.elasticsearch.index.IndexVersion;
1515
import org.elasticsearch.script.field.vectors.BinaryDenseVector;
16+
import org.elasticsearch.script.field.vectors.BitBinaryDenseVector;
17+
import org.elasticsearch.script.field.vectors.BitKnnDenseVector;
1618
import org.elasticsearch.script.field.vectors.ByteBinaryDenseVector;
1719
import org.elasticsearch.script.field.vectors.ByteKnnDenseVector;
1820
import org.elasticsearch.script.field.vectors.DenseVector;
@@ -37,30 +39,30 @@
3739
import java.util.function.DoubleSupplier;
3840

3941
/**
40-
* Various benchmarks for the distance functions
41-
* used by indexed and non-indexed vectors.
42-
* Parameters include element, dims, function, and type.
42+
* Various benchmarks for the distance functions used by indexed and non-indexed vectors.
43+
* Parameters include doc and query type, dims, function, and implementation.
4344
* For individual local tests it may be useful to increase
44-
* fork, measurement, and operations per invocation. (Note
45-
* to also update the benchmark loop if operations per invocation
46-
* is increased.)
45+
* fork, measurement, and operations per invocation.
4746
*/
4847
@Fork(1)
4948
@Warmup(iterations = 1)
5049
@Measurement(iterations = 2)
5150
@BenchmarkMode(Mode.AverageTime)
5251
@OutputTimeUnit(TimeUnit.NANOSECONDS)
53-
@OperationsPerInvocation(25000)
52+
@OperationsPerInvocation(DistanceFunctionBenchmark.OPERATIONS)
5453
@State(Scope.Benchmark)
5554
public class DistanceFunctionBenchmark {
5655

56+
public static final int OPERATIONS = 25000;
57+
5758
static {
5859
LogConfigurator.configureESLogging();
5960
}
6061

6162
public enum VectorType {
6263
FLOAT,
63-
BYTE
64+
BYTE,
65+
BIT
6466
}
6567

6668
public enum Function {
@@ -122,7 +124,7 @@ private static BytesRef generateVectorData(float[] vector) {
122124
}
123125

124126
private static BytesRef generateVectorData(float[] vector, float mag) {
125-
ByteBuffer buffer = ByteBuffer.allocate(vector.length * 4 + 4);
127+
ByteBuffer buffer = ByteBuffer.allocate(vector.length * Float.BYTES + Float.BYTES);
126128
for (float f : vector) {
127129
buffer.putFloat(f);
128130
}
@@ -133,24 +135,29 @@ private static BytesRef generateVectorData(float[] vector, float mag) {
133135
private static BytesRef generateVectorData(byte[] vector) {
134136
float mag = calculateMag(vector);
135137

136-
ByteBuffer buffer = ByteBuffer.allocate(vector.length + 4);
138+
ByteBuffer buffer = ByteBuffer.allocate(vector.length + Float.BYTES);
137139
buffer.put(vector);
138140
buffer.putFloat(mag);
139141
return new BytesRef(buffer.array());
140142
}
141143

142144
@Setup
143145
public void findBenchmarkImpl() {
146+
if (dims % 8 != 0) throw new IllegalArgumentException("Dims must be a multiple of 8");
144147
Random r = new Random();
145148

146149
float[] floatDocVector = new float[dims];
147150
byte[] byteDocVector = new byte[dims];
151+
byte[] bitDocVector = new byte[dims / 8];
148152

149153
float[] floatQueryVector = new float[dims];
150154
byte[] byteQueryVector = new byte[dims];
155+
byte[] bitQueryVector = new byte[dims / 8];
151156

152157
r.nextBytes(byteDocVector);
158+
r.nextBytes(bitDocVector);
153159
r.nextBytes(byteQueryVector);
160+
r.nextBytes(bitQueryVector);
154161
for (int i = 0; i < dims; i++) {
155162
floatDocVector[i] = r.nextFloat();
156163
floatQueryVector[i] = r.nextFloat();
@@ -179,10 +186,11 @@ public void findBenchmarkImpl() {
179186
};
180187
case BYTE -> switch (type) {
181188
case KNN -> new ByteKnnDenseVector(byteDocVector);
182-
case BINARY -> {
183-
BytesRef vectorData = generateVectorData(byteDocVector);
184-
yield new ByteBinaryDenseVector(byteDocVector, vectorData, dims);
185-
}
189+
case BINARY -> new ByteBinaryDenseVector(byteDocVector, generateVectorData(byteDocVector), dims);
190+
};
191+
case BIT -> switch (type) {
192+
case KNN -> new BitKnnDenseVector(bitDocVector);
193+
case BINARY -> new BitBinaryDenseVector(bitDocVector, new BytesRef(bitDocVector), bitDocVector.length);
186194
};
187195
};
188196

@@ -204,21 +212,28 @@ public void findBenchmarkImpl() {
204212
case L2 -> () -> vectorImpl.l2Norm(byteQueryVector);
205213
case HAMMING -> () -> vectorImpl.hamming(byteQueryVector);
206214
};
215+
case BIT -> switch (function) {
216+
case DOT -> () -> vectorImpl.dotProduct(bitQueryVector);
217+
case COSINE -> throw new UnsupportedOperationException("Unsupported function " + function);
218+
case L1 -> () -> vectorImpl.l1Norm(bitQueryVector);
219+
case L2 -> () -> vectorImpl.l2Norm(bitQueryVector);
220+
case HAMMING -> () -> vectorImpl.hamming(bitQueryVector);
221+
};
207222
};
208223
}
209224

210225
@Fork(1)
211226
@Benchmark
212227
public void benchmark(Blackhole blackhole) {
213-
for (int i = 0; i < 25000; ++i) {
228+
for (int i = 0; i < OPERATIONS; ++i) {
214229
blackhole.consume(benchmarkImpl.getAsDouble());
215230
}
216231
}
217232

218233
@Fork(value = 1, jvmArgsPrepend = { "--add-modules=jdk.incubator.vector" })
219234
@Benchmark
220235
public void vectorBenchmark(Blackhole blackhole) {
221-
for (int i = 0; i < 25000; ++i) {
236+
for (int i = 0; i < OPERATIONS; ++i) {
222237
blackhole.consume(benchmarkImpl.getAsDouble());
223238
}
224239
}

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/RestrictedBuildApiService.java

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
6161
map.put(LegacyRestTestBasePlugin.class, ":qa:smoke-test-ingest-with-all-dependencies");
6262
map.put(LegacyRestTestBasePlugin.class, ":qa:smoke-test-plugins");
6363
map.put(LegacyRestTestBasePlugin.class, ":qa:system-indices");
64-
map.put(LegacyRestTestBasePlugin.class, ":qa:verify-version-constants");
6564
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-apm-integration");
6665
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-delayed-aggs");
6766
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-die-with-dignity");

build.gradle

+11-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,16 @@ allprojects {
295295
tasks.register('resolveAllDependencies', ResolveAllDependencies) {
296296
def ignoredPrefixes = [DistributionDownloadPlugin.ES_DISTRO_CONFIG_PREFIX, "jdbcDriver"]
297297
configs = project.configurations.matching { config -> ignoredPrefixes.any { config.name.startsWith(it) } == false }
298-
resolveJavaToolChain = true
298+
if(project.path == ':') {
299+
resolveJavaToolChain = true
300+
301+
// ensure we have best possible caching of bwc builds
302+
dependsOn ":distribution:bwc:bugfix:buildBwcLinuxTar"
303+
dependsOn ":distribution:bwc:bugfix2:buildBwcLinuxTar"
304+
dependsOn ":distribution:bwc:minor:buildBwcLinuxTar"
305+
dependsOn ":distribution:bwc:staged:buildBwcLinuxTar"
306+
dependsOn ":distribution:bwc:staged2:buildBwcLinuxTar"
307+
}
299308
if (project.path.contains("fixture")) {
300309
dependsOn tasks.withType(ComposePull)
301310
}
@@ -306,6 +315,7 @@ allprojects {
306315
// ensure we resolve p2 dependencies for the spotless eclipse formatter
307316
dependsOn "spotlessJavaCheck"
308317
}
318+
309319
}
310320

311321
ext.withReleaseBuild = { Closure config ->

docs/build.gradle

+27
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import org.elasticsearch.gradle.Version
2+
import org.elasticsearch.gradle.VersionProperties
23
import org.elasticsearch.gradle.internal.doc.DocSnippetTask
34
import static org.elasticsearch.gradle.testclusters.TestDistribution.DEFAULT
45

@@ -2059,3 +2060,29 @@ setups['setup-snapshots'] = setups['setup-repository'] + '''
20592060
setups['atomic_red_regsvr32'].replace('#atomic_red_data#', events)
20602061
}
20612062
}
2063+
2064+
tasks.register('verifyDocsLuceneVersion') {
2065+
doFirst {
2066+
File docsVersionsFile = file('Versions.asciidoc')
2067+
List<String> versionLines = docsVersionsFile.readLines('UTF-8')
2068+
String docsLuceneVersion = null
2069+
for (String line : versionLines) {
2070+
if (line.startsWith(':lucene_version:')) {
2071+
docsLuceneVersion = line.split()[1]
2072+
}
2073+
}
2074+
if (docsLuceneVersion == null) {
2075+
throw new GradleException('Could not find lucene version in docs version file')
2076+
}
2077+
String expectedLuceneVersion = VersionProperties.lucene
2078+
// remove potential -snapshot-{gitrev} suffix
2079+
expectedLuceneVersion -= ~/-snapshot-[0-9a-f]+$/
2080+
if (docsLuceneVersion != expectedLuceneVersion) {
2081+
throw new GradleException("Lucene version in docs [${docsLuceneVersion}] does not match version.properties [${expectedLuceneVersion}]")
2082+
}
2083+
}
2084+
}
2085+
2086+
tasks.named('check') {
2087+
dependsOn 'verifyDocsLuceneVersion'
2088+
}

docs/changelog/119886.yaml

-5
This file was deleted.

docs/changelog/121392.yaml

-5
This file was deleted.

docs/changelog/121667.yaml

-11
This file was deleted.

docs/changelog/121787.yaml

-6
This file was deleted.

docs/changelog/121793.yaml

-5
This file was deleted.

docs/changelog/121971.yaml

-5
This file was deleted.

docs/changelog/122074.yaml

-8
This file was deleted.

docs/changelog/122257.yaml

-5
This file was deleted.

docs/changelog/122278.yaml

-5
This file was deleted.

docs/changelog/122293.yaml

-5
This file was deleted.

0 commit comments

Comments
 (0)