Skip to content

Commit 6663e24

Browse files
committed
Merge remote-tracking branch 'es/6.x' into ccr-6.x
* es/6.x: (24 commits) Fix broken backport Switch full-cluster-restart to new style Requests (#32140) Fix multi level nested sort (#32204) MINOR: Remove unused `IndexDynamicSettings` (#32237) (#32248) [Tests] Remove QueryStringQueryBuilderTests#toQuery class assertions (#32236) Switch rolling restart to new style Requests (#32147) Enhance Parent circuit breaker error message (#32056) [ML] Use default request durability for .ml-state index (#32233) Enable testing in FIPS140 JVM (#31666) (#32231) Remove indices stats timeout from monitoring docs TESTS: Check for Netty resource leaks (#31861) (#32225) Rename ranking evaluation response section (#32166) Dependencies: Upgrade to joda time 2.10 (#32160) Backport SSL context names (#30953) to 6.x (#32223) Require Gradle 4.9 as minimum version (#32200) Detect old trial licenses and mimic behaviour (#32209) Painless: Simplify Naming in Lookup Package (#32177) add support for write index resolution when creating/updating documents (#31520) A replica can be promoted and started in one cluster state update (#32042) Rest test - allow for snapshots to take 0 milliseconds ...
2 parents 9174493 + f98ebb2 commit 6663e24

File tree

195 files changed

+4532
-2018
lines changed

Some content is hidden

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

195 files changed

+4532
-2018
lines changed

buildSrc/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ plugins {
2525

2626
group = 'org.elasticsearch.gradle'
2727

28-
if (GradleVersion.current() < GradleVersion.version('3.3')) {
29-
throw new GradleException('Gradle 3.3+ is required to build elasticsearch')
28+
if (GradleVersion.current() < GradleVersion.version('4.9')) {
29+
throw new GradleException('Gradle 4.9+ is required to build elasticsearch')
3030
}
3131

3232
if (JavaVersion.current() < JavaVersion.VERSION_1_8) {

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ class BuildPlugin implements Plugin<Project> {
6767
+ 'elasticearch.standalone-rest-test, and elasticsearch.build '
6868
+ 'are mutually exclusive')
6969
}
70+
if (GradleVersion.current() < GradleVersion.version('4.9')) {
71+
throw new GradleException('Gradle 4.9+ is required to use elasticsearch.build plugin')
72+
}
7073
project.pluginManager.apply('java')
7174
project.pluginManager.apply('carrotsearch.randomized-testing')
7275
// these plugins add lots of info to our jars

buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ public class PluginBuildPlugin extends BuildPlugin {
7575
// and generate a different pom for the zip
7676
addClientJarPomGeneration(project)
7777
addClientJarTask(project)
78-
} else {
79-
// no client plugin, so use the pom file from nebula, without jar, for the zip
80-
project.ext.set("nebulaPublish.maven.jar", false)
8178
}
79+
// while the jar isn't normally published, we still at least build a pom of deps
80+
// in case it is published, for instance when other plugins extend this plugin
81+
configureJarPom(project)
8282

8383
project.integTestCluster.dependsOn(project.bundlePlugin)
8484
project.tasks.run.dependsOn(project.bundlePlugin)
@@ -92,7 +92,6 @@ public class PluginBuildPlugin extends BuildPlugin {
9292
}
9393

9494
if (isModule == false || isXPackModule) {
95-
addZipPomGeneration(project)
9695
addNoticeGeneration(project)
9796
}
9897

@@ -237,36 +236,15 @@ public class PluginBuildPlugin extends BuildPlugin {
237236
}
238237
}
239238

240-
/** Adds a task to generate a pom file for the zip distribution. */
241-
public static void addZipPomGeneration(Project project) {
239+
/** Configure the pom for the main jar of this plugin */
240+
protected static void configureJarPom(Project project) {
242241
project.plugins.apply(ScmInfoPlugin.class)
243242
project.plugins.apply(MavenPublishPlugin.class)
244243

245244
project.publishing {
246245
publications {
247-
zip(MavenPublication) {
248-
artifact project.bundlePlugin
249-
}
250-
/* HUGE HACK: the underlying maven publication library refuses to deploy any attached artifacts
251-
* when the packaging type is set to 'pom'. But Sonatype's OSS repositories require source files
252-
* for artifacts that are of type 'zip'. We already publish the source and javadoc for Elasticsearch
253-
* under the various other subprojects. So here we create another publication using the same
254-
* name that has the "real" pom, and rely on the fact that gradle will execute the publish tasks
255-
* in alphabetical order. This lets us publish the zip file and even though the pom says the
256-
* type is 'pom' instead of 'zip'. We cannot setup a dependency between the tasks because the
257-
* publishing tasks are created *extremely* late in the configuration phase, so that we cannot get
258-
* ahold of the actual task. Furthermore, this entire hack only exists so we can make publishing to
259-
* maven local work, since we publish to maven central externally. */
260-
zipReal(MavenPublication) {
261-
artifactId = project.pluginProperties.extension.name
262-
pom.withXml { XmlProvider xml ->
263-
Node root = xml.asNode()
264-
root.appendNode('name', project.pluginProperties.extension.name)
265-
root.appendNode('description', project.pluginProperties.extension.description)
266-
root.appendNode('url', urlFromOrigin(project.scminfo.origin))
267-
Node scmNode = root.appendNode('scm')
268-
scmNode.appendNode('url', project.scminfo.origin)
269-
}
246+
nebula(MavenPublication) {
247+
artifactId project.pluginProperties.extension.name
270248
}
271249
}
272250
}

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterConfiguration.groovy

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ class ClusterConfiguration {
142142
// there are cases when value depends on task that is not executed yet on configuration stage
143143
Map<String, Object> systemProperties = new HashMap<>()
144144

145+
Map<String, Object> environmentVariables = new HashMap<>()
146+
145147
Map<String, Object> settings = new HashMap<>()
146148

147149
Map<String, String> keystoreSettings = new HashMap<>()
@@ -164,6 +166,11 @@ class ClusterConfiguration {
164166
systemProperties.put(property, value)
165167
}
166168

169+
@Input
170+
void environment(String variable, Object value) {
171+
environmentVariables.put(variable, value)
172+
}
173+
167174
@Input
168175
void setting(String name, Object value) {
169176
settings.put(name, value)

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/NodeInfo.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ class NodeInfo {
181181

182182
args.addAll("-E", "node.portsfile=true")
183183
env = [:]
184+
env.putAll(config.environmentVariables)
184185
for (Map.Entry<String, String> property : System.properties.entrySet()) {
185186
if (property.key.startsWith('tests.es.')) {
186187
args.add("-E")

client/rest-high-level/src/test/java/org/elasticsearch/client/RankEvalIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import java.util.stream.Collectors;
4141
import java.util.stream.Stream;
4242

43-
import static org.elasticsearch.index.rankeval.EvaluationMetric.filterUnknownDocuments;
43+
import static org.elasticsearch.index.rankeval.EvaluationMetric.filterUnratedDocuments;
4444

4545
public class RankEvalIT extends ESRestHighLevelClientTestCase {
4646

@@ -85,7 +85,7 @@ public void testRankEvalRequest() throws IOException {
8585
Map<String, EvalQueryQuality> partialResults = response.getPartialResults();
8686
assertEquals(2, partialResults.size());
8787
EvalQueryQuality amsterdamQueryQuality = partialResults.get("amsterdam_query");
88-
assertEquals(2, filterUnknownDocuments(amsterdamQueryQuality.getHitsAndRatings()).size());
88+
assertEquals(2, filterUnratedDocuments(amsterdamQueryQuality.getHitsAndRatings()).size());
8989
List<RatedSearchHit> hitsAndRatings = amsterdamQueryQuality.getHitsAndRatings();
9090
assertEquals(7, hitsAndRatings.size());
9191
for (RatedSearchHit hit : hitsAndRatings) {
@@ -97,7 +97,7 @@ public void testRankEvalRequest() throws IOException {
9797
}
9898
}
9999
EvalQueryQuality berlinQueryQuality = partialResults.get("berlin_query");
100-
assertEquals(6, filterUnknownDocuments(berlinQueryQuality.getHitsAndRatings()).size());
100+
assertEquals(6, filterUnratedDocuments(berlinQueryQuality.getHitsAndRatings()).size());
101101
hitsAndRatings = berlinQueryQuality.getHitsAndRatings();
102102
assertEquals(7, hitsAndRatings.size());
103103
for (RatedSearchHit hit : hitsAndRatings) {

client/rest/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ forbiddenApisMain {
5959
PrecommitTasks.getResource('/forbidden/http-signatures.txt')]
6060
}
6161

62+
forbiddenPatterns {
63+
exclude '**/*.der'
64+
}
65+
6266
forbiddenApisTest {
6367
//we are using jdk-internal instead of jdk-non-portable to allow for com.sun.net.httpserver.* usage
6468
bundledSignatures -= 'jdk-non-portable'

client/rest/src/test/java/org/elasticsearch/client/RestClientBuilderIntegTests.java

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@
3535
import java.io.InputStream;
3636
import java.net.InetAddress;
3737
import java.net.InetSocketAddress;
38+
import java.nio.file.Files;
39+
import java.nio.file.Paths;
40+
import java.security.KeyFactory;
3841
import java.security.KeyStore;
42+
import java.security.cert.Certificate;
43+
import java.security.cert.CertificateFactory;
44+
import java.security.spec.PKCS8EncodedKeySpec;
3945

4046
import static org.hamcrest.Matchers.containsString;
4147
import static org.junit.Assert.assertEquals;
@@ -103,12 +109,20 @@ private RestClient buildRestClient() {
103109

104110
private static SSLContext getSslContext() throws Exception {
105111
SSLContext sslContext = SSLContext.getInstance("TLS");
106-
try (InputStream in = RestClientBuilderIntegTests.class.getResourceAsStream("/testks.jks")) {
107-
KeyStore keyStore = KeyStore.getInstance("JKS");
108-
keyStore.load(in, "password".toCharArray());
109-
KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
112+
try (InputStream certFile = RestClientBuilderIntegTests.class.getResourceAsStream("/test.crt")) {
113+
// Build a keystore of default type programmatically since we can't use JKS keystores to
114+
// init a KeyManagerFactory in FIPS 140 JVMs.
115+
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
116+
keyStore.load(null, "password".toCharArray());
117+
CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
118+
PKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(Files.readAllBytes(Paths.get(RestClientBuilderIntegTests.class
119+
.getResource("/test.der").toURI())));
120+
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
121+
keyStore.setKeyEntry("mykey", keyFactory.generatePrivate(privateKeySpec), "password".toCharArray(),
122+
new Certificate[]{certFactory.generateCertificate(certFile)});
123+
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
110124
kmf.init(keyStore, "password".toCharArray());
111-
TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
125+
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
112126
tmf.init(keyStore);
113127
sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
114128
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIEATCCAumgAwIBAgIEObhDZDANBgkqhkiG9w0BAQsFADBnMQswCQYDVQQGEwJV
3+
UzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxEDAOBgNVBAoT
4+
B2VsYXN0aWMxDTALBgNVBAsTBHRlc3QxEjAQBgNVBAMTCXRlc3Qgbm9kZTAeFw0x
5+
NzA3MTcxNjEyNTZaFw0yNzA3MTUxNjEyNTZaMGcxCzAJBgNVBAYTAlVTMQswCQYD
6+
VQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHZWxhc3Rp
7+
YzENMAsGA1UECxMEdGVzdDESMBAGA1UEAxMJdGVzdCBub2RlMIIBIjANBgkqhkiG
8+
9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnXtuGIgAq6vWzUD34HXkYF+0u103hb8d1h35
9+
kjeuNApkUhS6x/VbuNp7TpWmprfDgG5w9TourHvyiqcQMDEWrBunS6rmKo1jK1Wm
10+
le3qA3F2l9VIZSNeeYQgezmzuElEPPmBjN8XBByIWKYjZcGd5u7DiquPUh9QLIev
11+
itgB2jfi9D8ewyvaSbVAQuQwyIaDN9L74wKyMC8EuzzAWNSDjgIhhwcR5qg17msa
12+
ItyM44/3hik+ObIGpMlLSxQu2V1U9bOaq48JjQBLHVg1vzC9VzGuNdEb8haFnhJN
13+
UrdESdHymbtBSUvy30iB+kHq5R8wQ4pC+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