Commit Graph

26823 Commits

Author SHA1 Message Date
David Pilato 8d31a2fa06 Merge branch 'doc/hlclient-delete' 2017-03-01 13:39:32 +01:00
David Pilato dc80a1fa75 Bad rendering of docs 2017-03-01 13:33:12 +01:00
David Pilato 2629c9896c Missing dot and parenthesis 2017-03-01 13:21:37 +01:00
Yannick Welsch c7edaba4e8 [TEST] Fix race condition when blocking cluster state processing during primary relocation
Two tests were periodically failing. What both tests are doing is starting a relocation of a shard from one node to another. Once the
recovery process is started, the test blocks cluster state processing on the relocation target using the BlockClusterStateProcessing disruption. The test then indefinitely
waits for the relocation to complete. The stack dump shows that the relocation is stuck in the PeerRecoveryTargetService.waitForClusterState method, waiting for the relocation target node to have at least the same cluster state
version as the relocation source.

The reason why it gets stuck is the following race:
1) The test code executes a reroute command that relocates a shard from one node to another
2) Relocation target node starts applying the clusterstate with relocation info, starting the recovery process.
4) Recovery is super fast and quickly goes to the waitForClusterState method, which wants to ensure that the cluster state that is
applied on the relocation target is at least as new as the one on the relocation source. The relocation source has already applied the
cluster state but the relocation target is still in the process of applying it. The waitForClusterState method thus uses a
ClusterObserver to wait for the next cluster state. Internally this means submitting a task with priority HIGH to the cluster service.
5) Cluster state application is about to finish on the relocation target. As one of the last steps, it acks to the master which makes the
reroute command return successfully.
6) The test code then blocks cluster state processing on the relocation target by submitting a cluster state update task (with priority
IMMEDIATE) that blocks execution.

If the task that is submitted in step 6 is handled before the one in step 4 by ClusterService's thread executor, cluster state
processing becomes blocked and prevents the cluster state observer from observing the applied cluster state.
2017-03-01 11:55:48 +01:00
David Pilato ee4a17a0e2 Adapt per Nik's comments 2017-03-01 11:51:06 +01:00
David Pilato 798bf966a3 Don't mention cluster compatibility 2017-03-01 11:28:13 +01:00
David Pilato 6c526adaed Merge branch 'master' into doc/hlclient-delete 2017-03-01 11:26:36 +01:00
Martijn van Groningen 524d7f592d
[TEST] Added unit tests for GeoHashGridAggregator and InternalGeoHashGrid
Part of #22278
2017-03-01 10:33:57 +01:00
Adrien Grand b388389ada Remove support for the include/pattern syntax. (#23141)
Relates #22933
2017-03-01 10:00:38 +01:00
Lee Hinman fd991f32f9 Refactor TransportShardBulkAction and add unit tests
This refactors the `TransportShardBulkAction` to split it appart and make it
unit-testable, and then it also adds unit tests that use these methods.

In particular, this makes `executeBulkItemRequest` shorter and more readable
2017-02-28 19:53:18 -07:00
Jason Tedor 7ce06aeb8c Fix date format in warning headers
This commit fixes the date format in warning headers. There is some
confusion around whether or not RFC 1123 requires two-digit
days. However, the warning header specification very clearly relies on a
format that requires two-digit days. This commit removes the usage of
RFC 1123 date/time format from Java 8, which allows for one-digit days,
in favor of a format that forces two-digit days (it's otherwise
identical to RFC 1123 format, it is just fixed width).

Relates #23418
2017-02-28 20:28:07 -05:00
Jason Tedor ee2f6ccf32 Add convenience method for asserting deprecations
This commit adds a convenience method for simultaneously asserting
settings deprecations and other warnings and fixes some tests where
setting deprecations and general warnings were present.
2017-02-28 18:24:39 -05:00
Ryan Ernst 019263d664 Revert "Internal: Change version constant names for already released versions (#23416)"
This reverts commit dc0e93ed62.
2017-02-28 14:45:13 -08:00
Ryan Ernst dc0e93ed62 Internal: Change version constant names for already released versions (#23416)
We have many version constants in master that have already been
released, but are still marked (by naming convention) as unreleased.
This commit renames those version constants.
2017-02-28 13:05:44 -08:00
Ryan Ernst 1c44f4d62b Add 5.2.2 to vagrant pool of bwc versions to test 2017-02-28 11:31:35 -08:00
Christoph Büscher 98b7023318 Fix checkstyle LineLength issues in UpdateShardAllocationSettingsIT 2017-02-28 20:14:28 +01:00
David Pilato 0ae6bc36fa Create version constants for next bug fix version v5.2.3 2017-02-28 19:11:48 +01:00
Ali Beyad b58eb5f051 [TEST] removes unused SameShardRouting test 2017-02-28 12:58:27 -05:00
Ali Beyad 5e2e45cad9 Makes the same_shard host dyanamically updatable (#23397)
Previously, cluster.routing.allocation.same_shard.host was not a dynamic
setting and could not be updated after startup.  This commit changes the
behavior to allow the setting to be dynamically updatable.  The
documentation already states that the setting is dynamic so no
documentation changes are required.

Closes #22992
2017-02-28 12:48:54 -05:00
Christoph Büscher 5be7f6a76f Tests: fixing line length limit in ScriptedMetricAggregatorTests 2017-02-28 16:56:43 +01:00
Christoph Büscher a522deb6b5 Tests: Add unit test for InternalScriptedMetricAggregator (#23404)
Relates to #22278
2017-02-28 16:43:12 +01:00
Jürgen van Dijk 7609d67c7d Typo (#23344) 2017-02-28 16:33:09 +01:00
Colin Goodheart-Smithe 406d2f7a64
Fixes the per term error in the terms aggregation
When multiple reduce phases were needed the per term error got lost in subsequent reduces in some situations:

When a previous reduce phase had calculated a non-zero error for a particular bucket we were not accounting for this error in subsequent reduce phases and instead were relying on the overall error for the agg which meant we were implicitly assuming that all shards that made up that aggregation had returned the term. This is plainly not true so we need to make sure the per term error for the aggregation is used when calcualting the error for that term in the new reduced aggregation.
2017-02-28 13:56:35 +00:00
Jim Ferenczi 17a0b4e69c Fix merge scheduler test that depends on the number of processors 2017-02-28 11:43:35 +01:00
Jim Ferenczi 0c03d0056c #23391: simplify setting fallback (missing in the squash commit) 2017-02-28 11:34:02 +01:00
Tanguy Leroux 33eb6a13bf Tests: Fix RemoteScrollableHitSourceTests
With  #23307, the expected exception is wrapped two times into a RuntimeException instead of being thrown directly.
2017-02-28 11:30:33 +01:00
Jim Ferenczi d27a55866c Fix merge scheduler config settings (#23391)
Change Setting#get(Settings, Settings) to fallback only if the setting is present in the secondary.
This is needed to fix setting that relies on other settings.
Replace IT with uts.
2017-02-28 10:21:27 +01:00
Christoph Büscher 084cb38207 Tests: Add unit test for InternalScriptedMetric (#23330)
Relates to #22278
2017-02-28 09:40:11 +01:00
Tanguy Leroux 02c919f0b0 [Tests] Fix RestClientTests 2017-02-28 09:38:59 +01:00
Tanguy Leroux 9da8531f60 RestClient asynchronous execution should not throw exceptions (#23307)
The current implementation of RestClient.performAsync() methods can throw exceptions before the request is asynchronously executed. Since it only throws unchecked exceptions, it's easy for the user/dev to forget to catch them. Instead I think async methods should never throw exceptions and should always call the listener onFailure() method.
2017-02-28 09:33:51 +01:00
Ryan Ernst e866da580c Only set vagrant user for gradle installation
The vagrant group is not available on all systems the packaging and
platform tests run on.
2017-02-27 16:13:00 -08:00
Jason Tedor c61cc5f617 Fix deprecation escaping tests
This commit fixes an off-by-one error in the deprecation escaping tests.
2017-02-27 17:19:13 -05:00
Jason Tedor fe47af4e4b Fix deprecation HTTP tests
This commit adapts the deprecation HTTP tests for the RFC 7234
specification compliant warning headers.
2017-02-27 17:14:57 -05:00
Martijn van Groningen 73fb945980
Changed TaskOperationFailure#getCause() return type from Trowable to Exception. 2017-02-27 21:31:19 +01:00
Randall Britten 05fd2eca6f Docs: corrected "and" --> "an" (#23376) 2017-02-27 14:38:29 -05:00
Randall Britten 98e19cced4 Docs: Corrected definition of type param of children agg (#23377) 2017-02-27 14:38:28 -05:00
Jim Ferenczi 5c84640126 Upgrade to lucene-6.5.0-snapshot-d00c5ca (#23385)
Lucene upgrade
2017-02-27 18:39:04 +01:00
Ryan Ernst 48280a9403 Tests: Add platformTest to vagrant (#23339)
This change adds a new test task, platformTest, which runs `gradle test
integTest` within a vagrant host. This will allow us to still test on
all the supported platforms, but be able to standardize on the tools
provided in the host system, for example, with a modern version of git
that can allow #22946.

In order to have sufficient memory and cpu to run the tests, the
vagrantfile has been updated to use 8GB and 4 cpus by default. This can
be customized with the `VAGRANT_MEMORY` and `VAGRANT_CPUS` environment
variables.  Also, to save time to show this can work, it currently uses
the same Vagrantfile the packaging tests do. There are a lot of cleanups
we can do to how the gradle-vagrant tasks work, including generating
Vagrantfile altogether, but I think this is fine for now as the same
machines that would run platformTest run packagingTest, and they are
relatively beefy machines, so the higher memory and cpu for them, with
either task, should not be an issue.
2017-02-27 09:21:28 -08:00
Jason Tedor 577e6a5e14 Correct warning header to be compliant
The warning header used by Elasticsearch for delivering deprecation
warnings has a specific format (RFC 7234, section 5.5). The format
specifies that the warning header should be of the form

    warn-code warn-agent warn-text [warn-date]

Here, the warn-code is a three-digit code which communicates various
meanings. The warn-agent is a string used to identify the source of the
warning (either a host:port combination, or some other identifier). The
warn-text is quoted string which conveys the semantic meaning of the
warning. The warn-date is an optional quoted date that can be in a few
different formats.

This commit corrects the warning header within Elasticsearch to follow
this specification. We use the warn-code 299 which means a
"miscellaneous persistent warning." For the warn-agent, we use the
version of Elasticsearch that produced the warning. The warn-text is
unchanged from what we deliver today, but is wrapped in quotes as
specified (this is important as a problem that exists today is that
multiple warnings can not be split by comma to obtain the individual
warnings as the warnings might themselves contain commas). For the
warn-date, we use the RFC 1123 format.

Relates #23275
2017-02-27 12:14:21 -05:00
Luca Cavanna 2fb0466f66 Convert suggestion response parsing to use NamedXContentRegistry (#23355)
We recently added parsing code to parse suggesters responses into java api objects. This was done using a switch based on the type of the returned suggestion. We can now replace the switch with using NamedXContentRegistry, which will also be used for aggs parsing.
2017-02-27 15:42:25 +01:00
Colin Goodheart-Smithe 1ceaef0de6
Fixes terms error count for multiple reduce phases
Previously when multiple reduces occured for the terms aggregation we would add up the errors for the aggregations but would not take into account the errors that had already been calculated for the previous reduce phases.

This change corrects that by adding the previously created errors to the new error value.

Closes #23286
2017-02-27 13:44:18 +00:00
javanna 756e26cb33 [TEST] make headers case-insensitive when running yaml tests 2017-02-27 12:27:03 +01:00
javanna 4f487ab1b9 [TEST] randomize request content_type between all of the supported formats 2017-02-27 12:27:03 +01:00
javanna 9a2dba3036 [TEST] add support for binary responses to REST tests infra 2017-02-27 12:27:03 +01:00
javanna 2f6a6090b8 [TEST] don't check exact size in mapper-size yaml test
Rather test that the size is present and greather than zero. The actual size depends on the content-type, which is randomized.
2017-02-27 12:27:03 +01:00
javanna dad025a6ad [TEST] move test for binary field to specific test file that sets Content-Type header explicitly 2017-02-27 12:27:03 +01:00
javanna 261f31f5b7 [TEST] move filters aggs wrapper query builder rewriting test to integ tests
This test makes little sense when sent from the REST layer, as WrapperQueryBuilder is supposed to be used from the Java api. Also, providing the inner query as base64 string will work only for string formats and break for binary formats like SMILE and CBOR, whcih doesn't play well with randomizing content type in our REST tests
2017-02-27 12:27:03 +01:00
javanna ca858befab [TEST] create HttpEntity earlier in REST tests
This allows to set content-type together with the body itself. At the moment it is always json, but this change allows makes it easier to randomize it later
2017-02-27 12:27:03 +01:00
javanna 04aaedc083 [TEST] Remove content type auto-detection while parsing request body in REST tests 2017-02-27 12:27:03 +01:00
Simon Willnauer b8e2d12b23 Factor out filling of TopDocs in SearchPhaseController (#23380)
Previously this code was duplicated across the 3 different topdocs variants
we have. It also had no real unittest (where we tested with holes in the results)
which caused a sneaky bug where the comparison used `result.size()` vs `results.size()`
causing several NPEs downstream. This change adds a static method to fill the top docs
that is shared across all variants and adds a unittest that would have caught the issue
very quickly.

Closes #19356
Closes #23357
2017-02-27 11:44:41 +01:00