Skip to content

Commit b6612e9

Browse files
committed
Merge branch 'master' into llrc-java-7
* master: Mute AnalysisModuleTests#testStandardFilterBWC (elastic#38636) add geotile_grid ref to asciidoc (elastic#38632) Enable Dockerfile from artifacts.elastic.co (elastic#38552) Mute FollowerFailOverIT testFailOverOnFollower (elastic#38634) Account for a possible rolled over file while reading the audit log file (elastic#34909) Mute failure in InternalEngineTests (elastic#38622) Fix Issue with Concurrent Snapshot Init + Delete (elastic#38518) Refactor ZonedDateTime.now in millis resolution (elastic#38577) Mute failing WatchStatusIntegrationTests (elastic#38621) Mute failing ApiKeyIntegTests (elastic#38614) [DOCS] Add warning about bypassing ML PUT APIs (elastic#38509) Add 7.1 and 8.0 version constants to master (elastic#38514)
2 parents 114c42a + 4504206 commit b6612e9

File tree

66 files changed

+632
-1596
lines changed

Some content is hidden

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

66 files changed

+632
-1596
lines changed

buildSrc/src/main/java/org/elasticsearch/gradle/VersionCollection.java

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,30 +171,38 @@ public UnreleasedVersionInfo unreleasedInfo(Version version) {
171171
}
172172

173173
public void forPreviousUnreleased(Consumer<UnreleasedVersionInfo> consumer) {
174-
getUnreleased().stream()
174+
List<UnreleasedVersionInfo> collect = getUnreleased().stream()
175175
.filter(version -> version.equals(currentVersion) == false)
176-
.forEach(version -> consumer.accept(
177-
new UnreleasedVersionInfo(
176+
.map(version -> new UnreleasedVersionInfo(
178177
version,
179178
getBranchFor(version),
180179
getGradleProjectNameFor(version)
181180
)
182-
));
181+
)
182+
.collect(Collectors.toList());
183+
184+
collect.forEach(uvi -> consumer.accept(uvi));
183185
}
184186

185187
private String getGradleProjectNameFor(Version version) {
186188
if (version.equals(currentVersion)) {
187189
throw new IllegalArgumentException("The Gradle project to build " + version + " is the current build.");
188190
}
191+
189192
Map<Integer, List<Version>> releasedMajorGroupedByMinor = getReleasedMajorGroupedByMinor();
190193

191194
if (version.getRevision() == 0) {
192-
if (releasedMajorGroupedByMinor
193-
.get(releasedMajorGroupedByMinor.keySet().stream().max(Integer::compareTo).orElse(0))
194-
.contains(version)) {
195-
return "minor";
195+
List<Version> unreleasedStagedOrMinor = getUnreleased().stream()
196+
.filter(v -> v.getRevision() == 0)
197+
.collect(Collectors.toList());
198+
if (unreleasedStagedOrMinor.size() > 2) {
199+
if (unreleasedStagedOrMinor.get(unreleasedStagedOrMinor.size() - 2).equals(version)) {
200+
return "minor";
201+
} else{
202+
return "staged";
203+
}
196204
} else {
197-
return "staged";
205+
return "minor";
198206
}
199207
} else {
200208
if (releasedMajorGroupedByMinor
@@ -239,8 +247,10 @@ public List<Version> getUnreleased() {
239247
unreleased.add(getLatestVersionByKey(groupByMinor, greatestMinor - 1));
240248
if (groupByMinor.getOrDefault(greatestMinor - 1, emptyList()).size() == 1) {
241249
// we found that the previous minor is staged but not yet released
242-
// in this case, the minor before that has a bugfix
243-
unreleased.add(getLatestVersionByKey(groupByMinor, greatestMinor - 2));
250+
// in this case, the minor before that has a bugfix, should there be such a minor
251+
if (greatestMinor >= 2) {
252+
unreleased.add(getLatestVersionByKey(groupByMinor, greatestMinor - 2));
253+
}
244254
}
245255
}
246256

buildSrc/src/test/java/org/elasticsearch/gradle/VersionCollectionTests.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ public class VersionCollectionTests extends GradleUnitTestCase {
8181
"6_0_0", "6_0_1", "6_1_0", "6_1_1", "6_1_2", "6_1_3", "6_1_4", "6_2_0", "6_2_1", "6_2_2", "6_2_3",
8282
"6_2_4", "6_3_0", "6_3_1", "6_3_2", "6_4_0", "6_4_1", "6_4_2"
8383
));
84+
sampleVersions.put("7.1.0", asList(
85+
"7_1_0", "7_0_0", "6_7_0", "6_6_1", "6_6_0"
86+
));
8487
}
8588

8689
@Test(expected = IllegalArgumentException.class)
@@ -145,6 +148,11 @@ public void testWireCompatible() {
145148
singletonList("7.3.0"),
146149
getVersionCollection("8.0.0").getWireCompatible()
147150
);
151+
assertVersionsEquals(
152+
asList("6.7.0", "7.0.0"),
153+
getVersionCollection("7.1.0").getWireCompatible()
154+
);
155+
148156
}
149157

150158
public void testWireCompatibleUnreleased() {
@@ -171,6 +179,10 @@ public void testWireCompatibleUnreleased() {
171179
singletonList("7.3.0"),
172180
getVersionCollection("8.0.0").getUnreleasedWireCompatible()
173181
);
182+
assertVersionsEquals(
183+
asList("6.7.0", "7.0.0"),
184+
getVersionCollection("7.1.0").getWireCompatible()
185+
);
174186
}
175187

176188
public void testIndexCompatible() {
@@ -286,7 +298,7 @@ public void testGetBranch() {
286298
getVersionCollection("6.4.2")
287299
);
288300
assertUnreleasedBranchNames(
289-
asList("5.6", "6.4", "6.5"),
301+
asList("5.6", "6.4", "6.x"),
290302
getVersionCollection("6.6.0")
291303
);
292304
assertUnreleasedBranchNames(
@@ -309,13 +321,17 @@ public void testGetGradleProjectName() {
309321
getVersionCollection("6.4.2")
310322
);
311323
assertUnreleasedGradleProjectNames(
312-
asList("maintenance", "bugfix", "staged"),
324+
asList("maintenance", "bugfix", "minor"),
313325
getVersionCollection("6.6.0")
314326
);
315327
assertUnreleasedGradleProjectNames(
316328
asList("bugfix", "staged", "minor"),
317329
getVersionCollection("8.0.0")
318330
);
331+
assertUnreleasedGradleProjectNames(
332+
asList("staged", "minor"),
333+
getVersionCollection("7.1.0")
334+
);
319335
}
320336

321337
public void testCompareToAuthoritative() {

buildSrc/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
elasticsearch = 7.0.0
1+
elasticsearch = 8.0.0
22
lucene = 8.0.0-snapshot-83f9835
33

44
# optional dependencies

distribution/bwc/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ bwcVersions.forPreviousUnreleased { VersionCollection.UnreleasedVersionInfo unre
141141
extension += '.gz'
142142
}
143143
}
144+
if (bwcVersion.onOrAfter('7.0.0') && projectName.contains('deb')) {
145+
classifier = "-amd64"
146+
}
147+
if (bwcVersion.onOrAfter('7.0.0') && projectName.contains('rpm')) {
148+
classifier = "-x86_64"
149+
}
144150
if (bwcVersion.onOrAfter('6.3.0')) {
145151
baseDir += projectName.endsWith('zip') || projectName.endsWith('tar') ? '/archives' : '/packages'
146152
// add oss variant first

distribution/docker/build.gradle

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,35 @@ dependencies {
1818
}
1919

2020
ext.expansions = { oss ->
21-
String classifier = 'linux-x86_64'
21+
final String classifier = 'linux-x86_64'
22+
final String elasticsearch = oss ? "elasticsearch-oss-${VersionProperties.elasticsearch}-${classifier}.tar.gz" : "elasticsearch-${VersionProperties.elasticsearch}-${classifier}.tar.gz"
2223
return [
23-
'elasticsearch' : oss ? "elasticsearch-oss-${VersionProperties.elasticsearch}-${classifier}.tar.gz" : "elasticsearch-${VersionProperties.elasticsearch}-${classifier}.tar.gz",
24-
'jdkUrl' : 'https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz',
25-
'jdkVersion' : '11.0.2',
26-
'license': oss ? 'Apache-2.0' : 'Elastic License',
27-
'version' : VersionProperties.elasticsearch
24+
'elasticsearch' : elasticsearch,
25+
'jdkUrl' : 'https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz',
26+
'jdkVersion' : '11.0.2',
27+
'license' : oss ? 'Apache-2.0' : 'Elastic License',
28+
'source_elasticsearch': local() ? "COPY $elasticsearch /opt/" : "RUN curl --retry 8 -s -L -O https://artifacts.elastic.co/downloads/elasticsearch/${elasticsearch}",
29+
'version' : VersionProperties.elasticsearch
2830
]
2931
}
3032

33+
/*
34+
* We need to be able to render a Dockerfile that references the official artifacts on https://artifacts.elastic.co. For this, we use a
35+
* substitution in the Dockerfile template where we can either replace source_elasticsearch with a COPY from the Docker build context, or
36+
* a RUN curl command to retrieve the artifact from https://artifacts.elastic.co. The system property build.docker.source, which can be
37+
* either "local" (default) or "remote" controls which version of the Dockerfile is produced.
38+
*/
39+
private static boolean local() {
40+
final String buildDockerSource = System.getProperty("build.docker.source")
41+
if (buildDockerSource == null || "local".equals(buildDockerSource)) {
42+
return true
43+
} else if ("remote".equals(buildDockerSource)) {
44+
return false
45+
} else {
46+
throw new IllegalArgumentException("expected build.docker.source to be [local] or [remote] but was [" + buildDockerSource + "]")
47+
}
48+
}
49+
3150
private static String files(final boolean oss) {
3251
return "build/${ oss ? 'oss-' : ''}docker"
3352
}
@@ -48,20 +67,22 @@ void addCopyDockerContextTask(final boolean oss) {
4867
from 'src/docker/config'
4968
}
5069

51-
if (oss) {
52-
from configurations.ossDockerSource
53-
} else {
54-
from configurations.dockerSource
55-
}
70+
if (local()) {
71+
if (oss) {
72+
from configurations.ossDockerSource
73+
} else {
74+
from configurations.dockerSource
75+
}
5676

57-
from configurations.dockerPlugins
77+
from configurations.dockerPlugins
78+
}
5879
}
5980
}
6081

6182
void addCopyDockerfileTask(final boolean oss) {
6283
task(taskName("copy", oss, "Dockerfile"), type: Copy) {
84+
dependsOn taskName("copy", oss, "DockerContext")
6385
inputs.properties(expansions(oss)) // ensure task is run when ext.expansions is changed
64-
mustRunAfter(taskName("copy", oss, "DockerContext"))
6586
into files(oss)
6687

6788
from('src/docker/Dockerfile') {
@@ -70,7 +91,6 @@ void addCopyDockerfileTask(final boolean oss) {
7091
}
7192
}
7293

73-
7494
preProcessFixture {
7595
dependsOn taskName("copy", true, "DockerContext")
7696
dependsOn taskName("copy", true, "Dockerfile")

distribution/docker/src/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ RUN groupadd -g 1000 elasticsearch && \
3030

3131
WORKDIR /usr/share/elasticsearch
3232

33-
COPY ${elasticsearch} /opt/
33+
${source_elasticsearch}
34+
3435
RUN tar zxf /opt/${elasticsearch} --strip-components=1
3536
RUN mkdir -p config data logs
3637
RUN chmod 0775 config data logs
3738
COPY config/elasticsearch.yml config/log4j2.properties config/
3839

39-
4040
################################################################################
4141
# Build stage 1 (the actual elasticsearch image):
4242
# Copy elasticsearch from stage 0

distribution/tools/plugin-cli/src/test/java/org/elasticsearch/plugins/RemovePluginCommandTests.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,21 @@ public void testBasic() throws Exception {
137137
}
138138

139139
public void testRemoveOldVersion() throws Exception {
140+
Version previous = VersionUtils.getPreviousVersion();
141+
if (previous.before(Version.CURRENT.minimumIndexCompatibilityVersion()) ) {
142+
// Can happen when bumping majors: 8.0 is only compat back to 7.0, but that's not released yet
143+
// In this case, ignore what's released and just find that latest version before current
144+
previous = VersionUtils.allVersions().stream()
145+
.filter(v -> v.before(Version.CURRENT))
146+
.max(Version::compareTo)
147+
.get();
148+
}
140149
createPlugin(
141150
"fake",
142151
VersionUtils.randomVersionBetween(
143152
random(),
144153
Version.CURRENT.minimumIndexCompatibilityVersion(),
145-
VersionUtils.getPreviousVersion()));
154+
previous));
146155
removePlugin("fake", home, randomBoolean());
147156
assertThat(Files.exists(env.pluginsFile().resolve("fake")), equalTo(false));
148157
assertRemoveCleaned(env);

docs/Versions.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
:version: 7.0.0-alpha2
2-
:major-version: 7.x
1+
:version: 8.0.0-alpha1
2+
:major-version: 8.x
33
:lucene_version: 8.0.0
44
:lucene_version_path: 8_0_0
55
:branch: master

docs/reference/aggregations/bucket.asciidoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ include::bucket/geodistance-aggregation.asciidoc[]
3939

4040
include::bucket/geohashgrid-aggregation.asciidoc[]
4141

42+
include::bucket/geotilegrid-aggregation.asciidoc[]
43+
4244
include::bucket/global-aggregation.asciidoc[]
4345

4446
include::bucket/histogram-aggregation.asciidoc[]
@@ -62,4 +64,3 @@ include::bucket/significantterms-aggregation.asciidoc[]
6264
include::bucket/significanttext-aggregation.asciidoc[]
6365

6466
include::bucket/terms-aggregation.asciidoc[]
65-

docs/reference/ml/apis/put-datafeed.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ Instantiates a {dfeed}.
1919
You must create a job before you create a {dfeed}. You can associate only one
2020
{dfeed} to each job.
2121

22+
IMPORTANT: You must use {kib} or this API to create a {dfeed}. Do not put a {dfeed}
23+
directly to the `.ml-config` index using the Elasticsearch index API.
24+
If {es} {security-features} are enabled, do not give users `write`
25+
privileges on the `.ml-config` index.
26+
2227

2328
==== Path Parameters
2429

docs/reference/ml/apis/put-job.asciidoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ Instantiates a job.
1212

1313
`PUT _ml/anomaly_detectors/<job_id>`
1414

15-
//===== Description
15+
===== Description
16+
17+
IMPORTANT: You must use {kib} or this API to create a {ml} job. Do not put a job
18+
directly to the `.ml-config` index using the Elasticsearch index API.
19+
If {es} {security-features} are enabled, do not give users `write`
20+
privileges on the `.ml-config` index.
21+
1622

1723
==== Path Parameters
1824

0 commit comments

Comments
 (0)