Skip to content

Commit d3417fb

Browse files
committed
Merge branch 'master' into feature/seq_no
* master: (516 commits) Avoid angering Log4j in TransportNodesActionTests Add trace logging when aquiring and releasing operation locks for replication requests Fix handler name on message not fully read Remove accidental import. Improve log message in TransportNodesAction Clean up of Script. Update Joda Time to version 2.9.5 (#21468) Remove unused ClusterService dependency from SearchPhaseController (#21421) Remove max_local_storage_nodes from elasticsearch.yml (#21467) Wait for all reindex subtasks before rethrottling Correcting a typo-Maan to Man-in README.textile (#21466) Fix InternalSearchHit#hasSource to return the proper boolean value (#21441) Replace all index date-math examples with the URI encoded form Fix typos (#21456) Adapt ES_JVM_OPTIONS packaging test to ubuntu-1204 Add null check in InternalSearchHit#sourceRef to prevent NPE (#21431) Add VirtualBox version check (#21370) Export ES_JVM_OPTIONS for SysV init Skip reindex rethrottle tests with workers Make forbidden APIs be quieter about classpath warnings (#21443) ...
2 parents 9ceb0f2 + 179dd88 commit d3417fb

File tree

2,486 files changed

+41483
-23010
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,486 files changed

+41483
-23010
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ dependency-reduced-pom.xml
3333
# testing stuff
3434
**/.local*
3535
.vagrant/
36+
/logs/
3637

3738
# osx stuff
3839
.DS_Store

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ Contributing to the Elasticsearch codebase
8888
**Repository:** [https://github.com/elastic/elasticsearch](https://github.com/elastic/elasticsearch)
8989

9090
Make sure you have [Gradle](http://gradle.org) installed, as
91-
Elasticsearch uses it as its build system.
91+
Elasticsearch uses it as its build system. Gradle must be version 2.13 _exactly_ in
92+
order to build successfully.
9293

9394
Eclipse users can automatically configure their IDE: `gradle eclipse`
9495
then `File: Import: Existing Projects into Workspace`. Select the

README.textile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ There are many more options to perform search, after all, it's a search product
123123

124124
h3. Multi Tenant - Indices and Types
125125

126-
Maan, that twitter index might get big (in this case, index size == valuation). Let's see if we can structure our twitter system a bit differently in order to support such large amounts of data.
126+
Man, that twitter index might get big (in this case, index size == valuation). Let's see if we can structure our twitter system a bit differently in order to support such large amounts of data.
127127

128128
Elasticsearch supports multiple indices, as well as multiple types per index. In the previous example we used an index called @twitter@, with two types, @user@ and @tweet@.
129129

@@ -200,7 +200,7 @@ We have just covered a very small portion of what Elasticsearch is all about. Fo
200200

201201
h3. Building from Source
202202

203-
Elasticsearch uses "Gradle":https://gradle.org for its build system. You'll need to have a modern version of Gradle installed - 2.13 should do.
203+
Elasticsearch uses "Gradle":https://gradle.org for its build system. You'll need to have version 2.13 of Gradle installed.
204204

205205
In order to create a distribution, simply run the @gradle assemble@ command in the cloned directory.
206206

TESTING.asciidoc

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,6 @@ following:
1616
gradle assemble
1717
-----------------------------
1818

19-
== Other test options
20-
21-
To disable and enable network transport, set the `tests.es.node.mode` system property.
22-
23-
Use network transport:
24-
25-
------------------------------------
26-
-Dtests.es.node.mode=network
27-
------------------------------------
28-
29-
Use local transport (default since 1.3):
30-
31-
-------------------------------------
32-
-Dtests.es.node.mode=local
33-
-------------------------------------
34-
3519
=== Running Elasticsearch from a checkout
3620

3721
In order to run Elasticsearch from source without building a package, you can
@@ -41,6 +25,12 @@ run it using Gradle:
4125
gradle run
4226
-------------------------------------
4327

28+
or to attach a remote debugger, run it as:
29+
30+
-------------------------------------
31+
gradle run --debug-jvm
32+
-------------------------------------
33+
4434
=== Test case filtering.
4535

4636
- `tests.class` is a class-filtering shell-like glob pattern,
@@ -363,7 +353,6 @@ These are the linux flavors the Vagrantfile currently supports:
363353

364354
* ubuntu-1204 aka precise
365355
* ubuntu-1404 aka trusty
366-
* ubuntu-1504 aka vivid
367356
* ubuntu-1604 aka xenial
368357
* debian-8 aka jessie, the current debian stable distribution
369358
* centos-6

Vagrantfile

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ Vagrant.configure(2) do |config|
3030
config.vm.box = "elastic/ubuntu-14.04-x86_64"
3131
ubuntu_common config
3232
end
33-
config.vm.define "ubuntu-1504" do |config|
34-
config.vm.box = "elastic/ubuntu-15.04-x86_64"
35-
ubuntu_common config, extra: <<-SHELL
36-
# Install Jayatana so we can work around it being present.
37-
[ -f /usr/share/java/jayatanaag.jar ] || install jayatana
38-
SHELL
39-
end
4033
config.vm.define "ubuntu-1604" do |config|
4134
config.vm.box = "elastic/ubuntu-16.04-x86_64"
4235
ubuntu_common config, extra: <<-SHELL
@@ -156,6 +149,7 @@ def dnf_common(config)
156149
update_command: "dnf check-update",
157150
update_tracking_file: "/var/cache/dnf/last_update",
158151
install_command: "dnf install -y",
152+
install_command_retries: 5,
159153
java_package: "java-1.8.0-openjdk-devel")
160154
if Vagrant.has_plugin?("vagrant-cachier")
161155
# Autodetect doesn't work....
@@ -205,6 +199,7 @@ def provision(config,
205199
update_command: 'required',
206200
update_tracking_file: 'required',
207201
install_command: 'required',
202+
install_command_retries: 0,
208203
java_package: 'required',
209204
extra: '')
210205
# Vagrant run ruby 2.0.0 which doesn't have required named parameters....
@@ -215,9 +210,27 @@ def provision(config,
215210
config.vm.provision "bats dependencies", type: "shell", inline: <<-SHELL
216211
set -e
217212
set -o pipefail
213+
214+
# Retry install command up to $2 times, if failed
215+
retry_installcommand() {
216+
n=0
217+
while true; do
218+
#{install_command} $1 && break
219+
let n=n+1
220+
if [ $n -ge $2 ]; then
221+
echo "==> Exhausted retries to install $1"
222+
return 1
223+
fi
224+
echo "==> Retrying installing $1, attempt $((n+1))"
225+
# Add a small delay to increase chance of metalink providing updated list of mirrors
226+
sleep 5
227+
done
228+
}
229+
218230
installed() {
219231
command -v $1 2>&1 >/dev/null
220232
}
233+
221234
install() {
222235
# Only apt-get update if we haven't in the last day
223236
if [ ! -f #{update_tracking_file} ] || [ "x$(find #{update_tracking_file} -mtime +0)" == "x#{update_tracking_file}" ]; then
@@ -226,8 +239,14 @@ def provision(config,
226239
touch #{update_tracking_file}
227240
fi
228241
echo "==> Installing $1"
229-
#{install_command} $1
242+
if [ #{install_command_retries} -eq 0 ]
243+
then
244+
#{install_command} $1
245+
else
246+
retry_installcommand $1 #{install_command_retries}
247+
fi
230248
}
249+
231250
ensure() {
232251
installed $1 || install $1
233252
}

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

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -58,57 +58,57 @@ public class AllocationBenchmark {
5858
// support to constrain the combinations of benchmark parameters and we do not want to rely on OptionsBuilder as each benchmark would
5959
// need its own main method and we cannot execute more than one class with a main method per JAR.
6060
@Param({
61-
// indices, shards, replicas, nodes
62-
" 10, 1, 0, 1",
63-
" 10, 3, 0, 1",
64-
" 10, 10, 0, 1",
65-
" 100, 1, 0, 1",
66-
" 100, 3, 0, 1",
67-
" 100, 10, 0, 1",
68-
69-
" 10, 1, 0, 10",
70-
" 10, 3, 0, 10",
71-
" 10, 10, 0, 10",
72-
" 100, 1, 0, 10",
73-
" 100, 3, 0, 10",
74-
" 100, 10, 0, 10",
75-
76-
" 10, 1, 1, 10",
77-
" 10, 3, 1, 10",
78-
" 10, 10, 1, 10",
79-
" 100, 1, 1, 10",
80-
" 100, 3, 1, 10",
81-
" 100, 10, 1, 10",
82-
83-
" 10, 1, 2, 10",
84-
" 10, 3, 2, 10",
85-
" 10, 10, 2, 10",
86-
" 100, 1, 2, 10",
87-
" 100, 3, 2, 10",
88-
" 100, 10, 2, 10",
89-
90-
" 10, 1, 0, 50",
91-
" 10, 3, 0, 50",
92-
" 10, 10, 0, 50",
93-
" 100, 1, 0, 50",
94-
" 100, 3, 0, 50",
95-
" 100, 10, 0, 50",
96-
97-
" 10, 1, 1, 50",
98-
" 10, 3, 1, 50",
99-
" 10, 10, 1, 50",
100-
" 100, 1, 1, 50",
101-
" 100, 3, 1, 50",
102-
" 100, 10, 1, 50",
103-
104-
" 10, 1, 2, 50",
105-
" 10, 3, 2, 50",
106-
" 10, 10, 2, 50",
107-
" 100, 1, 2, 50",
108-
" 100, 3, 2, 50",
109-
" 100, 10, 2, 50"
61+
// indices| shards| replicas| nodes
62+
" 10| 1| 0| 1",
63+
" 10| 3| 0| 1",
64+
" 10| 10| 0| 1",
65+
" 100| 1| 0| 1",
66+
" 100| 3| 0| 1",
67+
" 100| 10| 0| 1",
68+
69+
" 10| 1| 0| 10",
70+
" 10| 3| 0| 10",
71+
" 10| 10| 0| 10",
72+
" 100| 1| 0| 10",
73+
" 100| 3| 0| 10",
74+
" 100| 10| 0| 10",
75+
76+
" 10| 1| 1| 10",
77+
" 10| 3| 1| 10",
78+
" 10| 10| 1| 10",
79+
" 100| 1| 1| 10",
80+
" 100| 3| 1| 10",
81+
" 100| 10| 1| 10",
82+
83+
" 10| 1| 2| 10",
84+
" 10| 3| 2| 10",
85+
" 10| 10| 2| 10",
86+
" 100| 1| 2| 10",
87+
" 100| 3| 2| 10",
88+
" 100| 10| 2| 10",
89+
90+
" 10| 1| 0| 50",
91+
" 10| 3| 0| 50",
92+
" 10| 10| 0| 50",
93+
" 100| 1| 0| 50",
94+
" 100| 3| 0| 50",
95+
" 100| 10| 0| 50",
96+
97+
" 10| 1| 1| 50",
98+
" 10| 3| 1| 50",
99+
" 10| 10| 1| 50",
100+
" 100| 1| 1| 50",
101+
" 100| 3| 1| 50",
102+
" 100| 10| 1| 50",
103+
104+
" 10| 1| 2| 50",
105+
" 10| 3| 2| 50",
106+
" 10| 10| 2| 50",
107+
" 100| 1| 2| 50",
108+
" 100| 3| 2| 50",
109+
" 100| 10| 2| 50"
110110
})
111-
public String indicesShardsReplicasNodes = "10,1,0,1";
111+
public String indicesShardsReplicasNodes = "10|1|0|1";
112112

113113
public int numTags = 2;
114114

@@ -117,7 +117,7 @@ public class AllocationBenchmark {
117117

118118
@Setup
119119
public void setUp() throws Exception {
120-
final String[] params = indicesShardsReplicasNodes.split(",");
120+
final String[] params = indicesShardsReplicasNodes.split("\\|");
121121

122122
int numIndices = toInt(params[0]);
123123
int numShards = toInt(params[1]);

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,18 @@
3131
import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders;
3232
import org.elasticsearch.common.settings.ClusterSettings;
3333
import org.elasticsearch.common.settings.Settings;
34-
import org.elasticsearch.common.transport.LocalTransportAddress;
34+
import org.elasticsearch.common.transport.TransportAddress;
3535
import org.elasticsearch.common.util.set.Sets;
3636
import org.elasticsearch.gateway.GatewayAllocator;
3737

3838
import java.lang.reflect.InvocationTargetException;
39+
import java.net.InetAddress;
40+
import java.net.UnknownHostException;
3941
import java.util.Collection;
4042
import java.util.Collections;
4143
import java.util.List;
4244
import java.util.Map;
45+
import java.util.concurrent.atomic.AtomicInteger;
4346

4447
public final class Allocators {
4548
private static class NoopGatewayAllocator extends GatewayAllocator {
@@ -91,8 +94,11 @@ public static AllocationDeciders defaultAllocationDeciders(Settings settings, Cl
9194

9295
}
9396

97+
private static final AtomicInteger portGenerator = new AtomicInteger();
98+
9499
public static DiscoveryNode newNode(String nodeId, Map<String, String> attributes) {
95-
return new DiscoveryNode("", nodeId, LocalTransportAddress.buildUnique(), attributes, Sets.newHashSet(DiscoveryNode.Role.MASTER,
100+
return new DiscoveryNode("", nodeId, new TransportAddress(TransportAddress.META_ADDRESS,
101+
portGenerator.incrementAndGet()), attributes, Sets.newHashSet(DiscoveryNode.Role.MASTER,
96102
DiscoveryNode.Role.DATA), Version.CURRENT);
97103
}
98104
}

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

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import org.gradle.api.Task
2828
import org.gradle.api.XmlProvider
2929
import org.gradle.api.artifacts.Configuration
3030
import org.gradle.api.artifacts.ModuleDependency
31+
import org.gradle.api.artifacts.ModuleVersionIdentifier
3132
import org.gradle.api.artifacts.ProjectDependency
3233
import org.gradle.api.artifacts.ResolvedArtifact
3334
import org.gradle.api.artifacts.dsl.RepositoryHandler
@@ -294,12 +295,15 @@ class BuildPlugin implements Plugin<Project> {
294295
* Returns a closure which can be used with a MavenPom for fixing problems with gradle generated poms.
295296
*
296297
* <ul>
297-
* <li>Remove transitive dependencies (using wildcard exclusions, fixed in gradle 2.14)</li>
298-
* <li>Set compile time deps back to compile from runtime (known issue with maven-publish plugin)
298+
* <li>Remove transitive dependencies. We currently exclude all artifacts explicitly instead of using wildcards
299+
* as Ivy incorrectly translates POMs with * excludes to Ivy XML with * excludes which results in the main artifact
300+
* being excluded as well (see https://issues.apache.org/jira/browse/IVY-1531). Note that Gradle 2.14+ automatically
301+
* translates non-transitive dependencies to * excludes. We should revisit this when upgrading Gradle.</li>
302+
* <li>Set compile time deps back to compile from runtime (known issue with maven-publish plugin)</li>
299303
* </ul>
300304
*/
301305
private static Closure fixupDependencies(Project project) {
302-
// TODO: remove this when enforcing gradle 2.14+, it now properly handles exclusions
306+
// TODO: revisit this when upgrading to Gradle 2.14+, see Javadoc comment above
303307
return { XmlProvider xml ->
304308
// first find if we have dependencies at all, and grab the node
305309
NodeList depsNodes = xml.asNode().get('dependencies')
@@ -334,10 +338,19 @@ class BuildPlugin implements Plugin<Project> {
334338
continue
335339
}
336340

337-
// we now know we have something to exclude, so add a wildcard exclusion element
338-
Node exclusion = depNode.appendNode('exclusions').appendNode('exclusion')
339-
exclusion.appendNode('groupId', '*')
340-
exclusion.appendNode('artifactId', '*')
341+
// we now know we have something to exclude, so add exclusions for all artifacts except the main one
342+
Node exclusions = depNode.appendNode('exclusions')
343+
for (ResolvedArtifact artifact : artifacts) {
344+
ModuleVersionIdentifier moduleVersionIdentifier = artifact.moduleVersion.id;
345+
String depGroupId = moduleVersionIdentifier.group
346+
String depArtifactId = moduleVersionIdentifier.name
347+
// add exclusions for all artifacts except the main one
348+
if (depGroupId != groupId || depArtifactId != artifactId) {
349+
Node exclusion = exclusions.appendNode('exclusion')
350+
exclusion.appendNode('groupId', depGroupId)
351+
exclusion.appendNode('artifactId', depArtifactId)
352+
}
353+
}
341354
}
342355
}
343356
}
@@ -393,7 +406,7 @@ class BuildPlugin implements Plugin<Project> {
393406
}
394407

395408
options.encoding = 'UTF-8'
396-
//options.incremental = true
409+
options.incremental = true
397410

398411
if (project.javaVersion == JavaVersion.VERSION_1_9) {
399412
// hack until gradle supports java 9's new "--release" arg

buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/DocsTestPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class DocsTestPlugin extends RestTestPlugin {
3838
* the last released version for docs. */
3939
'\\{version\\}':
4040
VersionProperties.elasticsearch.replace('-SNAPSHOT', ''),
41-
'\\{lucene_version\\}' : VersionProperties.lucene,
41+
'\\{lucene_version\\}' : VersionProperties.lucene.replaceAll('-snapshot-\\w+$', ''),
4242
]
4343
Task listSnippets = project.tasks.create('listSnippets', SnippetsTask)
4444
listSnippets.group 'Docs'

0 commit comments

Comments
 (0)