Skip to content

Commit 333ed60

Browse files
committed
Merge branch 'main' into retry_shard_movements_during_query
2 parents 9e2bb85 + 17c6e10 commit 333ed60

File tree

336 files changed

+6825
-2558
lines changed

Some content is hidden

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

336 files changed

+6825
-2558
lines changed

.buildkite/pipelines/intake.yml

Lines changed: 1 addition & 1 deletion
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.7", "8.17.5", "8.18.0", "8.19.0", "9.0.0", "9.1.0"]
59+
BWC_VERSION: ["8.17.6", "8.18.0", "8.19.0", "9.0.1", "9.1.0"]
6060
agents:
6161
provider: gcp
6262
image: family/elasticsearch-ubuntu-2004

.buildkite/pipelines/periodic-packaging.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ steps:
303303
env:
304304
BWC_VERSION: 8.16.7
305305

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
306+
- label: "{{matrix.image}} / 8.17.6 / packaging-tests-upgrade"
307+
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.17.6
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.5
320+
BWC_VERSION: 8.17.6
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
@@ -351,8 +351,8 @@ steps:
351351
env:
352352
BWC_VERSION: 8.19.0
353353

354-
- label: "{{matrix.image}} / 9.0.0 / packaging-tests-upgrade"
355-
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v9.0.0
354+
- label: "{{matrix.image}} / 9.0.1 / packaging-tests-upgrade"
355+
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v9.0.1
356356
timeout_in_minutes: 300
357357
matrix:
358358
setup:
@@ -365,7 +365,7 @@ steps:
365365
machineType: custom-16-32768
366366
buildDirectory: /dev/shm/bk
367367
env:
368-
BWC_VERSION: 9.0.0
368+
BWC_VERSION: 9.0.1
369369

370370
- label: "{{matrix.image}} / 9.1.0 / packaging-tests-upgrade"
371371
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v9.1.0

.buildkite/pipelines/periodic.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ steps:
325325
- signal_reason: agent_stop
326326
limit: 3
327327

328-
- label: 8.17.5 / bwc
329-
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.17.5#bwcTest
328+
- label: 8.17.6 / bwc
329+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.17.6#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.5
338+
BWC_VERSION: 8.17.6
339339
retry:
340340
automatic:
341341
- exit_status: "-1"
@@ -382,8 +382,8 @@ steps:
382382
- signal_reason: agent_stop
383383
limit: 3
384384

385-
- label: 9.0.0 / bwc
386-
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v9.0.0#bwcTest
385+
- label: 9.0.1 / bwc
386+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v9.0.1#bwcTest
387387
timeout_in_minutes: 300
388388
agents:
389389
provider: gcp
@@ -392,7 +392,7 @@ steps:
392392
buildDirectory: /dev/shm/bk
393393
preemptible: true
394394
env:
395-
BWC_VERSION: 9.0.0
395+
BWC_VERSION: 9.0.1
396396
retry:
397397
automatic:
398398
- exit_status: "-1"
@@ -486,7 +486,7 @@ steps:
486486
setup:
487487
ES_RUNTIME_JAVA:
488488
- openjdk21
489-
BWC_VERSION: ["8.16.7", "8.17.5", "8.18.0", "8.19.0", "9.0.0", "9.1.0"]
489+
BWC_VERSION: ["8.17.6", "8.18.0", "8.19.0", "9.0.1", "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.7", "8.17.5", "8.18.0", "8.19.0", "9.0.0", "9.1.0"]
536+
BWC_VERSION: ["8.17.6", "8.18.0", "8.19.0", "9.0.1", "9.1.0"]
537537
agents:
538538
provider: gcp
539539
image: family/elasticsearch-ubuntu-2004

.ci/bwcVersions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ BWC_VERSION:
1616
- "8.14.3"
1717
- "8.15.5"
1818
- "8.16.7"
19-
- "8.17.5"
19+
- "8.17.6"
2020
- "8.18.0"
2121
- "8.19.0"
22-
- "9.0.0"
22+
- "9.0.1"
2323
- "9.1.0"

.ci/snapshotBwcVersions

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
BWC_VERSION:
2-
- "8.16.7"
3-
- "8.17.5"
2+
- "8.17.6"
43
- "8.18.0"
54
- "8.19.0"
6-
- "9.0.0"
5+
- "9.0.1"
76
- "9.1.0"

benchmarks/src/main/java/org/elasticsearch/benchmark/index/codec/tsdb/TSDBDocValuesMergeBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
import java.util.concurrent.Executors;
5656
import java.util.concurrent.TimeUnit;
5757

58-
@BenchmarkMode(Mode.SampleTime)
58+
@BenchmarkMode(Mode.SingleShotTime)
5959
@OutputTimeUnit(TimeUnit.MILLISECONDS)
6060
@State(Scope.Benchmark)
6161
@Fork(1)

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.apache.lucene.store.MMapDirectory;
2020
import org.apache.lucene.util.hnsw.RandomVectorScorer;
2121
import org.apache.lucene.util.hnsw.RandomVectorScorerSupplier;
22+
import org.apache.lucene.util.hnsw.UpdateableRandomVectorScorer;
2223
import org.apache.lucene.util.quantization.QuantizedByteVectorValues;
2324
import org.apache.lucene.util.quantization.ScalarQuantizer;
2425
import org.elasticsearch.common.logging.LogConfigurator;
@@ -76,10 +77,10 @@ public class VectorScorerBenchmark {
7677
float vec2Offset;
7778
float scoreCorrectionConstant;
7879

79-
RandomVectorScorer luceneDotScorer;
80-
RandomVectorScorer luceneSqrScorer;
81-
RandomVectorScorer nativeDotScorer;
82-
RandomVectorScorer nativeSqrScorer;
80+
UpdateableRandomVectorScorer luceneDotScorer;
81+
UpdateableRandomVectorScorer luceneSqrScorer;
82+
UpdateableRandomVectorScorer nativeDotScorer;
83+
UpdateableRandomVectorScorer nativeSqrScorer;
8384

8485
RandomVectorScorer luceneDotScorerQuery;
8586
RandomVectorScorer nativeDotScorerQuery;
@@ -118,12 +119,16 @@ public void setup() throws IOException {
118119
in = dir.openInput("vector.data", IOContext.DEFAULT);
119120
var values = vectorValues(dims, 2, in, VectorSimilarityFunction.DOT_PRODUCT);
120121
scoreCorrectionConstant = values.getScalarQuantizer().getConstantMultiplier();
121-
luceneDotScorer = luceneScoreSupplier(values, VectorSimilarityFunction.DOT_PRODUCT).scorer(0);
122+
luceneDotScorer = luceneScoreSupplier(values, VectorSimilarityFunction.DOT_PRODUCT).scorer();
123+
luceneDotScorer.setScoringOrdinal(0);
122124
values = vectorValues(dims, 2, in, VectorSimilarityFunction.EUCLIDEAN);
123-
luceneSqrScorer = luceneScoreSupplier(values, VectorSimilarityFunction.EUCLIDEAN).scorer(0);
125+
luceneSqrScorer = luceneScoreSupplier(values, VectorSimilarityFunction.EUCLIDEAN).scorer();
126+
luceneSqrScorer.setScoringOrdinal(0);
124127

125-
nativeDotScorer = factory.getInt7SQVectorScorerSupplier(DOT_PRODUCT, in, values, scoreCorrectionConstant).get().scorer(0);
126-
nativeSqrScorer = factory.getInt7SQVectorScorerSupplier(EUCLIDEAN, in, values, scoreCorrectionConstant).get().scorer(0);
128+
nativeDotScorer = factory.getInt7SQVectorScorerSupplier(DOT_PRODUCT, in, values, scoreCorrectionConstant).get().scorer();
129+
nativeDotScorer.setScoringOrdinal(0);
130+
nativeSqrScorer = factory.getInt7SQVectorScorerSupplier(EUCLIDEAN, in, values, scoreCorrectionConstant).get().scorer();
131+
nativeSqrScorer.setScoringOrdinal(0);
127132

128133
// setup for getInt7SQVectorScorer / query vector scoring
129134
float[] queryVec = new float[dims];

branches.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
{
55
"branch": "main"
66
},
7-
{
8-
"branch": "8.16"
9-
},
107
{
118
"branch": "9.0"
129
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.gradle.internal.dependencies.patches.awsv2sdk;
11+
12+
import org.elasticsearch.gradle.internal.dependencies.patches.PatcherInfo;
13+
import org.elasticsearch.gradle.internal.dependencies.patches.Utils;
14+
import org.gradle.api.artifacts.transform.CacheableTransform;
15+
import org.gradle.api.artifacts.transform.InputArtifact;
16+
import org.gradle.api.artifacts.transform.TransformAction;
17+
import org.gradle.api.artifacts.transform.TransformOutputs;
18+
import org.gradle.api.artifacts.transform.TransformParameters;
19+
import org.gradle.api.file.FileSystemLocation;
20+
import org.gradle.api.provider.Provider;
21+
import org.gradle.api.tasks.Classpath;
22+
import org.jetbrains.annotations.NotNull;
23+
24+
import java.io.File;
25+
import java.util.List;
26+
27+
import static org.elasticsearch.gradle.internal.dependencies.patches.PatcherInfo.classPatcher;
28+
29+
@CacheableTransform
30+
public abstract class Awsv2ClassPatcher implements TransformAction<TransformParameters.None> {
31+
32+
private static final String JAR_FILE_TO_PATCH = "aws-query-protocol";
33+
34+
private static final List<PatcherInfo> CLASS_PATCHERS = List.of(
35+
// This patcher is needed because of this AWS bug: https://github.com/aws/aws-sdk-java-v2/issues/5968
36+
// As soon as the bug is resolved and we upgrade our AWS SDK v2 libraries, we can remove this.
37+
classPatcher(
38+
"software/amazon/awssdk/protocols/query/internal/marshall/ListQueryMarshaller.class",
39+
"213e84d9a745bdae4b844334d17aecdd6499b36df32aa73f82dc114b35043009",
40+
StringFormatInPathResolverPatcher::new
41+
)
42+
);
43+
44+
@Classpath
45+
@InputArtifact
46+
public abstract Provider<FileSystemLocation> getInputArtifact();
47+
48+
@Override
49+
public void transform(@NotNull TransformOutputs outputs) {
50+
File inputFile = getInputArtifact().get().getAsFile();
51+
52+
if (inputFile.getName().startsWith(JAR_FILE_TO_PATCH)) {
53+
System.out.println("Patching " + inputFile.getName());
54+
File outputFile = outputs.file(inputFile.getName().replace(".jar", "-patched.jar"));
55+
Utils.patchJar(inputFile, outputFile, CLASS_PATCHERS);
56+
} else {
57+
System.out.println("Skipping " + inputFile.getName());
58+
outputs.file(getInputArtifact());
59+
}
60+
}
61+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.gradle.internal.dependencies.patches.awsv2sdk;
11+
12+
import org.objectweb.asm.ClassVisitor;
13+
import org.objectweb.asm.ClassWriter;
14+
import org.objectweb.asm.MethodVisitor;
15+
import org.objectweb.asm.Type;
16+
17+
import java.util.Locale;
18+
19+
import static org.objectweb.asm.Opcodes.ASM9;
20+
import static org.objectweb.asm.Opcodes.GETSTATIC;
21+
import static org.objectweb.asm.Opcodes.INVOKESTATIC;
22+
23+
class StringFormatInPathResolverPatcher extends ClassVisitor {
24+
25+
StringFormatInPathResolverPatcher(ClassWriter classWriter) {
26+
super(ASM9, classWriter);
27+
}
28+
29+
@Override
30+
public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
31+
return new ReplaceCallMethodVisitor(super.visitMethod(access, name, descriptor, signature, exceptions));
32+
}
33+
34+
/**
35+
* Replaces calls to String.format(format, args); with calls to String.format(Locale.ROOT, format, args);
36+
*/
37+
private static class ReplaceCallMethodVisitor extends MethodVisitor {
38+
private static final String CLASS_INTERNAL_NAME = Type.getInternalName(String.class);
39+
private static final String METHOD_NAME = "format";
40+
private static final String OLD_METHOD_DESCRIPTOR = Type.getMethodDescriptor(
41+
Type.getType(String.class),
42+
Type.getType(String.class),
43+
Type.getType(Object[].class)
44+
);
45+
private static final String NEW_METHOD_DESCRIPTOR = Type.getMethodDescriptor(
46+
Type.getType(String.class),
47+
Type.getType(Locale.class),
48+
Type.getType(String.class),
49+
Type.getType(Object[].class)
50+
);
51+
52+
private boolean foundFormatPattern = false;
53+
54+
ReplaceCallMethodVisitor(MethodVisitor methodVisitor) {
55+
super(ASM9, methodVisitor);
56+
}
57+
58+
@Override
59+
public void visitLdcInsn(Object value) {
60+
if (value instanceof String s && s.startsWith("%s")) {
61+
if (foundFormatPattern) {
62+
throw new IllegalStateException(
63+
"A previous string format constant was not paired with a String.format() call. "
64+
+ "Patching would generate an unbalances stack"
65+
);
66+
}
67+
// Push the extra arg on the stack
68+
mv.visitFieldInsn(GETSTATIC, Type.getInternalName(Locale.class), "ROOT", Type.getDescriptor(Locale.class));
69+
foundFormatPattern = true;
70+
}
71+
super.visitLdcInsn(value);
72+
}
73+
74+
@Override
75+
public void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface) {
76+
if (opcode == INVOKESTATIC
77+
&& foundFormatPattern
78+
&& CLASS_INTERNAL_NAME.equals(owner)
79+
&& METHOD_NAME.equals(name)
80+
&& OLD_METHOD_DESCRIPTOR.equals(descriptor)) {
81+
// Replace the call with String.format(Locale.ROOT, format, args)
82+
mv.visitMethodInsn(INVOKESTATIC, CLASS_INTERNAL_NAME, METHOD_NAME, NEW_METHOD_DESCRIPTOR, false);
83+
foundFormatPattern = false;
84+
} else {
85+
super.visitMethodInsn(opcode, owner, name, descriptor, isInterface);
86+
}
87+
}
88+
}
89+
}

0 commit comments

Comments
 (0)