Skip to content

Commit 01d7698

Browse files
Merge branch 'master' into repository-encrypted-client-side
2 parents dcddd25 + b072f5f commit 01d7698

File tree

2,915 files changed

+72172
-43551
lines changed

Some content is hidden

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

2,915 files changed

+72172
-43551
lines changed

.ci/bwcVersions

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ BWC_VERSION:
1717
- "7.6.0"
1818
- "7.6.1"
1919
- "7.6.2"
20-
- "7.6.3"
2120
- "7.7.0"
21+
- "7.7.1"
2222
- "7.8.0"
23+
- "7.9.0"
2324
- "8.0.0"

.github/ISSUE_TEMPLATE.md

-46
This file was deleted.

.github/ISSUE_TEMPLATE/bug.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Bug
3+
about: "Report a confirmed bug. For unconfirmed bugs please
4+
visit https://discuss.elastic.co/c/elasticsearch"
5+
labels: ">bug,needs:triage"
6+
7+
---
8+
<!--
9+
GitHub is reserved for bug reports and feature requests; it is not the place
10+
for general questions. If you have a question or an unconfirmed bug , please
11+
visit the [forums](https://discuss.elastic.co/c/elasticsearch). Please also
12+
check your OS is [supported](https://www.elastic.co/support/matrix#show_os).
13+
If it is not, the issue is likely to be closed.
14+
15+
For security vulnerabilities please only send reports to [email protected].
16+
See https://www.elastic.co/community/security for more information.
17+
18+
Please fill in the following details to help us reproduce the bug:
19+
-->
20+
21+
**Elasticsearch version** (`bin/elasticsearch --version`):
22+
23+
**Plugins installed**: []
24+
25+
**JVM version** (`java -version`):
26+
27+
**OS version** (`uname -a` if on a Unix-like system):
28+
29+
**Description of the problem including expected versus actual behavior**:
30+
31+
**Steps to reproduce**:
32+
33+
Please include a *minimal* but *complete* recreation of the problem,
34+
including (e.g.) index creation, mappings, settings, query etc. The easier
35+
you make for us to reproduce it, the more likely that somebody will take the
36+
time to look at it.
37+
38+
1.
39+
2.
40+
3.
41+
42+
**Provide logs (if relevant)**:
43+
44+

.github/ISSUE_TEMPLATE/config.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Question
4+
url: https://discuss.elastic.co/c/elasticsearch
5+
about: Ask (and answer) questions here.
6+
- name: Security Vulnerability
7+
url: https://www.elastic.co/community/security
8+
about: Send security vulnerability reports to [email protected].
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Feature Request
3+
about: Request a new feature we haven't thought of
4+
labels: ">enhancement,needs:triage"
5+
6+
---
7+
<!--
8+
Please first search existing issues for the feature you are requesting;
9+
it may already exist, even as a closed issue.
10+
-->
11+
12+
<!--
13+
Describe the feature.
14+
15+
Please give us as much context as possible about the feature. For example,
16+
you could include a story about a time when you wanted to use the feature,
17+
and also tell us what you had to do instead. The last part is helpful
18+
because it gives us an idea of how much harder your life is without the
19+
feature.
20+
21+
-->
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Test Failure
3+
about: A test failure in CI
4+
labels: ">test-failure"
5+
6+
---
7+
8+
<!--
9+
Please fill out the following information, and ensure you have attempted
10+
to reproduce locally
11+
-->
12+
13+
**Build scan**:
14+
15+
**Repro line**:
16+
17+
**Reproduces locally?**:
18+
19+
**Applicable branches**:
20+
21+
**Failure history**:
22+
<!--
23+
Link to build stats and possible indication of when this started failing and how often it fails
24+
<https://build-stats.elastic.co/app/kibana>
25+
-->
26+
**Failure excerpt**:
27+
28+

CONTRIBUTING.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,20 @@ onwards and Eclipse 2020-3 and onwards.
115115

116116
./gradlew :run
117117

118-
You can access Elasticsearch with:
118+
That'll spend a while building Elasticsearch and then it'll start Elasticsearch,
119+
writing its log above Gradle's status message. We log a lot of stuff on startup,
120+
specifically these lines tell you that Elasticsearch is ready:
121+
122+
[2020-05-29T14:50:35,167][INFO ][o.e.h.AbstractHttpServerTransport] [runTask-0] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
123+
[2020-05-29T14:50:35,169][INFO ][o.e.n.Node ] [runTask-0] started
124+
125+
But to be honest its typically easier to wait until the console stopps scrolling
126+
and then run `curl` in another window like this:
119127

120128
curl -u elastic:password localhost:9200
121129

130+
131+
122132
### Importing the project into IntelliJ IDEA
123133

124134
Elasticsearch builds using Java 14. When importing into IntelliJ you will need

TESTING.asciidoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ To run all verification tasks, including static checks, unit tests, and integrat
253253
---------------------------------------------------------------------------
254254

255255
Note that this will also run the unit tests and precommit tasks first. If you want to just
256-
run the integration tests (because you are debugging them):
256+
run the in memory cluster integration tests (because you are debugging them):
257257

258258
---------------------------------------------------------------------------
259-
./gradlew integTest
259+
./gradlew internalClusterTest
260260
---------------------------------------------------------------------------
261261

262262
If you want to just run the precommit checks:

Vagrantfile

+3-13
Original file line numberDiff line numberDiff line change
@@ -491,22 +491,12 @@ JAVA
491491
rm -rf /tmp/bats
492492
}
493493
494-
cat \<\<VARS > /etc/profile.d/elasticsearch_vars.sh
495-
export ZIP=/elasticsearch/distribution/zip/build/distributions
496-
export TAR=/elasticsearch/distribution/tar/build/distributions
497-
export RPM=/elasticsearch/distribution/rpm/build/distributions
498-
export DEB=/elasticsearch/distribution/deb/build/distributions
499-
export PACKAGING_TESTS=/project/build/packaging/tests
500-
VARS
501494
cat \<\<SUDOERS_VARS > /etc/sudoers.d/elasticsearch_vars
502-
Defaults env_keep += "ZIP"
503-
Defaults env_keep += "TAR"
504-
Defaults env_keep += "RPM"
505-
Defaults env_keep += "DEB"
506-
Defaults env_keep += "PACKAGING_ARCHIVES"
507-
Defaults env_keep += "PACKAGING_TESTS"
508495
Defaults env_keep += "BATS_UTILS"
509496
Defaults env_keep += "BATS_TESTS"
497+
Defaults env_keep += "BATS_PLUGINS"
498+
Defaults env_keep += "BATS_UPGRADE"
499+
Defaults env_keep += "PACKAGE_NAME"
510500
Defaults env_keep += "JAVA_HOME"
511501
Defaults env_keep += "SYSTEM_JAVA_HOME"
512502
SUDOERS_VARS

benchmarks/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ To get realistic results, you should exercise care when running benchmarks. Here
5353
`performance` CPU governor.
5454
* Vary the problem input size with `@Param`.
5555
* Use the integrated profilers in JMH to dig deeper if benchmark results to not match your hypotheses:
56-
* Run the generated uberjar directly and use `-prof gc` to check whether the garbage collector runs during a microbenchmarks and skews
56+
* Add `-prof gc` to the options to check whether the garbage collector runs during a microbenchmarks and skews
5757
your results. If so, try to force a GC between runs (`-gc true`) but watch out for the caveats.
58-
* Use `-prof perf` or `-prof perfasm` (both only available on Linux) to see hotspots.
58+
* Add `-prof perf` or `-prof perfasm` (both only available on Linux) to see hotspots.
5959
* Have your benchmarks peer-reviewed.
6060

6161
### Don't
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
/*
2+
* Licensed to Elasticsearch under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.elasticsearch.common;
21+
22+
import org.elasticsearch.common.time.DateFormatter;
23+
import org.elasticsearch.common.unit.TimeValue;
24+
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder;
25+
import org.openjdk.jmh.annotations.Benchmark;
26+
import org.openjdk.jmh.annotations.BenchmarkMode;
27+
import org.openjdk.jmh.annotations.Fork;
28+
import org.openjdk.jmh.annotations.Measurement;
29+
import org.openjdk.jmh.annotations.Mode;
30+
import org.openjdk.jmh.annotations.OutputTimeUnit;
31+
import org.openjdk.jmh.annotations.Param;
32+
import org.openjdk.jmh.annotations.Scope;
33+
import org.openjdk.jmh.annotations.Setup;
34+
import org.openjdk.jmh.annotations.State;
35+
import org.openjdk.jmh.annotations.Warmup;
36+
import org.openjdk.jmh.infra.Blackhole;
37+
38+
import java.time.ZoneId;
39+
import java.util.concurrent.TimeUnit;
40+
import java.util.function.Supplier;
41+
42+
@Fork(2)
43+
@Warmup(iterations = 10)
44+
@Measurement(iterations = 5)
45+
@BenchmarkMode(Mode.AverageTime)
46+
@OutputTimeUnit(TimeUnit.NANOSECONDS)
47+
@State(Scope.Benchmark)
48+
public class RoundingBenchmark {
49+
private static final DateFormatter FORMATTER = DateFormatter.forPattern("date_optional_time");
50+
51+
@Param({
52+
"2000-01-01 to 2020-01-01", // A super long range
53+
"2000-10-01 to 2000-11-01", // A whole month which is pretty believable
54+
"2000-10-29 to 2000-10-30", // A date right around daylight savings time.
55+
"2000-06-01 to 2000-06-02" // A date fully in one time zone. Should be much faster than above.
56+
})
57+
public String range;
58+
59+
@Param({ "java time", "es" })
60+
public String rounder;
61+
62+
@Param({ "UTC", "America/New_York" })
63+
public String zone;
64+
65+
@Param({ "calendar year", "calendar hour", "10d", "5d", "1h" })
66+
public String interval;
67+
68+
@Param({ "1", "10000", "1000000", "100000000" })
69+
public int count;
70+
71+
private long min;
72+
private long max;
73+
private long[] dates;
74+
private Supplier<Rounding.Prepared> rounderBuilder;
75+
76+
@Setup
77+
public void buildDates() {
78+
String[] r = range.split(" to ");
79+
min = FORMATTER.parseMillis(r[0]);
80+
max = FORMATTER.parseMillis(r[1]);
81+
dates = new long[count];
82+
long date = min;
83+
long diff = (max - min) / dates.length;
84+
for (int i = 0; i < dates.length; i++) {
85+
if (date >= max) {
86+
throw new IllegalStateException("made a bad date [" + date + "]");
87+
}
88+
dates[i] = date;
89+
date += diff;
90+
}
91+
Rounding.Builder roundingBuilder;
92+
if (interval.startsWith("calendar ")) {
93+
roundingBuilder = Rounding.builder(
94+
DateHistogramAggregationBuilder.DATE_FIELD_UNITS.get(interval.substring("calendar ".length()))
95+
);
96+
} else {
97+
roundingBuilder = Rounding.builder(TimeValue.parseTimeValue(interval, "interval"));
98+
}
99+
Rounding rounding = roundingBuilder.timeZone(ZoneId.of(zone)).build();
100+
switch (rounder) {
101+
case "java time":
102+
rounderBuilder = rounding::prepareJavaTime;
103+
break;
104+
case "es":
105+
rounderBuilder = () -> rounding.prepare(min, max);
106+
break;
107+
default:
108+
throw new IllegalArgumentException("Expectd rounder to be [java time] or [es]");
109+
}
110+
}
111+
112+
@Benchmark
113+
public void round(Blackhole bh) {
114+
Rounding.Prepared rounder = rounderBuilder.get();
115+
for (int i = 0; i < dates.length; i++) {
116+
bh.consume(rounder.round(dates[i]));
117+
}
118+
}
119+
120+
@Benchmark
121+
public void nextRoundingValue(Blackhole bh) {
122+
Rounding.Prepared rounder = rounderBuilder.get();
123+
for (int i = 0; i < dates.length; i++) {
124+
bh.consume(rounder.nextRoundingValue(dates[i]));
125+
}
126+
}
127+
}

0 commit comments

Comments
 (0)