Commit Graph

28099 Commits

Author SHA1 Message Date
Glen Smith 1dd28808d5 Fix typo in name of test
This commit fixes a typo in the name of a REST test.

Relates #25451
2017-06-30 12:51:37 -04:00
Jason Tedor dd93ef3f24 Add additional test for sequence-number recovery
This commit adds a test for a scenario where a replica receives an extra
document that the promoted replica does not receive, misses the
primary/replica re-sync, and the recovers from the newly-promoted
primary.

Relates #25493
2017-06-30 10:59:03 -04:00
Martijn van Groningen c8da7f84a2
WrapperQueryBuilder should also rewrite the parsed query.
Failing to do so can cause other errors later on during query execution.
For example if  `WrapperQueryBuilder` wraps a `GeoShapeQueryBuilder` that fetches the shape from an index then it will skip the shape fetching
and fail later with the error that no shapes have been fetched.
2017-06-30 13:48:18 +02:00
Yannick Welsch 1fee1045b9 Remove dead code and stale Javadoc 2017-06-30 12:25:56 +02:00
Russ Cam 099ccd36ee Update defaults in documentation (#25483)
Following internal discussion

Relates: https://github.com/elastic/windows-installers/pull/49
2017-06-30 16:24:53 +10:00
Lisa Cawley 7e1a5c68db [DOCS] Add docs-dir to Painless (#25482) 2017-06-29 16:31:54 -07:00
Jason Tedor 2a90e50d0f Add concurrent deprecation logger test
Since deprecation logging involves concurrency, this commit adds a test
that the concurrency here is handled safely.

Relates #25481
2017-06-29 18:44:06 -04:00
Lisa Cawley 57c752000c [DOCS] Update shared attributes for Elasticsearch (#25479)
* [DOCS] Update shared attributes for Elasticsearch

* [DOCS] Moved shared attributes to Versions.asciidoc

* [DOCS] More more book URLs to shared attributes
2017-06-29 13:48:58 -07:00
Jason Tedor d219a85b33 Use LRU set to reduce repeat deprecation messages
This commit adds an LRU set to used to determine if a keyed deprecation
message should be written to the deprecation logs, or only added to the
response headers on the thread context.

Relates #25474
2017-06-29 16:36:43 -04:00
Tim Brooks cac2eec7d2 Add NioTransport threads to thread name checks (#25477)
We have various assertions that check we never block on transport
threads. This commit adds the thread names for the NioTransport to
these assertions.

With this change I had to fix two places where we were calling blocking
methods from the transport threads.
2017-06-29 15:16:07 -05:00
Christoph Büscher c32c21e875 Add shortcut for AbstractQueryBuilder.parseInnerQueryBuilder to QueryShardContext 2017-06-29 21:45:02 +02:00
Tim Brooks dd5d165da1 Prevent channel enqueue after selector close (#25478)
This commit adds additional protection to `ESSelector` and its
implementations to ensure that channels are not enqueued after the
selector is closed.

After a channel has been added to the queue, we check that the selector
is open. If it is not, then we remove the channel from the queue. If the
channel is removed successfully, we throw an `IllegalStateException`.
2017-06-29 14:02:50 -05:00
Christoph Büscher 99aa04b79c Fix Java 9 compilation issue
My IDE ate a cast that seems required to make Java 9 happy.
2017-06-29 20:57:22 +02:00
Simon Willnauer 6f131a63d3 Remove unregistered `transport.netty.*` settings (#25476)
These settings have not be working for a full major version since they
are not registered. Given that they are simply duplicates we can just remove
them.
2017-06-29 20:56:18 +02:00
Tim Brooks 6c58f0c4e6 Handle ping correctly in NioTransport (#25462)
Our current TCPTransport logic assumes that we do not pass pings to
the TCPTransport level.

This commit fixes an issue where NioTransport was passing pings to
TCPTransport and leading to exceptions.
2017-06-29 11:03:51 -05:00
Christoph Büscher acade2b40a Tests: Remove platform specific assertion in NioSocketChannelTests
This check depends on the language settings on the system the
test runs on, e.g. it fails on Ubuntu with LANG=de_DE.UTF-8.
2017-06-29 17:32:51 +02:00
Christoph Büscher 927111c91d Remove QueryParseContext from parsing QueryBuilders (#25448)
Currently QueryParseContext is only a thin wrapper around an XContentParser that
adds little functionality of its own. I provides helpers for long deprecated
field names which can be removed and two helper methods that can be made static
and moved to other classes. This is a first step in helping to remove
QueryParseContext entirely.
2017-06-29 17:10:20 +02:00
Lee Hinman 22ff76da0c Promote replica on the highest version node (#25277)
* Promote replica on the highest version node

This changes the replica selection to prefer to return replicas on the highest
version when choosing a replacement to promote when the primary shard fails.

Consider this situation:

- A replica on a 5.6 node
- Another replica on a 6.0 node
- The primary on a 6.0 node

The primary shard is sending sequence numbers to the replica on the 6.0 node and
skipping sending them for the 5.6 node. Now assume that the primary shard fails
and (prior to this change) the replica on 5.6 node gets promoted to primary, it
now has no knowledge of sequence numbers and the replica on the 6.0 node will be
expecting sequence numbers but will never receive them.

Relates to #10708

* Switch from map of node to version to retrieving the version from the node

* Remove uneeded null check

* You can pretend you're a functional language Java, but you're not fooling me.

* Randomize node versions

* Add test with random cluster state with multiple versions that fails shards

* Re-add comment and remove extra import

* Remove unneeded stuff, randomly start replicas a few more times

* Move test into FailedNodeRoutingTests

* Make assertions actually test replica version promotion

* Rewrite test, taking Yannick's feedback into account
2017-06-29 08:56:34 -06:00
Martijn van Groningen 7f2bcf1f97
test: added not null assertion
Relates to #25311
2017-06-29 13:54:52 +02:00
Martijn van Groningen a2b4080fba
use diamond operator 2017-06-29 13:43:39 +02:00
Christoph Büscher aa2038f9d7 Use DocumentField#toXContent and parsing in SearchHit (#25469)
As a small follow-up to #25361, we can use DocumentFields toXContent/fromXContent
in SearchHit now.
2017-06-29 13:32:13 +02:00
olcbean 3518e313b8 Unify the result interfaces from get and search in Java client (#25361)
As GetField and SearchHitField have the same members, they have been unified into
DocumentField.

Closes #16440
2017-06-29 11:35:28 +02:00
Jason Tedor da59c178e2 Emit settings deprecation logging at most once
When a setting is deprecated, if that setting is used repeatedly we
currently emit a deprecation warning every time the setting is used. In
cases like hitting settings endpoints over and over against a node with
a lot of deprecated settings, this can lead to excessive deprecation
warnings which can crush a node. This commit ensures that a given
setting only sees deprecation logging at most once.

Relates #25457
2017-06-28 22:18:46 -04:00
DeDe Morton 9714c77c84 [Docs] Add link to grok debugger docs (#25461) 2017-06-28 16:28:15 -07:00
DeDe Morton 6442d1f75e [Docs] Add link to grok debugger docs (#25412) 2017-06-28 16:14:16 -07:00
Ali Beyad b18bfd6062 Output all empty snapshot info fields if in verbose mode (#25455)
In #24477, a less verbose option was added to retrieve snapshot info via
GET /_snapshot/{repo}/{snapshots}.  The point of adding this less
verbose option was so that if the repository is a cloud based one, and
there are many snapshots for which the snapshot info needed to be
retrieved, then each snapshot would require reading a separate snapshot
metadata file to pull out the necessary information.  This can be costly
(performance and cost) on cloud based repositories, so a less verbose
option was added that only retrieves very basic information about each
snapshot that is all available in the index-N blob - requiring only one
read!

In order to display this less verbose snapshot info appropriately, logic
was added to not display those fields which could not be populated.
However, this broke integrators (e.g. ECE) that required these fields to
be present, even if empty.  This commit is to return these fields in the
response, even if empty, if the verbose option is set.
2017-06-28 17:37:56 -05:00
Jay Modi 64d11b8831 Fix race condition in RemoteClusterConnection node supplier (#25432)
This commit fixes a race condition in the node supplier used by the RemoteClusterConnection. The
node supplier stores an iterator over a set backed by a ConcurrentHashMap, but the get operation
of the supplier uses multiple methods of the iterator and is suceptible to a race between the
calls to hasNext() and next(). The test in this commit fails under the old implementation with a
NoSuchElementException. This commit adds a wrapper object over a set and a iterator, with all methods
being synchronized to avoid races. Modifications to the set result in the iterator being set to null
and the next retrieval creates a new iterator.
2017-06-28 15:50:24 -06:00
Tim Brooks cad57959e1 Remove finicky exception message assertion
In SimpleNioTransportTests we assert that an IOException has a certain
message. This message appears that it is not dependible (and might
change based on platform).

Our other transport tests (mock and netty) do not make this assertion.
Instead they only assert on our application exception message. This
commit removes the IOException message assertion. And retains the
ConnectTransportException message assertion.
2017-06-28 14:16:04 -05:00
Jay Modi b2901f536e Do not search locally if remote index pattern resolves to no indices (#25436)
This commit changes how we determine if there were any remote indices that a search should have
been executed against. Previously, we used the list of remote shard iterators but if the remote
index pattern resolved to no indices there would be no remote shard iterators even though the
request specified remote indices. The map of remote cluster names to the original indices is used
instead so that we can determine if there were remote indices even when there are no remote shard
iterators.

Closes #25426
2017-06-28 12:41:37 -06:00
Andreas Gebhardt a156ccd80e Expand `/_cat/nodes` to return information about hard drive (#21775)
Expand `/_cat/nodes` with already present information about available disk space `diskAvail` (alias: `d`, `disk`) by:

    * `diskTotal` (alias `dt`): total disk space
    * `diskUsed` (alias `du`): used disk space (`diskTotal - diskAvail`)
    * `diskUsedPercent` (alias `dup`): used disk space percentage

Note: The available disk space is the number of bytes available to the node's Java virtual machine. The size might be smaller than the real one. That means the used disk space (percentage) is larger.

Closes #21679
2017-06-28 18:20:20 +02:00
Tim Brooks 5f8be0e090 Introduce NioTransport into framework for testing (#24262)
This commit introduces a nio based tcp transport into framework for
testing.

Currently Elasticsearch uses a simple blocking tcp transport for
testing purposes (MockTcpTransport). This diverges from production
where our current transport (netty) is non-blocking.

The point of this commit is to introduce a testing variant that more
closely matches the behavior of production instances.
2017-06-28 10:51:20 -05:00
Martijn van Groningen 9ce9c21b83
docs: added percolator script query limitation 2017-06-28 17:10:30 +02:00
Chris Earle f2eeceb10d _nodes/stats should not fail due to concurrent AlreadyClosedException (#25016)
This catches `AlreadyClosedException` during `stats` calls to avoid failing a `_nodes/stats` request because of the ignorable, concurrent index closure.
2017-06-28 10:08:45 -04:00
Yannick Welsch 5a4a47332c Use a single method to update shard state
This commit refactors index shard to provide a single method for
updating the shard state on an incoming cluster state update.

Relates #25431
2017-06-28 09:48:47 -04:00
Jason Tedor ebdae09df3 Do not swallow exception when relocating
When relocating a shard before changing the state to relocated, we
verify that a relocation is a still taking place. Yet, this can throw an
exception if the relocation is in fact no longer valid. Sadly, we were
swallowing the exception in this situation. This commit allows such an
exception to bubble up after safely releasing resources.
2017-06-28 08:42:13 -04:00
Robin Clarke 1900d9c447 Docs: Fix typo for request cache (#25444) 2017-06-28 14:31:03 +02:00
Jason Tedor be906628d5 Remove implicit 32-bit support
We previously tried to maintain (while not formally supporting) 32-bit
support, although we never tested this anywhere in CI. Since we do not
formally support this, and 32-bit usage is very low, we have elected to
no longer maintain 32-bit support. This commit removes any implication
of 32-bit support.

Relates #25435
2017-06-28 08:24:33 -04:00
Marcus Wittig 960d63a3b3
[DOCS] reworded to prevent code span rendering glitch (#25442)
Changed `rescore`s to `rescore` requests as an backtick followed by the s character appears to be interpreted as an apostrophe  which then leads to an unbalanced backtick for the next code span in the remainder of the paragraph

Closes #25443
2017-06-28 11:48:31 +01:00
Yannick Welsch 5d1e67c882 Disallow multiple concurrent recovery attempts for same target shard (#25428)
The primary shard uses the GlobalCheckPointTracker to track local checkpoint information of recovering and started replicas in order to calculate the global checkpoint. As the tracker is updated through recoveries as well, it is easier to reason about the tracker if we can ensure that there are no concurrent recovery attempts for the same target shard (which can happen in case of network disconnects).
2017-06-28 10:41:16 +02:00
Yannick Welsch 8ae61c0fc4 Update global checkpoint when increasing primary term on replica (#25422)
When a replica shard increases its primary term under the mandate of a new primary, it should also update its global checkpoint; this gives us the guarantee that its global checkpoint is at least as high as the new primary and gives a starting point for the primary/replica resync.

Relates to #25355, #10708
2017-06-28 10:38:22 +02:00
Daniel Mitterdorfer dd6751d3e9 Add backwards compatibility indices for 5.4.3 2017-06-28 10:00:01 +02:00
Daniel Mitterdorfer 75ceb7d63b Add version 5.4.3 after release 2017-06-28 09:59:54 +02:00
Russ Cam 2804fc4c29 Update MSI installer images (#25414)
Slight updating to styling
2017-06-28 09:04:23 +10:00
Jason Tedor 8afeeed051 Add missing newline at end of SetsTests.java
This commit adds a missing newline to the end of SetsTests.java after
the closing curly brace.
2017-06-27 17:28:41 -04:00
Jason Tedor f6a693e1bc Rename handoff primary context transport handler
This commit renames this handler from "hand_off" to "handoff" since
"handoff" is an actual word in the English language.
2017-06-27 15:08:58 -04:00
Tal Levy cbcf6a4f55 correct expected thrown exception in mappingMetaData to ElasticsearchParseException (#25410) 2017-06-27 08:55:24 -07:00
Martijn van Groningen c85ac402b0
test: Make many percolator integration tests real integration tests 2017-06-27 17:44:30 +02:00
Lisa Cawley 03f952a838 [DOCS] Update docs to use shared attribute file (#25403)
* [DOCS] Update docs to use shared attribute file

* [DOCS] Add shared attributes to Versions.asciidoc
2017-06-27 08:33:28 -07:00
Jason Tedor 9b3768204b Add Javadocs and tests for set difference methods
This commit adds Javadocs and tests for some set difference utility
methods in core.
2017-06-27 11:29:35 -04:00
Christoph Büscher c55dc23270 Tests: Add parsing test for AggregationsTests (#25396)
We already have these tests in InternalAggregationTestCase to check random insertions into the response xContent so that we don't fail on future changes in the response format. This change adds the same to AggregationsTests and runs on a whole aggregations tree. Unfortunately we need to exclude many places in the xContent from random insertion, but I added a long comment trying to explaine those.
2017-06-27 17:02:15 +02:00