Commit Graph

28122 Commits

Author SHA1 Message Date
Christoph Büscher 5200665295 Remove deprecated IdsQueryBuilder constructor (#25529)
The constructor using `types` has been deprecated for a while now (starting with
ES 5.1.). It can be removed in the next mayor version. Since types are optional
they should be added with the #types() setter.
2017-07-04 11:59:48 +02:00
Colin Goodheart-Smithe 43efcffcc2 Adds check for negative search request size (#25397)
* Adds check for negative search request size

This change adds a check to `SearchSourceBuilder` to throw and exception if the size set on it is set to a negative value.

Closes #22530

* fix error in reindex

* update re-index tests

* Addresses review comment

* Fixed tests

* Added random negative size test

* Fixes test
2017-07-04 10:51:38 +01:00
Martijn van Groningen 1c63c823b0
test: also inspect the upgrade api response to check whether the upgrade really ran
Relates to #25311
2017-07-04 11:43:50 +02:00
Luca Cavanna 3c5eb6cd1b [DOCS] restructure java clients docs pages (#25517)
This commit converts the low level client and high level client chapters into two parts, which allows each high level client supported api to be on a separate page and show up in the index on the right.
2017-07-04 10:58:57 +02:00
Clinton Gormley 8296618640 Include shared/attributes.asciidoc from docs master 2017-07-03 18:17:34 +02:00
Clinton Gormley 091b1b0765 Fixed page breaks for ICU Collation Keyword Fields 2017-07-03 17:49:28 +02:00
Christoph Büscher f576c987ce Remove QueryParseContext (#25486)
QueryParseContext is currently only used as a wrapper for an XContentParser, so
this change removes it entirely and changes the appropriate APIs that use it so
far to only accept a parser instead.
2017-07-03 17:30:40 +02:00
Tanguy Leroux 0e2cfc66bb [Test] Use a common testing class for all XContent filtering tests (#25491)
We have two ways to filter XContent:

- The first method is to parse the XContent as a map and use
XContentMapValues.filter(). This method filters the content of the map
using an automaton. It is used for source filtering, both at search and
indexing time. It performs well but can generate a lot of objects and
garbage collections when large XContent are filtered. It also returns
empty objects (see f2710c16eb) when all
the sub fields have been filtered out and handle dots in field names as
if they were sub fields.

- The second method is to parse the XContent and copy the XContentParser
 structure to a XContentBuilder initialized with includes/excludes
 filters. This method uses the Jackson streaming filter feature. It is
 used by the Response Filtering ('filter_path') feature. It does not
 generate a lot of objects, and does not return empty objects and also
 does not handle dots in field names explicitely.

 Both methods have similar goals but different tests. This commit changes
 the current XContentBuilder test class so that it becomes a more generic
 testing class and we can now ensure that filtering methods generate the
 same results.

 It also removes some tests from the XContentMapValuesTests class that
 should be in XContentParserTests.
2017-07-03 14:45:26 +02:00
markharwood a9ea742a85 Tests fix - Significant terms/text aggs (#25499)
The significance aggs return Lucene index-level statistics that when merged are assumed to be from different shards. The Aggregator unit tests assume segments can be treated as shards and thus break the significance stats and introduce double-counting of background doc frequencies. This change addresses this problem by ensuring test indexes have only one shard.
Closes #25429
2017-07-03 09:52:23 +01:00
Luca Cavanna 99fef2490a [DOCS] add docs for REST high level client index method (#25501)
This commit restructures the existing high level client docs, adapts the existing delete method docs and adds docs for the index method.
2017-07-03 10:48:16 +02:00
Dimitrios Liappis 39d42292dd Tests: Add Debian 9 (Stretch) to the packaging tests
Debian 9 aka Stretch is the current stable[1].

Add Debian-9 to the packaging tests.

[1] https://wiki.debian.org/DebianStretch

Relates #25494
2017-07-03 11:02:17 +03:00
Martijn van Groningen 129f53d914
test: Run flush before upgrade and refresh after upgrade.
Relates to #25311
2017-07-03 09:49:06 +02:00
Jason Tedor 5f2a0118b8 Fix third party audit for repository-hdfs
This commit fixes the third party audit check for the repository-hdfs
plugin; a class was excluded on JDK 9 that does not need to be.
2017-07-02 16:14:05 -04:00
Simon Willnauer 1205610023 [TEST] Expect nodes getting disconnected quickly
If all nodes get disconnected before we can send the request we might
try to reconnect and that will fail with an ISE instead of the a transport
exception.

Closes #25301
2017-07-02 22:12:35 +02:00
Boaz Leskes a4fae1540e testPrimaryFailureIncreasesTerm should use assertBusy to wait for yellow
ensureYellow ensures at least yellow.

Also, since we only have 1 replica, we don't need to index for it to know about the primary term promotion

Closes #25287
2017-07-02 21:19:51 +02:00
Simon Willnauer 5a7c8bb04e Cleanup network / transport related settings (#25489)
This commit makes the use of the global network settings explicit instead
of implicit within NetworkService. It cleans up several places where we fall
back to the global settings while we should have used tcp or http ones.

In addition this change also removes unnecessary settings classes
2017-07-02 10:16:50 +02:00
Jason Tedor 2975e7f511 Fix repository-hdfs plugin packaging test
This commit fixes the repository-hdfs packaging test by fixing the
expected name of two dependencies.
2017-07-01 15:36:18 -04:00
Yannick Welsch bb23d3b2c5 Remove allocation id from replica replication response (#25488)
The replica replication response object has an extra allocationId field that contains the allocation id of the replica on which the request was executed. As we are sending the allocation id with the actual replica replication request, and check when executing the replica replication action that the allocation id of the replica shard is what we expect, there is no need to communicate back the allocation id as part of the response object.
2017-07-01 11:36:45 +02:00
Jason Tedor 6ae4497c13 Adjust BWC version on bad allocation request test
This commit adjusts the BWC version on the bad cluster allocation
explain request test as changing the API to respond with a bad request
status instead of an internal server error status was backported to 5.x
to be included in 5.6.0.

Relates #25503
2017-06-30 18:05:58 -04:00
James Baiera 74f4a14d82 Upgrading HDFS Repository Plugin to use HDFS 2.8.1 Client (#25497)
Hadoop 2.7.x libraries fail when running on JDK9 due to the version string changing to a single 
character. On Hadoop 2.8, this is no longer a problem, and it is unclear on whether the fix will be 
backported to the 2.7 branch. This commit upgrades our dependency of Hadoop for the HDFS 
Repository to 2.8.1.
2017-06-30 17:57:56 -04:00
Jason Tedor c70c440050 Adjust status on bad allocation explain requests
When a user requests a cluster allocation explain in a situation where
it does not make sense (for example, there are no unassigned shards), we
should consider this a bad request instead of a server error. Yet, today
by throwing an illegal state exception, these are treated as server
errors. This commit adjusts these so that they throw illegal argument
exceptions and are treated as bad requests.

Relates #25503
2017-06-30 17:50:20 -04:00
Drew Raines 6deb18c0de Preliminary support for ARM
This commit adds preliminary support for 64-bit ARM architectures.

Relates #25318
2017-06-30 14:22:20 -04:00
Jason Tedor 1b602477ae Add doc note regarding explicit publish host
This commit adds a note to the docs regarding explicilty setting a
publish host if the network.host setting results in multiple bind
addresses.

Relates #25496
2017-06-30 12:59:02 -04:00
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