Skip to content

Commit 70ed3e1

Browse files
committed
Merge branch 'master' into rollover-max-single-shard-size
2 parents 52927b7 + a92a647 commit 70ed3e1

File tree

14,931 files changed

+65454
-153376
lines changed

Some content is hidden

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

14,931 files changed

+65454
-153376
lines changed

.ci/teamcity.init.gradle

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
/*
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.
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
187
*/
198

209
gradle.settingsEvaluated { settings ->

CONTRIBUTING.md

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -442,35 +442,26 @@ We require license headers on all Java files. With the exception of the
442442
top-level `x-pack` directory, all contributed code should have the following
443443
license header unless instructed otherwise:
444444

445-
/*
446-
* Licensed to Elasticsearch under one or more contributor
447-
* license agreements. See the NOTICE file distributed with
448-
* this work for additional information regarding copyright
449-
* ownership. Elasticsearch licenses this file to you under
450-
* the Apache License, Version 2.0 (the "License"); you may
451-
* not use this file except in compliance with the License.
452-
* You may obtain a copy of the License at
453-
*
454-
* http://www.apache.org/licenses/LICENSE-2.0
455-
*
456-
* Unless required by applicable law or agreed to in writing,
457-
* software distributed under the License is distributed on an
458-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
459-
* KIND, either express or implied. See the License for the
460-
* specific language governing permissions and limitations
461-
* under the License.
462-
*/
445+
/*
446+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
447+
* or more contributor license agreements. Licensed under the Elastic License
448+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
449+
* in compliance with, at your election, the Elastic License 2.0 or the Server
450+
* Side Public License, v 1.
451+
*/
463452

464453
The top-level `x-pack` directory contains code covered by the [Elastic
465-
license](licenses/ELASTIC-LICENSE.txt). Community contributions to this code are
454+
license](licenses/ELASTIC-LICENSE-2.0.txt). Community contributions to this code are
466455
welcome, and should have the following license header unless instructed
467456
otherwise:
468457

469-
/*
470-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
471-
* or more contributor license agreements. Licensed under the Elastic License;
472-
* you may not use this file except in compliance with the Elastic License.
473-
*/
458+
/*
459+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
460+
* or more contributor license agreements. Licensed under the Elastic License
461+
* 2.0; you may not use this file except in compliance with the Elastic License
462+
* 2.0.
463+
*/
464+
474465

475466
It is important that the only code covered by the Elastic licence is contained
476467
within the top-level `x-pack` directory. The build will fail its pre-commit

LICENSE.txt

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
Source code in this repository is covered by one of three licenses: (i) the
2-
Apache License 2.0 (ii) an Apache License 2.0 compatible license (iii) the
3-
Elastic License. The default license throughout the repository is Apache License
4-
2.0 unless the header specifies another license. Elastic Licensed code is found
5-
only in the x-pack directory.
6-
7-
The build produces two sets of binaries - one set that falls under the Elastic
8-
License and another set that falls under Apache License 2.0. The binaries that
9-
contain `-oss` in the artifact name are licensed under Apache License 2.0 and
10-
these binaries do not package any code from the x-pack directory.
1+
Source code in this repository is covered by (i) a dual license under the Server
2+
Side Public License, v 1 and the Elastic License 2.0 or (ii) an Apache License
3+
2.0 compatible license or (iii) solely under the Elastic License 2.0, in each
4+
case, as noted in the applicable header. The default throughout the repository
5+
is a dual license under the Server Side Public License, v 1 and the Elastic
6+
License 2.0, unless the header specifies another license. Code that is licensed
7+
solely under the Elastic License 2.0 is found only in the x-pack folder.

NOTICE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Elasticsearch
2-
Copyright 2009-2018 Elasticsearch
2+
Copyright 2009-2021 Elasticsearch
33

44
This product includes software developed by The Apache Software
55
Foundation (http://www.apache.org/).

Vagrantfile

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,11 @@
44
# This Vagrantfile exists to test packaging. Read more about its use in the
55
# vagrant section in TESTING.asciidoc.
66

7-
# Licensed to Elasticsearch under one or more contributor
8-
# license agreements. See the NOTICE file distributed with
9-
# this work for additional information regarding copyright
10-
# ownership. Elasticsearch licenses this file to you under
11-
# the Apache License, Version 2.0 (the "License"); you may
12-
# not use this file except in compliance with the License.
13-
# You may obtain a copy of the License at
14-
#
15-
# http://www.apache.org/licenses/LICENSE-2.0
16-
#
17-
# Unless required by applicable law or agreed to in writing,
18-
# software distributed under the License is distributed on an
19-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20-
# KIND, either express or implied. See the License for the
21-
# specific language governing permissions and limitations
22-
# under the License.
7+
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
8+
# or more contributor license agreements. Licensed under the Elastic License
9+
# 2.0 and the Server Side Public License, v 1; you may not use this file except
10+
# in compliance with, at your election, the Elastic License 2.0 or the Server
11+
# Side Public License, v 1.
2312

2413
define_opts = {
2514
autostart: false

benchmarks/README.md

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,24 @@ If you want to run a specific benchmark class like, say,
2424
`MemoryStatsBenchmark`, you can use `--args`:
2525

2626
```
27-
gradlew -p benchmarks run --args ' MemoryStatsBenchmark'
27+
gradlew -p benchmarks run --args 'MemoryStatsBenchmark'
28+
```
29+
30+
Everything in the `'` gets sent on the command line to JMH.
31+
32+
You can set benchmark parameters with `-p`:
33+
```
34+
gradlew -p benchmarks/ run --args 'RoundingBenchmark.round -prounder=es -prange="2000-10-01 to 2000-11-01" -pzone=America/New_York -pinterval=10d -pcount=1000000'
35+
```
36+
37+
The benchmark code defines default values for the parameters so if
38+
you leave out any out JMH will run with each default value, one after
39+
the other. This will run with `interval` set to `calendar year` then
40+
`calendar hour` then `10d` then `5d` then `1h`:
41+
```
42+
gradlew -p benchmarks/ run --args 'RoundingBenchmark.round -prounder=es -prange="2000-10-01 to 2000-11-01" -pzone=America/New_York -pcount=1000000'
2843
```
2944

30-
Everything in the `'` gets sent on the command line to JMH. The leading ` `
31-
inside the `'`s is important. Without it parameters are sometimes sent to
32-
gradle.
3345

3446
## Adding Microbenchmarks
3547

@@ -55,7 +67,8 @@ To get realistic results, you should exercise care when running benchmarks. Here
5567
* Use the integrated profilers in JMH to dig deeper if benchmark results to not match your hypotheses:
5668
* Add `-prof gc` to the options to check whether the garbage collector runs during a microbenchmarks and skews
5769
your results. If so, try to force a GC between runs (`-gc true`) but watch out for the caveats.
58-
* Add `-prof perf` or `-prof perfasm` (both only available on Linux) to see hotspots.
70+
* Add `-prof perf` or `-prof perfasm` (both only available on Linux, see Disassembling below) to see hotspots.
71+
* Add `-prof async` to see hotspots.
5972
* Have your benchmarks peer-reviewed.
6073

6174
### Don't
@@ -66,6 +79,8 @@ To get realistic results, you should exercise care when running benchmarks. Here
6679

6780
## Disassembling
6881

82+
NOTE: Linux only. Sorry Mac and Windows.
83+
6984
Disassembling is fun! Maybe not always useful, but always fun! Generally, you'll want to install `perf` and FCML's `hsdis`.
7085
`perf` is generally available via `apg-get install perf` or `pacman -S perf`. FCML is a little more involved. This worked
7186
on 2020-08-01:
@@ -88,3 +103,30 @@ gradlew -p benchmarks run --args ' MemoryStatsBenchmark -jvmArgs "-XX:+UnlockDia
88103
```
89104

90105
If you want `perf` to find the hot methods for you then do add `-prof:perfasm`.
106+
107+
## Async Profiler
108+
109+
Note: Linux and Mac only. Sorry Windows.
110+
111+
The async profiler is neat because it does not suffer from the safepoint
112+
bias problem. And because it makes pretty flame graphs!
113+
114+
Let user processes read performance stuff:
115+
```
116+
sudo bash
117+
echo 0 > /proc/sys/kernel/kptr_restrict
118+
echo 1 > /proc/sys/kernel/perf_event_paranoid
119+
exit
120+
```
121+
122+
Grab the async profiler from https://github.com/jvm-profiling-tools/async-profiler
123+
and run `prof async` like so:
124+
```
125+
gradlew -p benchmarks/ run --args 'LongKeyedBucketOrdsBenchmark.multiBucket -prof "async:libPath=/home/nik9000/Downloads/tmp/async-profiler-1.8.3-linux-x64/build/libasyncProfiler.so;dir=/tmp/prof;output=flamegraph"'
126+
```
127+
128+
If you are on mac this'll warn you that you downloaded the shared library from
129+
the internet. You'll need to go to settings and allow it to run.
130+
131+
The profiler tells you it'll be more accurate if you install debug symbols
132+
with the JVM. I didn't and the results looked pretty good to me. (2021-02-01)

benchmarks/build.gradle

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
import org.elasticsearch.gradle.info.BuildParams
22

33
/*
4-
* Licensed to Elasticsearch under one or more contributor
5-
* license agreements. See the NOTICE file distributed with
6-
* this work for additional information regarding copyright
7-
* ownership. Elasticsearch licenses this file to you under
8-
* the Apache License, Version 2.0 (the "License"); you may
9-
* not use this file except in compliance with the License.
10-
* You may obtain a copy of the License at
11-
*
12-
* http://www.apache.org/licenses/LICENSE-2.0
13-
*
14-
* Unless required by applicable law or agreed to in writing,
15-
* software distributed under the License is distributed on an
16-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17-
* KIND, either express or implied. See the License for the
18-
* specific language governing permissions and limitations
19-
* under the License.
4+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5+
* or more contributor license agreements. Licensed under the Elastic License
6+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
7+
* in compliance with, at your election, the Elastic License 2.0 or the Server
8+
* Side Public License, v 1.
209
*/
2110

2211
apply plugin: 'elasticsearch.build'
@@ -29,7 +18,7 @@ archivesBaseName = 'elasticsearch-benchmarks'
2918
tasks.named("test").configure { enabled = false }
3019

3120
dependencies {
32-
api( project(":server")) {
21+
api(project(":server")) {
3322
// JMH ships with the conflicting version 4.6. This prevents us from using jopt-simple in benchmarks (which should be ok) but allows
3423
// us to invoke the JMH uberjar as usual.
3524
exclude group: 'net.sf.jopt-simple', module: 'jopt-simple'
@@ -61,12 +50,6 @@ tasks.named("dependenciesGraph").configure { enabled = false }
6150
tasks.named("thirdPartyAudit").configure {
6251
ignoreViolations(
6352
// these classes intentionally use JDK internal API (and this is ok since the project is maintained by Oracle employees)
64-
'org.openjdk.jmh.profile.AbstractHotspotProfiler',
65-
'org.openjdk.jmh.profile.HotspotThreadProfiler',
66-
'org.openjdk.jmh.profile.HotspotClassloadingProfiler',
67-
'org.openjdk.jmh.profile.HotspotCompilationProfiler',
68-
'org.openjdk.jmh.profile.HotspotMemoryProfiler',
69-
'org.openjdk.jmh.profile.HotspotRuntimeProfiler',
7053
'org.openjdk.jmh.util.Utils'
7154
)
7255
}

benchmarks/src/main/java/org/elasticsearch/benchmark/fs/AvailableIndexFoldersBenchmark.java

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
/*
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.
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
187
*/
198
package org.elasticsearch.benchmark.fs;
209

benchmarks/src/main/java/org/elasticsearch/benchmark/indices/breaker/MemoryStatsBenchmark.java

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
/*
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.
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
187
*/
198
package org.elasticsearch.benchmark.indices.breaker;
209

benchmarks/src/main/java/org/elasticsearch/benchmark/routing/allocation/AllocationBenchmark.java

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
/*
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.
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
187
*/
198
package org.elasticsearch.benchmark.routing.allocation;
209

0 commit comments

Comments
 (0)