Skip to content

Commit 66c7efb

Browse files
committed
Merge remote-tracking branch 'es/main' into mergeSortedNumericField_3
2 parents b5f332b + e27bffb commit 66c7efb

File tree

10 files changed

+317
-288
lines changed

10 files changed

+317
-288
lines changed

.buildkite/pipelines/pull-request/build-benchmark.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@ steps:
77
command: |
88
.ci/scripts/run-gradle.sh :build-tools-internal:bootstrapPerformanceTests
99
.ci/scripts/install-gradle-profiler.sh
10-
.ci/scripts/run-gradle-profiler.sh --benchmark --scenario-file build-tools-internal/build/performanceTests/elasticsearch-build-benchmark-{{matrix.part}}.scenarios --project-dir . --output-dir profile-out
11-
mkdir build
12-
tar -czf build/$BUILDKITE_BUILD_NUMBER.tar.bz2 profile-out
10+
.ci/scripts/run-gradle-profiler.sh --benchmark --scenario-file build-tools-internal/build/performanceTests/elasticsearch-{{matrix.part}}.scenarios --measure-config-time --project-dir . --output-dir profile-out
11+
mkdir -p build
12+
buildkite-agent artifact upload "profile-out/*"
13+
cat << EOF | buildkite-agent annotate --style "info"
14+
Benchmark Html Report <a href="artifact://profile-out/benchmark.html">Benchmark Html Report</a>
15+
EOF
1316
matrix:
1417
setup:
1518
part:
16-
- part1
17-
- part2
19+
- esql-tests
1820
env:
1921
BUILD_PERFORMANCE_TEST: "true"
22+
2023
agents:
2124
provider: gcp
2225
image: family/elasticsearch-ubuntu-2004

.ci/scripts/install-gradle-profiler.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44
# profiler version we wanna install
5-
PROFILER_VERSION="0.16.0"
6-
wget https://repo.gradle.org/gradle/ext-releases-local/org/gradle/profiler/gradle-profiler/$PROFILER_VERSION/gradle-profiler-$PROFILER_VERSION.zip -O $WORKSPACE/gradle-profiler-$PROFILER_VERSION.zip
5+
PROFILER_VERSION="0.22.0"
6+
wget https://repo1.maven.org/maven2/org/gradle/profiler/gradle-profiler/$PROFILER_VERSION/gradle-profiler-$PROFILER_VERSION.zip -O $WORKSPACE/gradle-profiler-$PROFILER_VERSION.zip
77
unzip $WORKSPACE/gradle-profiler-$PROFILER_VERSION.zip
88
mv $WORKSPACE/gradle-profiler-$PROFILER_VERSION $WORKSPACE/gradle-profiler

build-tools-internal/performance/elasticsearch-build-benchmark-part1.scenarios

Lines changed: 0 additions & 72 deletions
This file was deleted.

build-tools-internal/performance/elasticsearch-build-benchmark-part2.scenarios

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
default-scenarios = ["TEST_ESQL_ABI_CHANGE_TAPI", TEST_ESQL_ABI_CHANGE_TAPI_MAIN, "TEST_ESQL_ABI_CHANGE_TAPI_CC", "TEST_ESQL_ABI_CHANGE_TAPI_CC_NOINIT", "TEST_ESQL_ABI_CHANGE_TAPI_CC_MAIN", "TEST_ESQL_ABI_CHANGE_TAPI_CC_NOINIT_MAIN"]
2+
3+
TEST_ESQL_ABI_CHANGE_TAPI {
4+
apply-abi-change-to = "x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/ColumnInfoImpl.java"
5+
tasks = [":x-pack:plugin:esql:test", "--tests", "org.elasticsearch.gradle.benchmarking.BenchmarkingTests"]
6+
gradle-args = ["-I", ".ci/init.gradle"]
7+
run-using = tooling-api // value can be "cli" or "tooling-api"
8+
daemon = warm // value can be "warm", "cold", or "none"
9+
copy-file = {
10+
source = "build-tools-internal/performance/test-files/BenchmarkingTests.java"
11+
target = "x-pack/plugin/esql/src/test/java/org/elasticsearch/gradle/benchmarking/BenchmarkingTests.java"
12+
schedule = SCENARIO
13+
}
14+
git-checkout = {
15+
cleanup = "@testGitCommit@"
16+
build = "@testGitCommit@"
17+
}
18+
warm-ups = 3
19+
iterations = 10
20+
}
21+
22+
TEST_ESQL_ABI_CHANGE_TAPI_CC {
23+
apply-abi-change-to = "x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/ColumnInfoImpl.java"
24+
tasks = [":x-pack:plugin:esql:test", "--tests", "org.elasticsearch.gradle.benchmarking.BenchmarkingTests"]
25+
gradle-args = ["--configuration-cache", "-I", ".ci/init.gradle"]
26+
run-using = tooling-api // value can be "cli" or "tooling-api"
27+
daemon = warm // value can be "warm", "cold", or "none"
28+
copy-file = {
29+
source = "build-tools-internal/performance/test-files/BenchmarkingTests.java"
30+
target = "x-pack/plugin/esql/src/test/java/org/elasticsearch/gradle/benchmarking/BenchmarkingTests.java"
31+
schedule = SCENARIO
32+
}
33+
34+
git-checkout = {
35+
cleanup = "@testGitCommit@"
36+
build = "@testGitCommit@"
37+
}
38+
warm-ups = 3
39+
iterations = 10
40+
}
41+
42+
TEST_ESQL_ABI_CHANGE_TAPI_CC_NOINIT {
43+
apply-abi-change-to = "x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/ColumnInfoImpl.java"
44+
tasks = [":x-pack:plugin:esql:test", "--tests", "org.elasticsearch.gradle.benchmarking.BenchmarkingTests"]
45+
gradle-args = ["--configuration-cache"]
46+
run-using = tooling-api // value can be "cli" or "tooling-api"
47+
daemon = warm // value can be "warm", "cold", or "none"
48+
copy-file = {
49+
source = "build-tools-internal/performance/test-files/BenchmarkingTests.java"
50+
target = "x-pack/plugin/esql/src/test/java/org/elasticsearch/gradle/benchmarking/BenchmarkingTests.java"
51+
schedule = SCENARIO
52+
}
53+
54+
git-checkout = {
55+
cleanup = "@testGitCommit@"
56+
build = "@testGitCommit@"
57+
}
58+
warm-ups = 3
59+
iterations = 10
60+
}
61+
62+
TEST_ESQL_ABI_CHANGE_TAPI_MAIN {
63+
apply-abi-change-to = "x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/ColumnInfoImpl.java"
64+
tasks = [":x-pack:plugin:esql:test", "--tests", "org.elasticsearch.gradle.benchmarking.BenchmarkingTests"]
65+
gradle-args = ["-I", ".ci/init.gradle"]
66+
run-using = tooling-api // value can be "cli" or "tooling-api"
67+
daemon = warm // value can be "warm", "cold", or "none"
68+
copy-file = {
69+
source = "build-tools-internal/performance/test-files/BenchmarkingTests.java"
70+
target = "x-pack/plugin/esql/src/test/java/org/elasticsearch/gradle/benchmarking/BenchmarkingTests.java"
71+
schedule = SCENARIO
72+
}
73+
git-checkout = {
74+
cleanup = "main"
75+
build = "main"
76+
}
77+
warm-ups = 3
78+
iterations = 10
79+
}
80+
81+
TEST_ESQL_ABI_CHANGE_TAPI_CC_MAIN {
82+
apply-abi-change-to = "x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/ColumnInfoImpl.java"
83+
tasks = [":x-pack:plugin:esql:test", "--tests", "org.elasticsearch.gradle.benchmarking.BenchmarkingTests"]
84+
gradle-args = ["--configuration-cache", "-I", ".ci/init.gradle"]
85+
run-using = tooling-api // value can be "cli" or "tooling-api"
86+
daemon = warm // value can be "warm", "cold", or "none"
87+
copy-file = {
88+
source = "build-tools-internal/performance/test-files/BenchmarkingTests.java"
89+
target = "x-pack/plugin/esql/src/test/java/org/elasticsearch/gradle/benchmarking/BenchmarkingTests.java"
90+
schedule = SCENARIO
91+
}
92+
93+
git-checkout = {
94+
cleanup = "main"
95+
build = "main"
96+
}
97+
warm-ups = 3
98+
iterations = 10
99+
}
100+
101+
TEST_ESQL_ABI_CHANGE_TAPI_CC_NOINIT_MAIN {
102+
apply-abi-change-to = "x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/ColumnInfoImpl.java"
103+
tasks = [":x-pack:plugin:esql:test", "--tests", "org.elasticsearch.gradle.benchmarking.BenchmarkingTests"]
104+
gradle-args = ["--configuration-cache"]
105+
run-using = tooling-api // value can be "cli" or "tooling-api"
106+
daemon = warm // value can be "warm", "cold", or "none"
107+
copy-file = {
108+
source = "build-tools-internal/performance/test-files/BenchmarkingTests.java"
109+
target = "x-pack/plugin/esql/src/test/java/org/elasticsearch/gradle/benchmarking/BenchmarkingTests.java"
110+
schedule = SCENARIO
111+
}
112+
git-checkout = {
113+
cleanup = "main"
114+
build = "main"
115+
}
116+
warm-ups = 3
117+
iterations = 10
118+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
package org.elasticsearch.gradle.benchmarking;
9+
10+
import org.elasticsearch.test.ESTestCase;
11+
12+
public class BenchmarkingTests extends ESTestCase {
13+
14+
public void testBenchmarking() {
15+
assertTrue(true);
16+
}
17+
}

muted-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,9 @@ tests:
441441
- class: org.elasticsearch.smoketest.MlWithSecurityIT
442442
method: test {yaml=ml/trained_model_cat_apis/Test cat trained models}
443443
issue: https://github.com/elastic/elasticsearch/issues/125750
444+
- class: org.elasticsearch.ingest.geoip.EnterpriseGeoIpDownloaderIT
445+
method: testEnterpriseDownloaderTask
446+
issue: https://github.com/elastic/elasticsearch/issues/126124
444447

445448
# Examples:
446449
#

x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportExplainLifecycleAction.java

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
import org.elasticsearch.action.ActionListener;
1212
import org.elasticsearch.action.support.ActionFilters;
1313
import org.elasticsearch.action.support.ChannelActionListener;
14-
import org.elasticsearch.action.support.local.TransportLocalClusterStateAction;
15-
import org.elasticsearch.cluster.ClusterState;
14+
import org.elasticsearch.action.support.local.TransportLocalProjectMetadataAction;
15+
import org.elasticsearch.cluster.ProjectState;
1616
import org.elasticsearch.cluster.block.ClusterBlockException;
1717
import org.elasticsearch.cluster.block.ClusterBlockLevel;
1818
import org.elasticsearch.cluster.metadata.IndexMetadata;
1919
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
2020
import org.elasticsearch.cluster.metadata.LifecycleExecutionState;
21-
import org.elasticsearch.cluster.metadata.Metadata;
21+
import org.elasticsearch.cluster.metadata.ProjectMetadata;
2222
import org.elasticsearch.cluster.project.ProjectResolver;
2323
import org.elasticsearch.cluster.service.ClusterService;
2424
import org.elasticsearch.common.Strings;
@@ -52,7 +52,9 @@
5252
import static org.elasticsearch.index.IndexSettings.LIFECYCLE_ORIGINATION_DATE;
5353
import static org.elasticsearch.xpack.core.ilm.WaitForRolloverReadyStep.applyDefaultConditions;
5454

55-
public class TransportExplainLifecycleAction extends TransportLocalClusterStateAction<ExplainLifecycleRequest, ExplainLifecycleResponse> {
55+
public class TransportExplainLifecycleAction extends TransportLocalProjectMetadataAction<
56+
ExplainLifecycleRequest,
57+
ExplainLifecycleResponse> {
5658

5759
private final NamedXContentRegistry xContentRegistry;
5860
private final IndexNameExpressionResolver indexNameExpressionResolver;
@@ -78,7 +80,8 @@ public TransportExplainLifecycleAction(
7880
actionFilters,
7981
transportService.getTaskManager(),
8082
clusterService,
81-
threadPool.executor(ThreadPool.Names.MANAGEMENT)
83+
threadPool.executor(ThreadPool.Names.MANAGEMENT),
84+
projectResolver
8285
);
8386
this.xContentRegistry = xContentRegistry;
8487
this.indexNameExpressionResolver = indexNameExpressionResolver;
@@ -95,29 +98,33 @@ public TransportExplainLifecycleAction(
9598
}
9699

97100
@Override
98-
protected ClusterBlockException checkBlock(ExplainLifecycleRequest request, ClusterState state) {
99-
return state.blocks()
100-
.indicesBlockedException(ClusterBlockLevel.METADATA_READ, indexNameExpressionResolver.concreteIndexNames(state, request));
101+
protected ClusterBlockException checkBlock(ExplainLifecycleRequest request, ProjectState project) {
102+
return project.blocks()
103+
.indicesBlockedException(
104+
project.projectId(),
105+
ClusterBlockLevel.METADATA_READ,
106+
indexNameExpressionResolver.concreteIndexNames(project.metadata(), request)
107+
);
101108
}
102109

103110
@Override
104111
protected void localClusterStateOperation(
105112
Task task,
106113
ExplainLifecycleRequest request,
107-
final ClusterState state,
114+
ProjectState project,
108115
ActionListener<ExplainLifecycleResponse> listener
109116
) {
110-
String[] concreteIndices = indexNameExpressionResolver.concreteIndexNames(state, request);
117+
String[] concreteIndices = indexNameExpressionResolver.concreteIndexNames(project.metadata(), request);
111118
boolean rolloverOnlyIfHasDocuments = LifecycleSettings.LIFECYCLE_ROLLOVER_ONLY_IF_HAS_DOCUMENTS_SETTING.get(
112-
state.metadata().settings()
119+
project.cluster().metadata().settings()
113120
);
114121
Map<String, IndexLifecycleExplainResponse> indexResponses = new TreeMap<>();
115122
for (String index : concreteIndices) {
116123
final IndexLifecycleExplainResponse indexResponse;
117124
try {
118125
indexResponse = getIndexLifecycleExplainResponse(
119126
index,
120-
state.metadata(),
127+
project.metadata(),
121128
request.onlyErrors(),
122129
request.onlyManaged(),
123130
xContentRegistry,
@@ -140,13 +147,12 @@ protected void localClusterStateOperation(
140147
@Nullable
141148
static IndexLifecycleExplainResponse getIndexLifecycleExplainResponse(
142149
String indexName,
143-
Metadata metadata,
150+
ProjectMetadata project,
144151
boolean onlyErrors,
145152
boolean onlyManaged,
146153
NamedXContentRegistry xContentRegistry,
147154
boolean rolloverOnlyIfHasDocuments
148155
) throws IOException {
149-
final var project = metadata.getProject();
150156
IndexMetadata indexMetadata = project.index(indexName);
151157
Settings idxSettings = indexMetadata.getSettings();
152158
LifecycleExecutionState lifecycleState = indexMetadata.getLifecycleExecutionState();

0 commit comments

Comments
 (0)