Commit Graph

3619 Commits

Author SHA1 Message Date
Tal Levy b653e80314 fix ingest client put error test 2016-02-02 15:24:58 -08:00
Jason Tedor 8b37827ac6 Guard against null routing node iterator 2016-02-02 18:14:37 -05:00
Jason Tedor a3a49a12ef Illegal shard failure requests
Today, shard failure requests are blindly handled on the master without
any validation that the request is a legal request. A legal request is a
shard failure request for which the shard requesting the failure is
either the local allocation or the primary allocation. This is because
shard failure requests are classified into only two sets: requests that
correspond to shards that exist, and requests that correspond to shards
that do not exist. Requests that correspond to shards that do not exist
are immediately marked as successful (there is nothing to do), and
requests that correspond to shards that do exist are sent to the
allocation service for handling the failure.

This pull request adds a third classification for shard failure requests
to separate out illegal shard failure requests and enables the master to
validate shard failure requests. The master communicates the illegality
of a shard failure request via a new exception:
NoLongerPrimaryShardException. This exception can be used by shard
failure listeners to discover when they've sent a shard failure request
that they were not allowed to send (e.g., if they are no longer the
primary allocation for the shard).

Closes #16275
2016-02-02 17:41:09 -05:00
Tal Levy 9e7e2ab10b remove DeDotProcessor from Ingest 2016-02-02 14:16:01 -08:00
Tal Levy 3191fc7347 Merge pull request #16355 from talevy/fix_ingest_exception
revert PipelineFactoryError handling with throwing ElasticsearchParseException in ingest pipeline creation
2016-02-02 14:11:24 -08:00
Tal Levy 0a1580eefa revert PipelineFactoryError handling with throwing ElasticsearchParseException in ingest pipeline creation 2016-02-02 14:08:22 -08:00
Ryan Ernst 9f47b376da Plugin cli: Improve maven coordinates detection
Identifying when a plugin id is maven coordinates is currently done by
checking if the plugin id contains 2 colons. However, a valid url could
have 2 colons, for example when a port is specified. This change adds
another check, ensuring the plugin id with maven coordinates does not
contain a slash, which only a url would have.

closes #16376
2016-02-02 12:17:56 -08:00
Tanguy Leroux 865bbc2096 Remove string formatting from Terminal print methods
This can be trappy and wrong formating strings can throws format exceptions and hide the real message.
2016-02-02 19:57:16 +01:00
Jason Tedor e6a5e79ede Test awaits Lucene snapshot upgrade
This commit marks OldIndexBackwardsCompatibilityIT#testOldIndexes as
awaiting a Lucene snapshot upgrade to reflect the fact that
Elasticsearch 2.2.0 is built against Lucene 5.4.1 but the current Lucene
snapshot in master/2.x does not contain the Lucene version 5.4.1 field.

Relates #16373
2016-02-02 10:01:37 -05:00
Jason Tedor 1e6b2d4f1d Fix JVM GC monitor missing settings test
This commit fixes a test bug in
JvmGcMonitorServiceSettingsTests#testMissingSetting. The purpose of the
test is to test that if settings are provided for a collector for at
least one of warn, info, and debug then it is provided for all of warn,
info, and debug. However, for a collector setting to be valid it must be
a positive time value but the randomization in the test construction
could produce zero time values.

Closes #16369
2016-02-02 08:49:47 -05:00
Clinton Gormley 58b6db8d82 Added versions 2.1.3-SNAPSHOT and 2.2.1-SNAPSHOT, and bwc indices for 2.1.2 and 2.2.0 2016-02-02 14:39:21 +01:00
Yannick Welsch 13ad335416 Fix compilation in TransportReplicationActionTests 2016-02-02 14:08:19 +01:00
Yannick Welsch 8cca0395ef Revert "Make GeoDistanceSortBuilder serializable"
This reverts commit c108a4ce6d.
2016-02-02 14:04:45 +01:00
Yannick Welsch 089ab7d9bf Revert "Remove deprecation for geohash setter"
This reverts commit b5a4e99344.
2016-02-02 14:03:58 +01:00
Yannick Welsch c5a6ddfdc2 Merge pull request #16274 from ywelsch/fix/endless-index-loop
Prevent TransportReplicationAction to route request based on stale local routing table
2016-02-02 13:59:54 +01:00
Yannick Welsch cd53772178 Use allocation ids to prevent repeated recovery of failed shards
Closes #16346
2016-02-02 13:54:27 +01:00
Yannick Welsch af1f637547 Prevent TransportReplicationAction to route request based on stale local routing table
Closes #16274
Closes #12573
Closes #12574
2016-02-02 13:52:45 +01:00
Isabel Drost-Fromm b5a4e99344 Remove deprecation for geohash setter
This removes the deprecation for the geohash based setter to quickly fix the failure here: http://build-us-00.elastic.co/job/es_core_master_suse/3312 

Reintroducing postponed until related test in groovy module is fixed. Need to figure out what went wrong when I ran the build locally w/o failure before.
2016-02-02 13:09:34 +01:00
Yannick Welsch 51862ce5ae Fix IndexShardTests.testStressRelocated
Closes #16364
2016-02-02 12:57:19 +01:00
Boaz Leskes 58825773eb Remove `discovery.zen.rejoin_on_master_gone`
That setting was built as an escape hatch for the work done in 1.4. I never heard it being used once. We can safely remove it.

Closes #16353
2016-02-02 12:15:56 +01:00
Isabel Drost-Fromm df45c75594 Merge pull request #16151 from MaineC/enhancement/15178-sort-geosortbuilder
Refactor GeoSortBuilder
2016-02-02 12:14:35 +01:00
Alexander Reelsen 2366b3593f BWC: Added 1.7 version constants and bwc indices 2016-02-02 12:08:11 +01:00
Isabel Drost-Fromm c108a4ce6d Make GeoDistanceSortBuilder serializable
Adds to GeoDistanceSortBuilder:

* equals
* hashcode
* writeto/readfrom
* moves xcontent parsing logic over
* adds roundtrip tests
* fixes roundtrip test for xcontent by keeping points just as geopoints not geohashes internally
* fixes xcontent parsing of ignore_malformed if coerce is set/unset
* adds exception to sortMode setter to avoid setting invalid sort modes

Relates to #15178
2016-02-02 11:24:32 +01:00
Tanguy Leroux a7fb5a27cc Mute IndexShardTests.testStressRelocated 2016-02-02 11:12:58 +01:00
Yannick Welsch 10b5ffcda5 Add proper handoff between old and new copy of relocating primary shard
When primary relocation completes, a cluster state is propagated that deactivates the old primary and marks the new primary as active.
As cluster state changes are not applied synchronously on all nodes, there can be a time interval where the relocation target has processed
the cluster state and believes to be the active primary and the relocation source has not yet processed the cluster state update and
still believes itself to be the active primary. This commit ensures that, before completing the relocation, the reloction source deactivates
writing to its store and delegates requests to the relocation target.

Closes #15900
2016-02-02 09:46:55 +01:00
Yannick Welsch e1006ea400 Add operation counter for IndexShard
Adds a container that represents a resource with reference counting capabilities. Provides operations to suspend acquisition of new references. Useful for resource management when resources are intermittently unavailable.

Closes #15956
2016-02-02 09:46:55 +01:00
Nik Everett d91a898f6a Merge pull request #16330 from nik9000/line_length_1
Start to break lines at 140 characters
2016-02-01 21:41:47 -05:00
Nik Everett 07cba65c1b Start to break lines at 140 characters
Its what we say our maximum line length is in CONTRIBUTING.md and it'd be
nice to have a check on that. Unfortunately, we don't actually wrap all lines
at 140.
2016-02-01 21:09:35 -05:00
Ryan Ernst a2c37c0989 CliTool: Allow unexpected exceptions to propagate
Cli tools currently catch all exceptions, and only print the exception
message, except when a special system property is set. Even with this
flag set, certain exceptions, like IOException, are captured and their
stack trace is always lost.

This change adds a UserError class, which can be used a cli tools to
specify a message to the user, as well as an exit status. All other
exceptions are propagated out of main, so java will exit with non-zero
and print the stack trace.
2016-02-01 16:35:22 -08:00
Tal Levy dcb88909d5 Merge pull request #16324 from talevy/ingest_on_failure_tag
Add processor tags to on_failure metadata in ingest pipeline
2016-02-01 10:13:26 -08:00
Jason Tedor 24a841a075 ShardId equality and hash code inconsistency
This commit fixes an inconsistency between ShardId#equals(Object),
ShardId#hashCode, and ShardId#compareTo(ShardId). In particular,
ShardId#equals(Object) compared only the numerical shard ID and the
index name, but did not compare the index UUID; a similar situation
applies to ShardId#compareTo(ShardId). However, ShardId#hashCode
incorporated the indexUUID into its calculation. This can lead to
situations where two ShardIds compare as equal yet have different hash
codes.

Closes #16319
2016-02-01 11:56:50 -05:00
Ryan Ernst 01b80b100e Merge pull request #16333 from rjernst/single_node_static
Make single node utility methods non-static
2016-02-01 08:46:54 -08:00
Ryan Ernst 3787f437ec Merge branch 'master' into remove_multicast 2016-02-01 07:25:45 -08:00
Ryan Ernst 661e3c99f7 Merge pull request #16336 from rjernst/demangle
Reduce complexity of plugin cli
2016-02-01 07:20:04 -08:00
Jason Tedor ed7bc5ba16 Unused variables in TransportReplicationAction 2016-02-01 08:12:34 -05:00
Colin Goodheart-Smithe 745e8f96e7 Moved http settings to the new settings infrastructure
The following settings were moved to Setting contents in HttpTransportSettings:

* http.cors.allow-origin
* http.port
* http.publish_port
* http.detailed_errors.enabled
* http.max_content_length
* http.max_chunk_size
* http.max_header_size
* http.max_initial_line_length

The following settings were removed:

* http.port
* http.netty.port
* http.netty.publish_port
* http.netty.max_content_length
* http.netty.max_chunk_size
* http.netty.max_header_size
* http.netty.max_initial_line_length
2016-02-01 12:56:41 +00:00
Simon Willnauer 008aa2c316 Merge pull request #16341 from s1monw/cache_settings
Convert PageCacheRecycler settings
2016-02-01 13:51:19 +01:00
Christoph Büscher 61c435e6a9 PhraseSuggestionBuilde: Refactor DirectCandidateGenerator
As a prerequisite for refactoring the whole PhraseSuggestionBuilder
to be able to be parsed and streamed from the coordinating node, the
DirectCandidateGenerator must implement Writeable, be able to parse
a new instance (fromXContent()) and later when transported to the
shard to generate a PhraseSuggestionContext.DirectCandidateGenerator.
Also adding equals/hashCode and tests and moving DirectCandidateGenerator
to its own DirectCandidateGeneratorBuilder class.
2016-02-01 12:22:48 +01:00
Simon Willnauer aa5f9d5158 Convert PageCacheRecycler settings 2016-02-01 11:34:19 +01:00
Boaz Leskes 856883fcc5 Local Discovery - don't create a local DiscoNode, but use the one from cluster service
Long ago (#7834) the owner ship of the local disco node was centralized to the cluster service. LocalDiscovery is still created it's own disco node, which is not used by the cluster service and thus creating confusion (two nodes same name but different ids).

This commit also removes and optimization where when joining a new master we would first copy the master's metadata and only then pull in the rest of the cluster state (and it's nodes).

Closes #16317
2016-02-01 11:05:40 +01:00
Boaz Leskes df80e8f215 Migrate the rest of NettyTransport settings to the new infra
Also does some consistency clean up, renaming trasnport.netty.* settings to transport.*

Closes #16307
2016-02-01 10:26:52 +01:00
Simon Willnauer af0e40ec7d Merge pull request #16316 from s1monw/isseus/13685_2nd_try
Ensure all resoruces are closed on Node#close()
2016-02-01 10:17:57 +01:00
Ryan Ernst a052dfeb38 Plugins: Reduce complexity of plugin cli
The plugin cli currently is extremely lenient, allowing most errors to
simply be logged. This can lead to either corrupt installations (eg
partially installed plugins), or confused users.

This change rewrites the plugin cli to have almost no leniency.
Unfortunately it was not possible to remove all leniency, due in
particular to how config files are handled.

The following functionality was simplified:
* The format of the name argument to install a plugin is now an official
  plugin name, maven coordinates, or a URL.
* Checksum files are required, and only checked, for official plugins
  and maven plugins. Checksums are also only SHA1.
* Downloading no longer uses a separate thread, and no longer has a timeout.
* Installation, and removal, attempts to be atomic. This only truly works
  when no config or bin files exist.
* config and bin directories are verified before copying is attempted.
* Permissions and user/group are no longer set on config and bin files.
  We rely on the users umask.
* config and bin directories must only contain files, no subdirectories.
* The code is reorganized so each command is a separate class. These
  classes already existed, but were embedded in the plugin cli class, as
  an extra layer between the cli code and the code running for each command.
2016-01-31 20:30:45 -08:00
Ryan Ernst a398ba839c Tests: Make single node utility methods non-static
With the recent change to allow ESSingleNodeTestCase to specify plugins
and Version for the node, node creation became lazy, where it now
happens before the first test to run. However, there were many static
methods on ESSingleNodeTestCase that still try to access the node. This
change makes those methods non-static.
2016-01-31 09:58:41 -08:00
Jason Tedor 105411060c Uppercase ells ('L') in long literals
This commit removes and forbids the use of lowercase ells ('l') in long
literals because they are often hard to distinguish from the digit
representing one ('1').

Closes #16329
2016-01-30 22:16:02 -05:00
Lee Hinman 4e8623f8f4 Merge remote-tracking branch 'dakrone/add-ex-name-to-msg' 2016-01-30 16:28:03 -07:00
Lee Hinman 7e05b34708 Add Exception class name to message in `NotSerializableExceptionWrapper`
Previously it's possible to get errors like:

```
Caused by: NotSerializableExceptionWrapper[d:\shared_data\afs-issue-1-1\23]
```

Which doesn't tell us what the underlying exception type was that could
not be serialized.

This changes the message to prepend the
`ElasticsearchException.getExceptionName()` of the exception (which is a
underscore case of the class with the leading 'Elasticsearch' removed)
2016-01-30 16:27:24 -07:00
Jason Tedor 2a78e02fe9 Log shard ID in TransportReplicationAction
This commit amends a logging statement in TransportReplicationAction to
log the full shard ID instead of just the numerical shard ID (without
the index name).
2016-01-30 09:27:38 -05:00
Ryan Ernst b8f08c35ec Plugin: Remove multicast plugin
closes #16310.
2016-01-29 18:41:31 -08:00
Tal Levy 61e4283a16 Add processor tags to on_failure metadata in ingest pipeline
closes #16202
2016-01-29 14:36:11 -08:00