Skip to content

Commit df86b70

Browse files
committed
Merge remote-tracking branch 'elastic/master' into opt-out-query-cache-unsafe-publication
* elastic/master: Update contributing docs to reflect JDK 11 (elastic#40955) Docs: Simplifying setup by using module configuration variant syntax (elastic#40879) Unmute CreateIndexIT testCreateAndDeleteIndexConcurrently CI failures (elastic#40960) Revert "Short-circuit rebalancing when disabled (elastic#40942)" Mute EnableAllocationShortCircuitTests SQL: Refactor args verification of In & conditionals (elastic#40916) Avoid sharing source directories as it breaks intellij (elastic#40877) Short-circuit rebalancing when disabled (elastic#40942) SQL: Prefer resultSets over exceptions in metadata (elastic#40641) Mute ClusterPrivilegeTests.testThatSnapshotAndRestore Fix Race in AsyncTwoPhaseIndexerTests.testStateMachine (elastic#40947) Relax Overly Strict Assertion in TransportShardBulkAction (elastic#40940)
2 parents 45a2686 + 3c69fdc commit df86b70

File tree

33 files changed

+546
-396
lines changed

33 files changed

+546
-396
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ Contributing to the Elasticsearch codebase
9595
JDK 12 is required to build Elasticsearch. You must have a JDK 12 installation
9696
with the environment variable `JAVA_HOME` referencing the path to Java home for
9797
your JDK 12 installation. By default, tests use the same runtime as `JAVA_HOME`.
98-
However, since Elasticsearch supports JDK 8, the build supports compiling with
99-
JDK 12 and testing on a JDK 8 runtime; to do this, set `RUNTIME_JAVA_HOME`
100-
pointing to the Java home of a JDK 8 installation. Note that this mechanism can
101-
be used to test against other JDKs as well, this is not only limited to JDK 8.
98+
However, since Elasticsearch supports JDK 11, the build supports compiling with
99+
JDK 12 and testing on a JDK 11 runtime; to do this, set `RUNTIME_JAVA_HOME`
100+
pointing to the Java home of a JDK 11 installation. Note that this mechanism can
101+
be used to test against other JDKs as well, this is not only limited to JDK 11.
102102

103103
> Note: It is also required to have `JAVA8_HOME`, `JAVA9_HOME`, `JAVA10_HOME`
104104
and `JAVA11_HOME` available so that the tests can pass.

build.gradle

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,6 @@ gradle.projectsEvaluated {
338338
integTest.mustRunAfter test
339339
}
340340
configurations.all { Configuration configuration ->
341-
/*
342-
* The featureAwarePlugin configuration has a dependency on x-pack:plugin:core and x-pack:plugin:core has a dependency on the
343-
* featureAwarePlugin configuration. The below task ordering logic would force :x-pack:plugin:core:test
344-
* :x-pack:test:feature-aware:test to depend on each other circularly. We break that cycle here.
345-
*/
346-
if (configuration.name == "featureAwarePlugin") {
347-
return
348-
}
349341
dependencies.all { Dependency dep ->
350342
Project upstreamProject = dependencyToProject(dep)
351343
if (upstreamProject != null) {
@@ -357,7 +349,7 @@ gradle.projectsEvaluated {
357349
Task task = project.tasks.findByName(taskName)
358350
Task upstreamTask = upstreamProject.tasks.findByName(taskName)
359351
if (task != null && upstreamTask != null) {
360-
task.mustRunAfter(upstreamTask)
352+
task.shouldRunAfter(upstreamTask)
361353
}
362354
}
363355
}
@@ -382,21 +374,6 @@ allprojects {
382374
// also ignore other possible build dirs
383375
excludeDirs += file('build')
384376
excludeDirs += file('build-eclipse')
385-
386-
iml {
387-
// fix so that Gradle idea plugin properly generates support for resource folders
388-
// see also https://issues.gradle.org/browse/GRADLE-2975
389-
withXml {
390-
it.asNode().component.content.sourceFolder.findAll { it.@url == 'file://$MODULE_DIR$/src/main/resources' }.each {
391-
it.attributes().remove('isTestSource')
392-
it.attributes().put('type', 'java-resource')
393-
}
394-
it.asNode().component.content.sourceFolder.findAll { it.@url == 'file://$MODULE_DIR$/src/test/resources' }.each {
395-
it.attributes().remove('isTestSource')
396-
it.attributes().put('type', 'java-test-resource')
397-
}
398-
}
399-
}
400377
}
401378
}
402379

@@ -414,14 +391,6 @@ idea {
414391
vcs = 'Git'
415392
}
416393
}
417-
// Make sure gradle idea was run before running anything in intellij (including import).
418-
File ideaMarker = new File(projectDir, '.local-idea-is-configured')
419-
tasks.idea.doLast {
420-
ideaMarker.setText('', 'UTF-8')
421-
}
422-
if (System.getProperty('idea.active') != null && ideaMarker.exists() == false) {
423-
throw new GradleException('You must run `./gradlew idea` from the root of elasticsearch before importing into IntelliJ')
424-
}
425394

426395
// eclipse configuration
427396
allprojects {

docs/reference/monitoring/configuring-metricbeat.asciidoc

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -81,53 +81,30 @@ run the following command:
8181

8282
["source","sh",subs="attributes,callouts"]
8383
----------------------------------------------------------------------
84-
metricbeat modules enable elasticsearch
84+
metricbeat modules enable elasticsearch-xpack
8585
----------------------------------------------------------------------
8686

8787
For more information, see
8888
{metricbeat-ref}/configuration-metricbeat.html[Specify which modules to run] and
8989
{metricbeat-ref}/metricbeat-module-elasticsearch.html[{es} module].
9090
--
9191

92-
.. Configure the {es} module in {metricbeat}. +
93-
+
94-
--
95-
You must specify the following settings in the `modules.d/elasticsearch.yml` file:
96-
97-
[source,yaml]
98-
----------------------------------
99-
- module: elasticsearch
100-
metricsets:
101-
- ccr
102-
- cluster_stats
103-
- index
104-
- index_recovery
105-
- index_summary
106-
- ml_job
107-
- node_stats
108-
- shard
109-
period: 10s
110-
hosts: ["http://localhost:9200"] <1>
111-
xpack.enabled: true <2>
112-
----------------------------------
113-
<1> This setting identifies the host and port number that are used to access {es}.
114-
<2> This setting ensures that {kib} can read this monitoring data successfully.
115-
That is to say, it's stored in the same location and format as monitoring data
116-
that is sent by <<es-monitoring-exporters,exporters>>.
117-
--
92+
.. By default the module will collect {es} monitoring metrics from `http://localhost:9200`.
93+
If the local {es} node has a different address, you must specify it via the `hosts` setting
94+
in the `modules.d/elasticsearch-xpack.yml` file.
11895

119-
.. If Elastic {security-features} are enabled, you must also provide a user ID
96+
.. If Elastic {security-features} are enabled, you must also provide a user ID
12097
and password so that {metricbeat} can collect metrics successfully.
12198

122-
... Create a user on the production cluster that has the
99+
... Create a user on the production cluster that has the
123100
{stack-ov}/built-in-roles.html[`remote_monitoring_collector` built-in role].
124101
Alternatively, use the {stack-ov}/built-in-users.html[`remote_monitoring_user` built-in user].
125102

126-
... Add the `username` and `password` settings to the {es} module configuration
103+
... Add the `username` and `password` settings to the {es} module configuration
127104
file.
128105
+
129106
--
130-
For example, add the following settings in the `modules.d/elasticsearch.yml` file:
107+
For example, add the following settings in the `modules.d/elasticsearch-xpack.yml` file:
131108

132109
[source,yaml]
133110
----------------------------------
@@ -140,7 +117,7 @@ For example, add the following settings in the `modules.d/elasticsearch.yml` fil
140117

141118
.. If you configured {es} to use <<configuring-tls,encrypted communications>>,
142119
you must access it via HTTPS. For example, use a `hosts` setting like
143-
`https://localhost:9200` in the `modules.d/elasticsearch.yml` file.
120+
`https://localhost:9200` in the `modules.d/elasticsearch-xpack.yml` file.
144121

145122
.. Identify where to send the monitoring data. +
146123
+

qa/full-cluster-restart/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,15 @@ task bwcTestSnapshots {
105105

106106
check.dependsOn(bwcTestSnapshots)
107107

108+
configurations {
109+
testArtifacts.extendsFrom testRuntime
110+
}
111+
112+
task testJar(type: Jar) {
113+
appendix 'test'
114+
from sourceSets.test.output
115+
}
116+
117+
artifacts {
118+
testArtifacts testJar
119+
}

server/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public static void performOnPrimary(
147147
Consumer<ActionListener<Void>> waitForMappingUpdate,
148148
ActionListener<PrimaryResult<BulkShardRequest, BulkShardResponse>> listener,
149149
ThreadPool threadPool) {
150-
new ActionRunnable<PrimaryResult<BulkShardRequest, BulkShardResponse>>(listener) {
150+
new ActionRunnable<>(listener) {
151151

152152
private final Executor executor = threadPool.executor(ThreadPool.Names.WRITE);
153153

@@ -189,11 +189,11 @@ public void onRejection(Exception e) {
189189
}
190190

191191
private void finishRequest() {
192-
listener.onResponse(
193-
new WritePrimaryResult<>(context.getBulkShardRequest(), context.buildShardResponse(), context.getLocationToSync(),
194-
null, context.getPrimary(), logger));
192+
ActionListener.completeWith(listener,
193+
() -> new WritePrimaryResult<>(
194+
context.getBulkShardRequest(), context.buildShardResponse(), context.getLocationToSync(), null,
195+
context.getPrimary(), logger));
195196
}
196-
197197
}.run();
198198
}
199199

server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ public void testInvalidShardCountSettingsWithoutPrefix() throws Exception {
254254
}
255255
}
256256

257-
@AwaitsFix( bugUrl = "https://github.com/elastic/elasticsearch/issues/40951")
258257
public void testCreateAndDeleteIndexConcurrently() throws InterruptedException {
259258
createIndex("test");
260259
final AtomicInteger indexVersion = new AtomicInteger(0);

x-pack/plugin/core/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ dependencies {
4848
testCompile project(path: ':modules:reindex', configuration: 'runtime')
4949
testCompile project(path: ':modules:parent-join', configuration: 'runtime')
5050
testCompile project(path: ':modules:analysis-common', configuration: 'runtime')
51+
testCompile(project(':x-pack:license-tools')) {
52+
transitive = false
53+
}
5154
testCompile ("org.elasticsearch.client:elasticsearch-rest-high-level-client:${version}")
5255
}
5356

@@ -95,8 +98,8 @@ licenseHeaders {
9598
}
9699

97100
// make LicenseSigner available for testing signed licenses
98-
sourceSets.test.java {
99-
srcDir '../../license-tools/src/main/java'
101+
sourceSets.test.resources {
102+
srcDir 'src/main/config'
100103
}
101104

102105
unitTest {

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexing/AsyncTwoPhaseIndexerTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private class MockIndexer extends AsyncTwoPhaseIndexer<Integer, MockJobStats> {
3939

4040
private final CountDownLatch latch;
4141
// test the execution order
42-
private int step;
42+
private volatile int step;
4343

4444
protected MockIndexer(Executor executor, AtomicReference<IndexerState> initialState, Integer initialPosition,
4545
CountDownLatch latch) {
@@ -113,8 +113,8 @@ protected void onFailure(Exception exc) {
113113
protected void onFinish(ActionListener<Void> listener) {
114114
assertThat(step, equalTo(4));
115115
++step;
116-
isFinished.set(true);
117116
listener.onResponse(null);
117+
isFinished.set(true);
118118
}
119119

120120
@Override
@@ -206,8 +206,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
206206
}
207207
}
208208

209-
@AwaitsFix( bugUrl = "https://github.com/elastic/elasticsearch/issues/40946")
210-
public void testStateMachine() throws InterruptedException {
209+
public void testStateMachine() throws Exception {
211210
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
212211
final ExecutorService executor = Executors.newFixedThreadPool(1);
213212
isFinished.set(false);

x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/AnnotationIndexIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public void testNotCreatedWhenNoOtherMlIndices() {
5151
}
5252
}
5353

54-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/40933")
5554
public void testCreatedWhenAfterOtherMlIndex() throws Exception {
5655

5756
Auditor auditor = new Auditor(client(), "node_1");

x-pack/plugin/security/build.gradle

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ dependencies {
136136
compileJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked"
137137
compileTestJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked"
138138

139+
processTestResources {
140+
from(project(xpackModule('core')).file('src/main/config'))
141+
from(project(xpackModule('core')).file('src/test/resources'))
142+
}
143+
139144
configurations {
140145
testArtifacts.extendsFrom testRuntime
141146
}
@@ -148,10 +153,7 @@ artifacts {
148153
archives jar
149154
testArtifacts testJar
150155
}
151-
sourceSets.test.resources {
152-
srcDir '../core/src/test/resources'
153-
srcDir '../core/src/main/config'
154-
}
156+
155157
dependencyLicenses {
156158
mapping from: /java-support|opensaml-.*/, to: 'shibboleth'
157159
mapping from: /http.*/, to: 'httpclient'

0 commit comments

Comments
 (0)