Skip to content

Commit a767959

Browse files
committed
Merge branch 'main' of github.com:elastic/elasticsearch into additional-migration-info-for-ds-reindex
2 parents 21de2d2 + 2f6fcf5 commit a767959

File tree

299 files changed

+6276
-1462
lines changed

Some content is hidden

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

299 files changed

+6276
-1462
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,6 @@ testfixtures_shared/
6969
# Generated
7070
checkstyle_ide.xml
7171
x-pack/plugin/esql/src/main/generated-src/generated/
72+
73+
# JEnv
74+
.java-version

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,15 @@
3131
import org.gradle.api.tasks.bundling.Jar;
3232
import org.gradle.api.tasks.javadoc.Javadoc;
3333
import org.gradle.external.javadoc.CoreJavadocOptions;
34+
import org.gradle.jvm.toolchain.JavaLanguageVersion;
35+
import org.gradle.jvm.toolchain.JavaToolchainService;
3436
import org.gradle.language.base.plugins.LifecycleBasePlugin;
3537

3638
import java.io.File;
3739
import java.util.Map;
3840

41+
import javax.inject.Inject;
42+
3943
import static org.elasticsearch.gradle.internal.conventions.util.Util.toStringable;
4044
import static org.elasticsearch.gradle.internal.util.ParamsUtils.loadBuildParams;
4145

@@ -44,6 +48,14 @@
4448
* common configuration for production code.
4549
*/
4650
public class ElasticsearchJavaPlugin implements Plugin<Project> {
51+
52+
private final JavaToolchainService javaToolchains;
53+
54+
@Inject
55+
ElasticsearchJavaPlugin(JavaToolchainService javaToolchains) {
56+
this.javaToolchains = javaToolchains;
57+
}
58+
4759
@Override
4860
public void apply(Project project) {
4961
project.getRootProject().getPlugins().apply(GlobalBuildInfoPlugin.class);
@@ -55,7 +67,7 @@ public void apply(Project project) {
5567
// configureConfigurations(project);
5668
configureJars(project, buildParams.get());
5769
configureJarManifest(project, buildParams.get());
58-
configureJavadoc(project);
70+
configureJavadoc(project, buildParams.get());
5971
testCompileOnlyDeps(project);
6072
}
6173

@@ -128,14 +140,18 @@ private static void configureJarManifest(Project project, BuildParameterExtensio
128140
project.getPluginManager().apply("nebula.info-jar");
129141
}
130142

131-
private static void configureJavadoc(Project project) {
143+
private void configureJavadoc(Project project, BuildParameterExtension buildParams) {
132144
project.getTasks().withType(Javadoc.class).configureEach(javadoc -> {
133145
/*
134146
* Generate docs using html5 to suppress a warning from `javadoc`
135147
* that the default will change to html5 in the future.
136148
*/
137149
CoreJavadocOptions javadocOptions = (CoreJavadocOptions) javadoc.getOptions();
138150
javadocOptions.addBooleanOption("html5", true);
151+
152+
javadoc.getJavadocTool().set(javaToolchains.javadocToolFor(spec -> {
153+
spec.getLanguageVersion().set(JavaLanguageVersion.of(buildParams.getMinimumRuntimeVersion().getMajorVersion()));
154+
}));
139155
});
140156

141157
TaskProvider<Javadoc> javadoc = project.getTasks().withType(Javadoc.class).named("javadoc");

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

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
import org.gradle.api.Plugin;
1818
import org.gradle.api.Project;
1919
import org.gradle.api.Task;
20+
import org.gradle.api.file.FileSystemOperations;
2021
import org.gradle.api.file.ProjectLayout;
2122
import org.gradle.api.model.ObjectFactory;
2223
import org.gradle.api.plugins.JvmToolchainsPlugin;
2324
import org.gradle.api.provider.Provider;
2425
import org.gradle.api.provider.ProviderFactory;
25-
import org.gradle.api.tasks.Copy;
2626
import org.gradle.api.tasks.PathSensitivity;
2727
import org.gradle.api.tasks.TaskProvider;
2828
import org.gradle.jvm.toolchain.JavaToolchainService;
@@ -54,11 +54,17 @@ public class InternalDistributionBwcSetupPlugin implements Plugin<Project> {
5454
private final ObjectFactory objectFactory;
5555
private ProviderFactory providerFactory;
5656
private JavaToolchainService toolChainService;
57+
private FileSystemOperations fileSystemOperations;
5758

5859
@Inject
59-
public InternalDistributionBwcSetupPlugin(ObjectFactory objectFactory, ProviderFactory providerFactory) {
60+
public InternalDistributionBwcSetupPlugin(
61+
ObjectFactory objectFactory,
62+
ProviderFactory providerFactory,
63+
FileSystemOperations fileSystemOperations
64+
) {
6065
this.objectFactory = objectFactory;
6166
this.providerFactory = providerFactory;
67+
this.fileSystemOperations = fileSystemOperations;
6268
}
6369

6470
@Override
@@ -76,7 +82,8 @@ public void apply(Project project) {
7682
providerFactory,
7783
objectFactory,
7884
toolChainService,
79-
isCi
85+
isCi,
86+
fileSystemOperations
8087
);
8188
});
8289
}
@@ -88,7 +95,8 @@ private static void configureBwcProject(
8895
ProviderFactory providerFactory,
8996
ObjectFactory objectFactory,
9097
JavaToolchainService toolChainService,
91-
Boolean isCi
98+
Boolean isCi,
99+
FileSystemOperations fileSystemOperations
92100
) {
93101
ProjectLayout layout = project.getLayout();
94102
Provider<BwcVersions.UnreleasedVersionInfo> versionInfoProvider = providerFactory.provider(() -> versionInfo);
@@ -120,11 +128,18 @@ private static void configureBwcProject(
120128
List<DistributionProject> distributionProjects = resolveArchiveProjects(checkoutDir.get(), bwcVersion.get());
121129

122130
// Setup gradle user home directory
123-
project.getTasks().register("setupGradleUserHome", Copy.class, copy -> {
124-
copy.into(project.getGradle().getGradleUserHomeDir().getAbsolutePath() + "-" + project.getName());
125-
copy.from(project.getGradle().getGradleUserHomeDir().getAbsolutePath(), copySpec -> {
126-
copySpec.include("gradle.properties");
127-
copySpec.include("init.d/*");
131+
// We don't use a normal `Copy` task here as snapshotting the entire gradle user home is very expensive. This task is cheap, so
132+
// up-to-date checking doesn't buy us much
133+
project.getTasks().register("setupGradleUserHome", task -> {
134+
task.doLast(t -> {
135+
fileSystemOperations.copy(copy -> {
136+
String gradleUserHome = project.getGradle().getGradleUserHomeDir().getAbsolutePath();
137+
copy.into(gradleUserHome + "-" + project.getName());
138+
copy.from(gradleUserHome, copySpec -> {
139+
copySpec.include("gradle.properties");
140+
copySpec.include("init.d/*");
141+
});
142+
});
128143
});
129144
});
130145

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ public void apply(Project project) {
8686
configurePreviewFeatures(project, javaExtension.getSourceSets().getByName(SourceSet.TEST_SOURCE_SET_NAME), 21);
8787
for (int javaVersion : mainVersions) {
8888
String mainSourceSetName = SourceSet.MAIN_SOURCE_SET_NAME + javaVersion;
89-
SourceSet mainSourceSet = addSourceSet(project, javaExtension, mainSourceSetName, mainSourceSets, javaVersion);
89+
SourceSet mainSourceSet = addSourceSet(project, javaExtension, mainSourceSetName, mainSourceSets, javaVersion, true);
9090
configureSourceSetInJar(project, mainSourceSet, javaVersion);
9191
addJar(project, mainSourceSet, javaVersion);
9292
mainSourceSets.add(mainSourceSetName);
9393
testSourceSets.add(mainSourceSetName);
9494

9595
String testSourceSetName = SourceSet.TEST_SOURCE_SET_NAME + javaVersion;
96-
SourceSet testSourceSet = addSourceSet(project, javaExtension, testSourceSetName, testSourceSets, javaVersion);
96+
SourceSet testSourceSet = addSourceSet(project, javaExtension, testSourceSetName, testSourceSets, javaVersion, false);
9797
testSourceSets.add(testSourceSetName);
9898
createTestTask(project, buildParams, testSourceSet, javaVersion, mainSourceSets);
9999
}
@@ -121,7 +121,8 @@ private SourceSet addSourceSet(
121121
JavaPluginExtension javaExtension,
122122
String sourceSetName,
123123
List<String> parentSourceSets,
124-
int javaVersion
124+
int javaVersion,
125+
boolean isMainSourceSet
125126
) {
126127
SourceSet sourceSet = javaExtension.getSourceSets().maybeCreate(sourceSetName);
127128
for (String parentSourceSetName : parentSourceSets) {
@@ -135,6 +136,13 @@ private SourceSet addSourceSet(
135136
CompileOptions compileOptions = compileTask.getOptions();
136137
compileOptions.getRelease().set(javaVersion);
137138
});
139+
if (isMainSourceSet) {
140+
project.getTasks().create(sourceSet.getJavadocTaskName(), Javadoc.class, javadocTask -> {
141+
javadocTask.getJavadocTool().set(javaToolchains.javadocToolFor(spec -> {
142+
spec.getLanguageVersion().set(JavaLanguageVersion.of(javaVersion));
143+
}));
144+
});
145+
}
138146
configurePreviewFeatures(project, sourceSet, javaVersion);
139147

140148
// Since we configure MRJAR sourcesets to allow preview apis, class signatures for those

distribution/src/config/jvm.options

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## should create one or more files in the jvm.options.d
1010
## directory containing your adjustments.
1111
##
12-
## See https://www.elastic.co/guide/en/elasticsearch/reference/@project.minor.version@/jvm-options.html
12+
## See https://www.elastic.co/guide/en/elasticsearch/reference/@project.minor.version@/advanced-configuration.html#set-jvm-options
1313
## for more information.
1414
##
1515
################################################################

docs/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ testClusters.matching { it.name == "yamlRestTest"}.configureEach {
130130
setting 'xpack.security.enabled', 'true'
131131
setting 'xpack.security.authc.api_key.enabled', 'true'
132132
setting 'xpack.security.authc.token.enabled', 'true'
133-
// disable the ILM history for doc tests to avoid potential lingering tasks that'd cause test flakiness
133+
// disable the ILM and SLM history for doc tests to avoid potential lingering tasks that'd cause test flakiness
134134
setting 'indices.lifecycle.history_index_enabled', 'false'
135+
setting 'slm.history_index_enabled', 'false'
135136
setting 'xpack.license.self_generated.type', 'trial'
136137
setting 'xpack.security.authc.realms.file.file.order', '0'
137138
setting 'xpack.security.authc.realms.native.native.order', '1'

docs/changelog/116423.yaml

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

docs/changelog/117778.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 117778
2+
summary: "[Connector APIs] Enforce index prefix for managed connectors"
3+
area: Extract&Transform
4+
type: feature
5+
issues: []

docs/changelog/118266.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 118266
2+
summary: Prevent data nodes from sending stack traces to coordinator when `error_trace=false`
3+
area: Search
4+
type: enhancement
5+
issues: []

docs/changelog/118366.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
pr: 118366
2+
summary: |-
3+
Configuring a bind DN in an LDAP or Active Directory (AD) realm without a corresponding bind password
4+
will prevent node from starting
5+
area: Authentication
6+
type: breaking
7+
issues: []
8+
breaking:
9+
title: -|
10+
Configuring a bind DN in an LDAP or Active Directory (AD) realm without
11+
a corresponding bind password will prevent node from starting
12+
area: Cluster and node setting
13+
details: -|
14+
For LDAP or AD authentication realms, setting a bind DN (via the
15+
`xpack.security.authc.realms.ldap.*.bind_dn` or `xpack.security.authc.realms.active_directory.*.bind_dn`
16+
realm settings) without a bind password is a misconfiguration that may prevent successful authentication
17+
to the node. Nodes will fail to start if a bind DN is specified without a password.
18+
impact: -|
19+
If you have a bind DN configured for an LDAP or AD authentication
20+
realm, set a bind password for {ref}/ldap-realm.html#ldap-realm-configuration[LDAP]
21+
or {ref}/active-directory-realm.html#ad-realm-configuration[Active Directory].
22+
Configuring a bind DN without a password prevents the misconfigured node from starting.

0 commit comments

Comments
 (0)