Skip to content

Commit 1feee98

Browse files
Merge branch 'main' of github.com:elastic/elasticsearch into inference-eis-acl
2 parents 72ac2b0 + 53cca8e commit 1feee98

File tree

952 files changed

+20319
-9141
lines changed

Some content is hidden

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

952 files changed

+20319
-9141
lines changed

.buildkite/scripts/dra-workflow.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ WORKFLOW="${DRA_WORKFLOW:-snapshot}"
66
BRANCH="${BUILDKITE_BRANCH:-}"
77

88
# Don't publish main branch to staging
9-
if [[ ("$BRANCH" == "main" || "$BRANCH" == *.x) && "$WORKFLOW" == "staging" ]]; then
9+
if [[ "$BRANCH" == *.x && "$WORKFLOW" == "staging" ]]; then
1010
exit 0
1111
fi
1212

@@ -22,13 +22,19 @@ if [[ "$BRANCH" == "main" ]]; then
2222
fi
2323

2424
ES_VERSION=$(grep elasticsearch build-tools-internal/version.properties | sed "s/elasticsearch *= *//g")
25+
BASE_VERSION="$ES_VERSION"
2526
echo "ES_VERSION=$ES_VERSION"
2627

2728
VERSION_SUFFIX=""
2829
if [[ "$WORKFLOW" == "snapshot" ]]; then
2930
VERSION_SUFFIX="-SNAPSHOT"
3031
fi
3132

33+
if [[ -n "${VERSION_QUALIFIER:-}" ]]; then
34+
ES_VERSION="${ES_VERSION}-${VERSION_QUALIFIER}"
35+
echo "Version qualifier specified. ES_VERSION=${ES_VERSION}."
36+
fi
37+
3238
BEATS_BUILD_ID="$(./.ci/scripts/resolve-dra-manifest.sh beats "$RM_BRANCH" "$ES_VERSION" "$WORKFLOW")"
3339
echo "BEATS_BUILD_ID=$BEATS_BUILD_ID"
3440

@@ -37,6 +43,7 @@ echo "ML_CPP_BUILD_ID=$ML_CPP_BUILD_ID"
3743

3844
LICENSE_KEY_ARG=""
3945
BUILD_SNAPSHOT_ARG=""
46+
VERSION_QUALIFIER_ARG=""
4047

4148
if [[ "$WORKFLOW" == "staging" ]]; then
4249
LICENSE_KEY=$(mktemp -d)/license.key
@@ -47,6 +54,10 @@ if [[ "$WORKFLOW" == "staging" ]]; then
4754
BUILD_SNAPSHOT_ARG="-Dbuild.snapshot=false"
4855
fi
4956

57+
if [[ -n "${VERSION_QUALIFIER:-}" ]]; then
58+
VERSION_QUALIFIER_ARG="-Dbuild.version_qualifier=$VERSION_QUALIFIER"
59+
fi
60+
5061
echo --- Building release artifacts
5162

5263
.ci/scripts/run-gradle.sh -Ddra.artifacts=true \
@@ -56,12 +67,17 @@ echo --- Building release artifacts
5667
-Dcsv="$WORKSPACE/build/distributions/dependencies-${ES_VERSION}${VERSION_SUFFIX}.csv" \
5768
$LICENSE_KEY_ARG \
5869
$BUILD_SNAPSHOT_ARG \
70+
$VERSION_QUALIFIER_ARG \
5971
buildReleaseArtifacts \
6072
exportCompressedDockerImages \
6173
:distribution:generateDependenciesReport
6274

6375
PATH="$PATH:${JAVA_HOME}/bin" # Required by the following script
76+
if [[ -z "${VERSION_QUALIFIER:-}" ]]; then
6477
x-pack/plugin/sql/connectors/tableau/package.sh asm qualifier="$VERSION_SUFFIX"
78+
else
79+
x-pack/plugin/sql/connectors/tableau/package.sh asm qualifier="-$VERSION_QUALIFIER"
80+
fi
6581

6682
# we regenerate this file as part of the release manager invocation
6783
rm "build/distributions/elasticsearch-jdbc-${ES_VERSION}${VERSION_SUFFIX}.taco.sha512"
@@ -88,7 +104,8 @@ docker run --rm \
88104
--branch "$RM_BRANCH" \
89105
--commit "$BUILDKITE_COMMIT" \
90106
--workflow "$WORKFLOW" \
91-
--version "$ES_VERSION" \
107+
--qualifier "${VERSION_QUALIFIER:-}" \
108+
--version "$BASE_VERSION" \
92109
--artifact-set main \
93110
--dependency "beats:https://artifacts-${WORKFLOW}.elastic.co/beats/${BEATS_BUILD_ID}/manifest-${ES_VERSION}${VERSION_SUFFIX}.json" \
94111
--dependency "ml-cpp:https://artifacts-${WORKFLOW}.elastic.co/ml-cpp/${ML_CPP_BUILD_ID}/manifest-${ES_VERSION}${VERSION_SUFFIX}.json"

.buildkite/scripts/dra-workflow.trigger.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ source .buildkite/scripts/branches.sh
88

99
for BRANCH in "${BRANCHES[@]}"; do
1010
if [[ "$BRANCH" == "main" ]]; then
11-
continue
11+
export VERSION_QUALIFIER="alpha1"
1212
fi
1313

1414
INTAKE_PIPELINE_SLUG="elasticsearch-intake"
@@ -24,5 +24,6 @@ for BRANCH in "${BRANCHES[@]}"; do
2424
commit: "$LAST_GOOD_COMMIT"
2525
env:
2626
DRA_WORKFLOW: staging
27+
VERSION_QUALIFIER: ${VERSION_QUALIFIER:-}
2728
EOF
2829
done

benchmarks/src/main/java/org/elasticsearch/benchmark/bytes/BytesArrayReadLongBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class BytesArrayReadLongBenchmark {
4747
@Setup
4848
public void initResults() throws IOException {
4949
final BytesStreamOutput tmp = new BytesStreamOutput();
50-
final long bytes = new ByteSizeValue(dataMb, ByteSizeUnit.MB).getBytes();
50+
final long bytes = ByteSizeValue.of(dataMb, ByteSizeUnit.MB).getBytes();
5151
for (int i = 0; i < bytes / 8; i++) {
5252
tmp.writeLong(i);
5353
}

benchmarks/src/main/java/org/elasticsearch/benchmark/bytes/PagedBytesReferenceReadLongBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class PagedBytesReferenceReadLongBenchmark {
4747
@Setup
4848
public void initResults() throws IOException {
4949
final BytesStreamOutput tmp = new BytesStreamOutput();
50-
final long bytes = new ByteSizeValue(dataMb, ByteSizeUnit.MB).getBytes();
50+
final long bytes = ByteSizeValue.of(dataMb, ByteSizeUnit.MB).getBytes();
5151
for (int i = 0; i < bytes / 8; i++) {
5252
tmp.writeLong(i);
5353
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void apply(Project project) {
5353
}
5454

5555
// List of root tasks, by name, whose compileJava task should not use the module path. These are test related sources.
56-
static final Set<String> EXCLUDES = Set.of(":test:framework", ":x-pack:plugin:eql:qa:common");
56+
static final Set<String> EXCLUDES = Set.of(":test:framework", ":x-pack:plugin:eql:qa:common", ":x-pack:plugin:esql:compute:test");
5757

5858
void configureCompileModulePath(Project project) {
5959
// first disable Gradle's builtin module path inference

build-tools/src/main/java/org/elasticsearch/gradle/testclusters/TestClustersAware.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public interface TestClustersAware extends Task {
2626
Collection<ElasticsearchCluster> getClusters();
2727

2828
@ServiceReference(REGISTRY_SERVICE_NAME)
29-
Property<TestClustersRegistry> getRegistery();
29+
Property<TestClustersRegistry> getRegistry();
3030

3131
@ServiceReference(TEST_CLUSTER_TASKS_SERVICE)
3232
Property<TestClustersPlugin.TaskEventsService> getTasksService();
@@ -47,6 +47,14 @@ default void useCluster(ElasticsearchCluster cluster) {
4747
getClusters().add(cluster);
4848
}
4949

50+
default Provider<TestClusterInfo> getClusterInfo(String clusterName) {
51+
return getProject().getProviders().of(TestClusterValueSource.class, source -> {
52+
source.getParameters().getService().set(getRegistry());
53+
source.getParameters().getClusterName().set(clusterName);
54+
source.getParameters().getPath().set(getProject().getIsolated().getPath());
55+
});
56+
}
57+
5058
default void useCluster(Provider<ElasticsearchCluster> cluster) {
5159
useCluster(cluster.get());
5260
}

build-tools/src/main/java/org/elasticsearch/gradle/testclusters/TestClustersPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ private void configureStartClustersHook(Gradle gradle) {
249249
.forEach(awareTask -> {
250250
awareTask.doFirst(task -> {
251251
awareTask.beforeStart();
252-
awareTask.getClusters().forEach(awareTask.getRegistery().get()::maybeStartCluster);
252+
awareTask.getClusters().forEach(awareTask.getRegistry().get()::maybeStartCluster);
253253
});
254254
});
255255
});

build-tools/src/main/java/org/elasticsearch/gradle/testclusters/TestClustersRegistry.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,23 @@ public void restart(String path, String clusterName) {
109109
cluster.restart();
110110
}
111111

112+
public void nextNodeToNextVersion(Provider<ElasticsearchCluster> cluster) {
113+
nextNodeToNextVersion(cluster.get());
114+
}
115+
116+
public void nextNodeToNextVersion(ElasticsearchCluster cluster) {
117+
nextNodeToNextVersion(cluster.getPath(), cluster.getName());
118+
}
119+
120+
public void nextNodeToNextVersion(String path, String clusterName) {
121+
ElasticsearchCluster cluster = runningClusters.stream()
122+
.filter(c -> c.getPath().equals(path))
123+
.filter(c -> c.getName().equals(clusterName))
124+
.findFirst()
125+
.orElseThrow();
126+
cluster.nextNodeToNextVersion();
127+
}
128+
112129
public void storeProcess(String id, Process esProcess) {
113130
nodeProcesses.put(id, esProcess);
114131
}

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

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,20 @@ static String agentCommandLineOption(Path agentJar, Path tmpPropertiesFile) {
187187
static void extractSecureSettings(SecureSettings secrets, Map<String, String> propertiesMap) {
188188
final Set<String> settingNames = secrets.getSettingNames();
189189
for (String key : List.of("api_key", "secret_token")) {
190-
String prefix = "telemetry.";
191-
if (settingNames.contains(prefix + key)) {
192-
try (SecureString token = secrets.getString(prefix + key)) {
193-
propertiesMap.put(key, token.toString());
190+
for (String prefix : List.of("telemetry.", "tracing.apm.")) {
191+
if (settingNames.contains(prefix + key)) {
192+
if (propertiesMap.containsKey(key)) {
193+
throw new IllegalStateException(
194+
Strings.format("Duplicate telemetry setting: [telemetry.%s] and [tracing.apm.%s]", key, key)
195+
);
196+
}
197+
198+
try (SecureString token = secrets.getString(prefix + key)) {
199+
propertiesMap.put(key, token.toString());
200+
}
194201
}
195202
}
203+
196204
}
197205
}
198206

@@ -219,12 +227,44 @@ private static Map<String, String> extractDynamicSettings(Map<String, String> pr
219227
static Map<String, String> extractApmSettings(Settings settings) throws UserException {
220228
final Map<String, String> propertiesMap = new HashMap<>();
221229

230+
// tracing.apm.agent. is deprecated by telemetry.agent.
222231
final String telemetryAgentPrefix = "telemetry.agent.";
232+
final String deprecatedTelemetryAgentPrefix = "tracing.apm.agent.";
223233

224234
final Settings telemetryAgentSettings = settings.getByPrefix(telemetryAgentPrefix);
225235
telemetryAgentSettings.keySet().forEach(key -> propertiesMap.put(key, String.valueOf(telemetryAgentSettings.get(key))));
226236

237+
final Settings apmAgentSettings = settings.getByPrefix(deprecatedTelemetryAgentPrefix);
238+
for (String key : apmAgentSettings.keySet()) {
239+
if (propertiesMap.containsKey(key)) {
240+
throw new IllegalStateException(
241+
Strings.format(
242+
"Duplicate telemetry setting: [%s%s] and [%s%s]",
243+
telemetryAgentPrefix,
244+
key,
245+
deprecatedTelemetryAgentPrefix,
246+
key
247+
)
248+
);
249+
}
250+
propertiesMap.put(key, String.valueOf(apmAgentSettings.get(key)));
251+
}
252+
227253
StringJoiner globalLabels = extractGlobalLabels(telemetryAgentPrefix, propertiesMap, settings);
254+
if (globalLabels.length() == 0) {
255+
globalLabels = extractGlobalLabels(deprecatedTelemetryAgentPrefix, propertiesMap, settings);
256+
} else {
257+
StringJoiner tracingGlobalLabels = extractGlobalLabels(deprecatedTelemetryAgentPrefix, propertiesMap, settings);
258+
if (tracingGlobalLabels.length() != 0) {
259+
throw new IllegalArgumentException(
260+
"Cannot have global labels with tracing.agent prefix ["
261+
+ globalLabels
262+
+ "] and telemetry.apm.agent prefix ["
263+
+ tracingGlobalLabels
264+
+ "]"
265+
);
266+
}
267+
}
228268
if (globalLabels.length() > 0) {
229269
propertiesMap.put("global_labels", globalLabels.toString());
230270
}
@@ -234,7 +274,7 @@ static Map<String, String> extractApmSettings(Settings settings) throws UserExce
234274
if (propertiesMap.containsKey(key)) {
235275
throw new UserException(
236276
ExitCodes.CONFIG,
237-
"Do not set a value for [telemetry.agent." + key + "], as this is configured automatically by Elasticsearch"
277+
"Do not set a value for [tracing.apm.agent." + key + "], as this is configured automatically by Elasticsearch"
238278
);
239279
}
240280
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ private static Stream<String> maybeAttachEntitlementAgent(boolean useEntitlement
171171
throw new IllegalStateException("Failed to list entitlement jars in: " + dir, e);
172172
}
173173
// We instrument classes in these modules to call the bridge. Because the bridge gets patched
174-
// into java.base, we must export the bridge from java.base to these modules.
175-
String modulesContainingEntitlementInstrumentation = "java.logging";
174+
// into java.base, we must export the bridge from java.base to these modules, as a comma-separated list
175+
String modulesContainingEntitlementInstrumentation = "java.logging,java.net.http,java.naming";
176176
return Stream.of(
177177
"-Des.entitlements.enabled=true",
178178
"-XX:+EnableDynamicAgentLoading",

0 commit comments

Comments
 (0)