Skip to content

Commit 5554bc2

Browse files
Merge branch 'main' into threadpool-merge-scheduler-sort-all-merges
2 parents 4099ac5 + be7635e commit 5554bc2

File tree

270 files changed

+9527
-3112
lines changed

Some content is hidden

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

270 files changed

+9527
-3112
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/*.interp li
1111
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer*.java linguist-generated=true
1212
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser*.java linguist-generated=true
1313
x-pack/plugin/esql/src/main/generated/** linguist-generated=true
14+
x-pack/plugin/esql/src/main/generated-src/** linguist-generated=true
1415

1516
# ESQL functions docs are autogenerated. More information at `docs/reference/esql/functions/README.md`
1617
docs/reference/esql/functions/*/** linguist-generated=true

benchmarks/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,12 @@ exit
126126
Grab the async profiler from https://github.com/jvm-profiling-tools/async-profiler
127127
and run `prof async` like so:
128128
```
129-
gradlew -p benchmarks/ run --args 'LongKeyedBucketOrdsBenchmark.multiBucket -prof "async:libPath=/home/nik9000/Downloads/tmp/async-profiler-1.8.3-linux-x64/build/libasyncProfiler.so;dir=/tmp/prof;output=flamegraph"'
129+
gradlew -p benchmarks/ run --args 'LongKeyedBucketOrdsBenchmark.multiBucket -prof "async:libPath=/home/nik9000/Downloads/async-profiler-3.0-29ee888-linux-x64/lib/libasyncProfiler.so;dir=/tmp/prof;output=flamegraph"'
130130
```
131131

132+
Note: As of January 2025 the latest release of async profiler doesn't work
133+
with our JDK but the nightly is fine.
134+
132135
If you are on Mac, this'll warn you that you downloaded the shared library from
133136
the internet. You'll need to go to settings and allow it to run.
134137

benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/EvalBenchmark.java

Lines changed: 79 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import org.elasticsearch.xpack.esql.expression.function.scalar.date.DateTrunc;
3939
import org.elasticsearch.xpack.esql.expression.function.scalar.math.Abs;
4040
import org.elasticsearch.xpack.esql.expression.function.scalar.multivalue.MvMin;
41+
import org.elasticsearch.xpack.esql.expression.function.scalar.nulls.Coalesce;
4142
import org.elasticsearch.xpack.esql.expression.function.scalar.string.RLike;
4243
import org.elasticsearch.xpack.esql.expression.predicate.operator.arithmetic.Add;
4344
import org.elasticsearch.xpack.esql.expression.predicate.operator.comparison.Equals;
@@ -96,6 +97,9 @@ public class EvalBenchmark {
9697
"add_double",
9798
"case_1_eager",
9899
"case_1_lazy",
100+
"coalesce_2_noop",
101+
"coalesce_2_eager",
102+
"coalesce_2_lazy",
99103
"date_trunc",
100104
"equal_to_const",
101105
"long_equal_to_long",
@@ -142,8 +146,34 @@ private static EvalOperator.ExpressionEvaluator evaluator(String operation) {
142146
lhs = new Add(Source.EMPTY, lhs, new Literal(Source.EMPTY, 1L, DataType.LONG));
143147
rhs = new Add(Source.EMPTY, rhs, new Literal(Source.EMPTY, 1L, DataType.LONG));
144148
}
145-
yield EvalMapper.toEvaluator(FOLD_CONTEXT, new Case(Source.EMPTY, condition, List.of(lhs, rhs)), layout(f1, f2))
146-
.get(driverContext);
149+
EvalOperator.ExpressionEvaluator evaluator = EvalMapper.toEvaluator(
150+
FOLD_CONTEXT,
151+
new Case(Source.EMPTY, condition, List.of(lhs, rhs)),
152+
layout(f1, f2)
153+
).get(driverContext);
154+
String desc = operation.endsWith("lazy") ? "CaseLazyEvaluator" : "CaseEagerEvaluator";
155+
if (evaluator.toString().contains(desc) == false) {
156+
throw new IllegalArgumentException("Evaluator was [" + evaluator + "] but expected one containing [" + desc + "]");
157+
}
158+
yield evaluator;
159+
}
160+
case "coalesce_2_noop", "coalesce_2_eager", "coalesce_2_lazy" -> {
161+
FieldAttribute f1 = longField();
162+
FieldAttribute f2 = longField();
163+
Expression lhs = f1;
164+
if (operation.endsWith("lazy")) {
165+
lhs = new Add(Source.EMPTY, lhs, new Literal(Source.EMPTY, 1L, DataType.LONG));
166+
}
167+
EvalOperator.ExpressionEvaluator evaluator = EvalMapper.toEvaluator(
168+
FOLD_CONTEXT,
169+
new Coalesce(Source.EMPTY, lhs, List.of(f2)),
170+
layout(f1, f2)
171+
).get(driverContext);
172+
String desc = operation.endsWith("lazy") ? "CoalesceLazyEvaluator" : "CoalesceEagerEvaluator";
173+
if (evaluator.toString().contains(desc) == false) {
174+
throw new IllegalArgumentException("Evaluator was [" + evaluator + "] but expected one containing [" + desc + "]");
175+
}
176+
yield evaluator;
147177
}
148178
case "date_trunc" -> {
149179
FieldAttribute timestamp = new FieldAttribute(
@@ -260,6 +290,38 @@ private static void checkExpected(String operation, Page actual) {
260290
}
261291
}
262292
}
293+
case "coalesce_2_noop" -> {
294+
LongVector f1 = actual.<LongBlock>getBlock(0).asVector();
295+
LongVector result = actual.<LongBlock>getBlock(2).asVector();
296+
for (int i = 0; i < BLOCK_LENGTH; i++) {
297+
long expected = f1.getLong(i);
298+
if (result.getLong(i) != expected) {
299+
throw new AssertionError("[" + operation + "] expected [" + expected + "] but was [" + result.getLong(i) + "]");
300+
}
301+
}
302+
}
303+
case "coalesce_2_eager" -> {
304+
LongBlock f1 = actual.<LongBlock>getBlock(0);
305+
LongVector f2 = actual.<LongBlock>getBlock(1).asVector();
306+
LongVector result = actual.<LongBlock>getBlock(2).asVector();
307+
for (int i = 0; i < BLOCK_LENGTH; i++) {
308+
long expected = i % 5 == 0 ? f2.getLong(i) : f1.getLong(f1.getFirstValueIndex(i));
309+
if (result.getLong(i) != expected) {
310+
throw new AssertionError("[" + operation + "] expected [" + expected + "] but was [" + result.getLong(i) + "]");
311+
}
312+
}
313+
}
314+
case "coalesce_2_lazy" -> {
315+
LongBlock f1 = actual.<LongBlock>getBlock(0);
316+
LongVector f2 = actual.<LongBlock>getBlock(1).asVector();
317+
LongVector result = actual.<LongBlock>getBlock(2).asVector();
318+
for (int i = 0; i < BLOCK_LENGTH; i++) {
319+
long expected = i % 5 == 0 ? f2.getLong(i) : f1.getLong(f1.getFirstValueIndex(i)) + 1;
320+
if (result.getLong(i) != expected) {
321+
throw new AssertionError("[" + operation + "] expected [" + expected + "] but was [" + result.getLong(i) + "]");
322+
}
323+
}
324+
}
263325
case "date_trunc" -> {
264326
LongVector v = actual.<LongBlock>getBlock(1).asVector();
265327
long oneDay = TimeValue.timeValueHours(24).millis();
@@ -304,7 +366,7 @@ private static void checkExpected(String operation, Page actual) {
304366
}
305367
}
306368
}
307-
default -> throw new UnsupportedOperationException();
369+
default -> throw new UnsupportedOperationException(operation);
308370
}
309371
}
310372

@@ -324,7 +386,7 @@ private static Page page(String operation) {
324386
}
325387
yield new Page(builder.build());
326388
}
327-
case "case_1_eager", "case_1_lazy" -> {
389+
case "case_1_eager", "case_1_lazy", "coalesce_2_noop" -> {
328390
var f1 = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
329391
var f2 = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
330392
for (int i = 0; i < BLOCK_LENGTH; i++) {
@@ -333,6 +395,19 @@ private static Page page(String operation) {
333395
}
334396
yield new Page(f1.build(), f2.build());
335397
}
398+
case "coalesce_2_eager", "coalesce_2_lazy" -> {
399+
var f1 = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
400+
var f2 = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
401+
for (int i = 0; i < BLOCK_LENGTH; i++) {
402+
if (i % 5 == 0) {
403+
f1.appendNull();
404+
} else {
405+
f1.appendLong(i);
406+
}
407+
f2.appendLong(-i);
408+
}
409+
yield new Page(f1.build(), f2.build());
410+
}
336411
case "long_equal_to_long" -> {
337412
var lhs = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
338413
var rhs = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);

benchmarks/src/main/java/org/elasticsearch/benchmark/script/ScriptScoreBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public class ScriptScoreBenchmark {
7878
private final PluginsService pluginsService = new PluginsService(
7979
Settings.EMPTY,
8080
null,
81-
PluginsLoader.createPluginsLoader(Set.of(), PluginsLoader.loadPluginsBundles(Path.of(System.getProperty("plugins.dir"))))
81+
PluginsLoader.createPluginsLoader(Set.of(), PluginsLoader.loadPluginsBundles(Path.of(System.getProperty("plugins.dir"))), Map.of())
8282
);
8383
private final ScriptModule scriptModule = new ScriptModule(Settings.EMPTY, pluginsService.filterPlugins(ScriptPlugin.class).toList());
8484

distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/SystemJvmOptions.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.io.IOException;
1919
import java.nio.file.Files;
2020
import java.nio.file.Path;
21+
import java.util.ArrayList;
2122
import java.util.List;
2223
import java.util.Map;
2324
import java.util.stream.Stream;
@@ -69,7 +70,7 @@ static List<String> systemJvmOptions(Settings nodeSettings, final Map<String, St
6970
// Pass through distribution type
7071
"-Des.distribution.type=" + distroType
7172
),
72-
maybeEnableNativeAccess(),
73+
maybeEnableNativeAccess(useEntitlements),
7374
maybeOverrideDockerCgroup(distroType),
7475
maybeSetActiveProcessorCount(nodeSettings),
7576
maybeSetReplayFile(distroType, isHotspot),
@@ -124,11 +125,18 @@ private static Stream<String> maybeSetActiveProcessorCount(Settings nodeSettings
124125
return Stream.empty();
125126
}
126127

127-
private static Stream<String> maybeEnableNativeAccess() {
128+
private static Stream<String> maybeEnableNativeAccess(boolean useEntitlements) {
129+
var enableNativeAccessOptions = new ArrayList<String>();
128130
if (Runtime.version().feature() >= 21) {
129-
return Stream.of("--enable-native-access=org.elasticsearch.nativeaccess,org.apache.lucene.core");
131+
enableNativeAccessOptions.add("--enable-native-access=org.elasticsearch.nativeaccess,org.apache.lucene.core");
132+
if (useEntitlements) {
133+
enableNativeAccessOptions.add("--enable-native-access=ALL-UNNAMED");
134+
if (Runtime.version().feature() >= 24) {
135+
enableNativeAccessOptions.add("--illegal-native-access=deny");
136+
}
137+
}
130138
}
131-
return Stream.empty();
139+
return enableNativeAccessOptions.stream();
132140
}
133141

134142
/*

docs/changelog/118122.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 118122
2+
summary: "ES|QL: Partial result on demand for async queries"
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

docs/changelog/119072.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
pr: 119072
2+
summary: Turn `_source` meta fieldmapper's mode attribute into a no-op
3+
area: Mapping
4+
type: breaking
5+
issues:
6+
- 118596
7+
breaking:
8+
title: Turn `_source` meta fieldmapper's mode attribute into a no-op
9+
area: Mapping
10+
details: The `mode` mapping attribute of `_source` metadata field mapper has been turned into a no-op. Instead the `index.mapping.source.mode` index setting should be used to configure source mode.
11+
impact: Configuring the `mode` attribute for the `_source` meta field mapper will have no effect on indices created with Elasticsearch 9.0.0 or later. Note that `_source.mode` configured on indices before upgrading to 9.0.0 or later will remain efficive after upgrading.
12+
notable: false

docs/changelog/120256.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pr: 120256
2+
summary: Improve memory aspects of enrich cache
3+
area: Ingest Node
4+
type: enhancement
5+
issues:
6+
- 96050
7+
- 120021

docs/changelog/120645.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 120645
2+
summary: Esql Support date nanos on date diff function
3+
area: ES|QL
4+
type: enhancement
5+
issues:
6+
- 109999

docs/changelog/120722.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120722
2+
summary: Migrate stream to core error parsing
3+
area: Machine Learning
4+
type: enhancement
5+
issues: []

0 commit comments

Comments
 (0)