Skip to content

Commit 1959957

Browse files
authored
Merge branch '8.19' into 819-fix-skip-upgrade-test
2 parents 8aded6d + a0da0d7 commit 1959957

File tree

198 files changed

+4008
-3591
lines changed

Some content is hidden

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

198 files changed

+4008
-3591
lines changed

.github/workflows/gradle-wrapper-validation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ jobs:
99
name: "Validation"
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # Release v2.1.1
12+
- uses: actions/checkout@v4
13+
- uses: gradle/actions/wrapper-validation@ac638b010cf58a27ee6c972d7336334ccaf61c96 # Release v4.4.1

benchmarks/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,10 @@ exit
152152
Grab the async profiler from https://github.com/jvm-profiling-tools/async-profiler
153153
and run `prof async` like so:
154154
```
155-
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"'
155+
gradlew -p benchmarks/ run --args 'LongKeyedBucketOrdsBenchmark.multiBucket -prof "async:libPath=/home/nik9000/Downloads/async-profiler-4.0-linux-x64/lib/libasyncProfiler.so;dir=/tmp/prof;output=flamegraph"'
156156
```
157157

158-
Note: As of January 2025 the latest release of async profiler doesn't work
159-
with our JDK but the nightly is fine.
158+
Note: As of July 2025 the 4.0 release of the async profiler works well.
160159

161160
If you are on Mac, this'll warn you that you downloaded the shared library from
162161
the internet. You'll need to go to settings and allow it to run.

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
import org.apache.lucene.util.BytesRef;
2525
import org.apache.lucene.util.NumericUtils;
2626
import org.elasticsearch.common.breaker.NoopCircuitBreaker;
27+
import org.elasticsearch.common.logging.LogConfigurator;
2728
import org.elasticsearch.common.lucene.Lucene;
2829
import org.elasticsearch.common.settings.Settings;
30+
import org.elasticsearch.common.unit.ByteSizeValue;
2931
import org.elasticsearch.common.util.BigArrays;
3032
import org.elasticsearch.compute.data.BlockFactory;
3133
import org.elasticsearch.compute.data.BytesRefBlock;
@@ -84,10 +86,13 @@
8486
@State(Scope.Thread)
8587
@Fork(1)
8688
public class ValuesSourceReaderBenchmark {
89+
static {
90+
LogConfigurator.configureESLogging();
91+
}
92+
8793
private static final int BLOCK_LENGTH = 16 * 1024;
8894
private static final int INDEX_SIZE = 10 * BLOCK_LENGTH;
8995
private static final int COMMIT_INTERVAL = 500;
90-
private static final BigArrays BIG_ARRAYS = BigArrays.NON_RECYCLING_INSTANCE;
9196
private static final BlockFactory blockFactory = BlockFactory.getInstance(
9297
new NoopCircuitBreaker("noop"),
9398
BigArrays.NON_RECYCLING_INSTANCE
@@ -296,6 +301,7 @@ private static BlockLoader numericBlockLoader(WhereAndBaseName w, NumberFieldMap
296301
public void benchmark() {
297302
ValuesSourceReaderOperator op = new ValuesSourceReaderOperator(
298303
blockFactory,
304+
ByteSizeValue.ofMb(1).getBytes(),
299305
fields(name),
300306
List.of(new ValuesSourceReaderOperator.ShardContext(reader, () -> {
301307
throw new UnsupportedOperationException("can't load _source here");

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

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import java.io.File;
3535
import java.util.List;
3636
import java.util.Map;
37+
import java.util.Set;
3738
import java.util.stream.Stream;
3839

3940
import javax.inject.Inject;
@@ -50,6 +51,8 @@ public abstract class ElasticsearchTestBasePlugin implements Plugin<Project> {
5051

5152
public static final String DUMP_OUTPUT_ON_FAILURE_PROP_NAME = "dumpOutputOnFailure";
5253

54+
public static final Set<String> TEST_TASKS_WITH_ENTITLEMENTS = Set.of("test", "internalClusterTest");
55+
5356
@Inject
5457
protected abstract ProviderFactory getProviderFactory();
5558

@@ -173,14 +176,23 @@ public void execute(Task t) {
173176
nonInputProperties.systemProperty("workspace.dir", Util.locateElasticsearchWorkspace(project.getGradle()));
174177
// we use 'temp' relative to CWD since this is per JVM and tests are forbidden from writing to CWD
175178
nonInputProperties.systemProperty("java.io.tmpdir", test.getWorkingDir().toPath().resolve("temp"));
179+
if (test.getName().equals("internalClusterTest")) {
180+
// configure a node home directory independent of the Java temp dir so that entitlements can be properly enforced
181+
nonInputProperties.systemProperty("tempDir", test.getWorkingDir().toPath().resolve("nodesTemp"));
182+
}
176183

177184
SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class);
178185
SourceSet mainSourceSet = sourceSets.findByName(SourceSet.MAIN_SOURCE_SET_NAME);
179186
SourceSet testSourceSet = sourceSets.findByName(SourceSet.TEST_SOURCE_SET_NAME);
180-
if ("test".equals(test.getName()) && mainSourceSet != null && testSourceSet != null) {
187+
SourceSet internalClusterTestSourceSet = sourceSets.findByName("internalClusterTest");
188+
189+
if (TEST_TASKS_WITH_ENTITLEMENTS.contains(test.getName()) && mainSourceSet != null && testSourceSet != null) {
181190
FileCollection mainRuntime = mainSourceSet.getRuntimeClasspath();
182191
FileCollection testRuntime = testSourceSet.getRuntimeClasspath();
183-
FileCollection testOnlyFiles = testRuntime.minus(mainRuntime);
192+
FileCollection internalClusterTestRuntime = ("internalClusterTest".equals(test.getName())
193+
&& internalClusterTestSourceSet != null) ? internalClusterTestSourceSet.getRuntimeClasspath() : project.files();
194+
FileCollection testOnlyFiles = testRuntime.plus(internalClusterTestRuntime).minus(mainRuntime);
195+
184196
test.doFirst(task -> test.environment("es.entitlement.testOnlyPath", testOnlyFiles.getAsPath()));
185197
}
186198

@@ -240,14 +252,15 @@ public void execute(Task t) {
240252
* Computes and sets the {@code --patch-module=java.base} and {@code --add-opens=java.base} JVM command line options.
241253
*/
242254
private void configureJavaBaseModuleOptions(Project project) {
243-
project.getTasks().withType(Test.class).matching(task -> task.getName().equals("test")).configureEach(test -> {
244-
FileCollection patchedImmutableCollections = patchedImmutableCollections(project);
255+
project.getTasks().withType(Test.class).configureEach(test -> {
256+
// patch immutable collections only for "test" task
257+
FileCollection patchedImmutableCollections = test.getName().equals("test") ? patchedImmutableCollections(project) : null;
245258
if (patchedImmutableCollections != null) {
246259
test.getInputs().files(patchedImmutableCollections);
247260
test.systemProperty("tests.hackImmutableCollections", "true");
248261
}
249262

250-
FileCollection entitlementBridge = entitlementBridge(project);
263+
FileCollection entitlementBridge = TEST_TASKS_WITH_ENTITLEMENTS.contains(test.getName()) ? entitlementBridge(project) : null;
251264
if (entitlementBridge != null) {
252265
test.getInputs().files(entitlementBridge);
253266
}
@@ -311,27 +324,30 @@ private static void configureEntitlements(Project project) {
311324
}
312325
FileCollection bridgeFiles = bridgeConfig;
313326

314-
project.getTasks().withType(Test.class).configureEach(test -> {
315-
// See also SystemJvmOptions.maybeAttachEntitlementAgent.
316-
317-
// Agent
318-
if (agentFiles.isEmpty() == false) {
319-
test.getInputs().files(agentFiles);
320-
test.systemProperty("es.entitlement.agentJar", agentFiles.getAsPath());
321-
test.systemProperty("jdk.attach.allowAttachSelf", true);
322-
}
327+
project.getTasks()
328+
.withType(Test.class)
329+
.matching(test -> TEST_TASKS_WITH_ENTITLEMENTS.contains(test.getName()))
330+
.configureEach(test -> {
331+
// See also SystemJvmOptions.maybeAttachEntitlementAgent.
332+
333+
// Agent
334+
if (agentFiles.isEmpty() == false) {
335+
test.getInputs().files(agentFiles);
336+
test.systemProperty("es.entitlement.agentJar", agentFiles.getAsPath());
337+
test.systemProperty("jdk.attach.allowAttachSelf", true);
338+
}
323339

324-
// Bridge
325-
if (bridgeFiles.isEmpty() == false) {
326-
String modulesContainingEntitlementInstrumentation = "java.logging,java.net.http,java.naming,jdk.net";
327-
test.getInputs().files(bridgeFiles);
328-
// Tests may not be modular, but the JDK still is
329-
test.jvmArgs(
330-
"--add-exports=java.base/org.elasticsearch.entitlement.bridge=ALL-UNNAMED,"
331-
+ modulesContainingEntitlementInstrumentation
332-
);
333-
}
334-
});
340+
// Bridge
341+
if (bridgeFiles.isEmpty() == false) {
342+
String modulesContainingEntitlementInstrumentation = "java.logging,java.net.http,java.naming,jdk.net";
343+
test.getInputs().files(bridgeFiles);
344+
// Tests may not be modular, but the JDK still is
345+
test.jvmArgs(
346+
"--add-exports=java.base/org.elasticsearch.entitlement.bridge=ALL-UNNAMED,"
347+
+ modulesContainingEntitlementInstrumentation
348+
);
349+
}
350+
});
335351
}
336352

337353
}

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
5858
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:third-party:slack");
5959
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:deprecation:qa:early-deprecation-rest");
6060
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:deprecation:qa:rest");
61-
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:enrich:qa:rest");
62-
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:enrich:qa:rest-with-advanced-security");
63-
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:enrich:qa:rest-with-security");
6461
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:ent-search:qa:rest");
6562
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:eql:qa:ccs-rolling-upgrade");
6663
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:eql:qa:correctness");

build-tools/src/main/java/org/elasticsearch/gradle/test/TestBuildInfoPlugin.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ public void apply(Project project) {
5858
});
5959

6060
if (project.getRootProject().getName().equals("elasticsearch")) {
61-
project.getTasks().withType(Test.class).matching(test -> List.of("test").contains(test.getName())).configureEach(test -> {
62-
test.systemProperty("es.entitlement.enableForTests", "true");
63-
});
61+
project.getTasks()
62+
.withType(Test.class)
63+
.matching(test -> List.of("test", "internalClusterTest").contains(test.getName()))
64+
.configureEach(test -> {
65+
test.systemProperty("es.entitlement.enableForTests", "true");
66+
});
6467
}
6568
}
6669
}

distribution/src/bin/elasticsearch-cli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ exec \
1919
-Des.path.home="$ES_HOME" \
2020
-Des.path.conf="$ES_PATH_CONF" \
2121
-Des.distribution.type="$ES_DISTRIBUTION_TYPE" \
22+
-Des.java.type="$JAVA_TYPE" \
2223
-cp "$LAUNCHER_CLASSPATH" \
2324
org.elasticsearch.launcher.CliToolLauncher \
2425
"$@"

distribution/src/bin/elasticsearch-cli.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ set LAUNCHER_CLASSPATH=%ES_HOME%/lib/*;%ES_HOME%/lib/cli-launcher/*
1818
-Des.path.home="%ES_HOME%" ^
1919
-Des.path.conf="%ES_PATH_CONF%" ^
2020
-Des.distribution.type="%ES_DISTRIBUTION_TYPE%" ^
21+
-Des.java.type="%JAVA_TYPE%" ^
2122
-cp "%LAUNCHER_CLASSPATH%" ^
2223
org.elasticsearch.launcher.CliToolLauncher ^
2324
%*

docs/changelog/130279.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 130279
2+
summary: Fix missing removal of query cancellation callback in QueryPhase
3+
area: Search
4+
type: bug
5+
issues: [130071]

docs/changelog/131053.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 131053
2+
summary: Split large pages on load sometimes
3+
area: ES|QL
4+
type: bug
5+
issues: []

0 commit comments

Comments
 (0)