Skip to content

Commit 50674a5

Browse files
committed
Merge branch 'main' into timed_out_response
2 parents 7bdc917 + f0ee146 commit 50674a5

File tree

734 files changed

+9923
-5585
lines changed

Some content is hidden

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

734 files changed

+9923
-5585
lines changed

build-tools-internal/src/main/groovy/elasticsearch.bwc-test.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ plugins.withType(InternalJavaRestTestPlugin) {
4747
tasks.withType(StandaloneRestIntegTestTask).configureEach {
4848
testClassesDirs = sourceSets.javaRestTest.output.classesDirs
4949
classpath = sourceSets.javaRestTest.runtimeClasspath
50-
usesDefaultDistribution()
50+
usesDefaultDistribution("BWC tests require full distribution for now")
5151
}
5252
}
5353

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

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
import org.elasticsearch.gradle.internal.test.ClusterFeaturesMetadataPlugin;
1818
import org.elasticsearch.gradle.plugin.PluginBuildPlugin;
1919
import org.elasticsearch.gradle.plugin.PluginPropertiesExtension;
20-
import org.elasticsearch.gradle.testclusters.ElasticsearchCluster;
21-
import org.elasticsearch.gradle.testclusters.TestClustersPlugin;
2220
import org.elasticsearch.gradle.util.GradleUtils;
23-
import org.gradle.api.NamedDomainObjectContainer;
2421
import org.gradle.api.Plugin;
2522
import org.gradle.api.Project;
2623

@@ -81,29 +78,6 @@ public void doCall() {
8178
if (isModule == false || isXPackModule) {
8279
addNoticeGeneration(project, extension);
8380
}
84-
project.afterEvaluate(p -> {
85-
@SuppressWarnings("unchecked")
86-
NamedDomainObjectContainer<ElasticsearchCluster> testClusters = (NamedDomainObjectContainer<ElasticsearchCluster>) project
87-
.getExtensions()
88-
.getByName(TestClustersPlugin.EXTENSION_NAME);
89-
p.getExtensions().getByType(PluginPropertiesExtension.class).getExtendedPlugins().forEach(pluginName -> {
90-
// Auto add any dependent modules
91-
findModulePath(project, pluginName).ifPresent(
92-
path -> testClusters.configureEach(elasticsearchCluster -> elasticsearchCluster.module(path))
93-
);
94-
});
95-
});
96-
}
97-
98-
Optional<String> findModulePath(Project project, String pluginName) {
99-
return project.getRootProject()
100-
.getAllprojects()
101-
.stream()
102-
.filter(p -> GradleUtils.isModuleProject(p.getPath()))
103-
.filter(p -> p.getPlugins().hasPlugin(PluginBuildPlugin.class))
104-
.filter(p -> p.getExtensions().getByType(PluginPropertiesExtension.class).getName().equals(pluginName))
105-
.findFirst()
106-
.map(Project::getPath);
10781
}
10882

10983
/**

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
4949
map.put(LegacyRestTestBasePlugin.class, ":plugins:discovery-ec2");
5050
map.put(LegacyRestTestBasePlugin.class, ":plugins:discovery-gce");
5151
map.put(LegacyRestTestBasePlugin.class, ":plugins:mapper-annotated-text");
52-
map.put(LegacyRestTestBasePlugin.class, ":plugins:mapper-murmur3");
53-
map.put(LegacyRestTestBasePlugin.class, ":plugins:repository-hdfs");
5452
map.put(LegacyRestTestBasePlugin.class, ":plugins:store-smb");
5553
map.put(LegacyRestTestBasePlugin.class, ":qa:ccs-rolling-upgrade-remote-cluster");
5654
map.put(LegacyRestTestBasePlugin.class, ":qa:mixed-cluster");
@@ -74,11 +72,7 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
7472
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:ent-search");
7573
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:fleet");
7674
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:logstash");
77-
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:mapper-constant-keyword");
78-
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:mapper-unsigned-long");
79-
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:mapper-version");
8075
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:vector-tile");
81-
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:wildcard");
8276
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:mixed-tier-cluster");
8377
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:repository-old-versions");
8478
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:rolling-upgrade");

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestBasePlugin.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,11 @@ public void apply(Project project) {
198198
task.getExtensions().getExtraProperties().set("usesDefaultDistribution", new Closure<Void>(task) {
199199
@Override
200200
public Void call(Object... args) {
201+
if (reasonForUsageProvided(args) == false) {
202+
throw new IllegalArgumentException(
203+
"Reason for using `usesDefaultDistribution` required.\nUse usesDefaultDistribution(\"reason why default distro is required here\")."
204+
);
205+
}
201206
task.dependsOn(defaultDistro);
202207
registerDistributionInputs(task, defaultDistro);
203208

@@ -212,6 +217,10 @@ public Void call(Object... args) {
212217

213218
return null;
214219
}
220+
221+
private static boolean reasonForUsageProvided(Object[] args) {
222+
return args.length == 1 && args[0] instanceof String && ((String) args[0]).isBlank() == false;
223+
}
215224
});
216225

217226
// Add `usesBwcDistribution(version)` extension method to test tasks to indicate they require a BWC distribution

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
%*

distribution/src/bin/elasticsearch-env

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,17 @@ else
5555
JAVA_TYPE="bundled JDK"
5656
fi
5757

58-
# do not let JAVA_TOOL_OPTIONS slip in (as the JVM does by default)
58+
# do not let JAVA_TOOL_OPTIONS OR _JAVA_OPTIONS slip in (as the JVM does by default)
5959
if [ ! -z "$JAVA_TOOL_OPTIONS" ]; then
60-
echo "warning: ignoring JAVA_TOOL_OPTIONS=$JAVA_TOOL_OPTIONS"
60+
echo -n "warning: ignoring JAVA_TOOL_OPTIONS=$JAVA_TOOL_OPTIONS; "
61+
echo "pass JVM parameters via ES_JAVA_OPTS"
6162
unset JAVA_TOOL_OPTIONS
6263
fi
64+
if [ ! -z "$_JAVA_OPTIONS" ]; then
65+
echo -n "warning: ignoring _JAVA_OPTIONS=$_JAVA_OPTIONS; "
66+
echo "pass JVM parameters via ES_JAVA_OPTS"
67+
unset _JAVA_OPTIONS
68+
fi
6369

6470
# warn that we are not observing the value of JAVA_HOME
6571
if [ ! -z "$JAVA_HOME" ]; then

distribution/src/bin/elasticsearch-env.bat

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,17 @@ if defined ES_JAVA_HOME (
5858
set JAVA_TYPE=bundled JDK
5959
)
6060

61-
rem do not let JAVA_TOOL_OPTIONS slip in (as the JVM does by default)
61+
rem do not let JAVA_TOOL_OPTIONS or _JAVA_OPTIONS slip in (as the JVM does by default)
6262
if defined JAVA_TOOL_OPTIONS (
63-
echo warning: ignoring JAVA_TOOL_OPTIONS=%JAVA_TOOL_OPTIONS%
63+
(echo|set /p=ignoring JAVA_TOOL_OPTIONS=%JAVA_TOOL_OPTIONS%; )
64+
echo pass JVM parameters via ES_JAVA_OPTS
6465
set JAVA_TOOL_OPTIONS=
6566
)
67+
if defined _JAVA_OPTIONS (
68+
(echo|set /p=ignoring _JAVA_OPTIONS=%_JAVA_OPTIONS%; )
69+
echo pass JVM parameters via ES_JAVA_OPTS
70+
set _JAVA_OPTIONS=
71+
)
6672

6773
rem warn that we are not observing the value of $JAVA_HOME
6874
if defined JAVA_HOME (

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ final class SystemJvmOptions {
2626

2727
static List<String> systemJvmOptions(Settings nodeSettings, final Map<String, String> sysprops) {
2828
String distroType = sysprops.get("es.distribution.type");
29+
String javaType = sysprops.get("es.java.type");
2930
boolean isHotspot = sysprops.getOrDefault("sun.management.compiler", "").contains("HotSpot");
3031
boolean entitlementsExplicitlyEnabled = Booleans.parseBoolean(sysprops.getOrDefault("es.entitlements.enabled", "true"));
3132
// java 24+ only supports entitlements, but it may be enabled on earlier versions explicitly
@@ -68,8 +69,9 @@ static List<String> systemJvmOptions(Settings nodeSettings, final Map<String, St
6869
"-Djava.locale.providers=CLDR",
6970
// Enable vectorization for whatever version we are running. This ensures we use vectorization even when running EA builds.
7071
"-Dorg.apache.lucene.vectorization.upperJavaFeatureVersion=" + Runtime.version().feature(),
71-
// Pass through distribution type
72-
"-Des.distribution.type=" + distroType
72+
// Pass through distribution type and java type
73+
"-Des.distribution.type=" + distroType,
74+
"-Des.java.type=" + javaType
7375
),
7476
maybeEnableNativeAccess(useEntitlements),
7577
maybeOverrideDockerCgroup(distroType),

docs/changelog/122459.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 122459
2+
summary: Double parameter markers for identifiers
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

0 commit comments

Comments
 (0)