Commit Graph

28106 Commits

Author SHA1 Message Date
Ali Beyad cc1f40ca18 Fix cluster health wait conditions in rolling restart tests
In the rolling upgrade tests, there is a test to create an index with
replica shards and ensure that in the mixed cluster environment, the
cluster health is green before any other tests are executed.  However,
there were two problems with this.  First, if the replica shard was
residing on the restarted node, then delayed allocation will kick in and
cause the cluster health request to timeout after 1m.  The fix to this
was to drastically lower the delayed allocation setting.  Second, if the
primary exists on the higher version node, then the replica cannot be
assigned to the lower version node because recovery cannot happen from
lower lucene versions.  The fix here was to wait for the cluster health
to be yellow instead of green in the mixed cluster environment.  In the
fully upgraded cluster, the cluster health check waits for a green
cluster as before.

Closes #25185
2017-07-06 14:35:07 -04:00
Simon Willnauer e9f6210dac Add cluster name validation to RemoteClusterConnection (#25568)
This change adds validation to the RemoteClusterConnection to ensure
we always use seed nodes from the same cluster. While we still allow to use
an arbitrary cluster alias we ensure that we, once we connected to a cluster the first time,
we always check against that initial cluster name when we execute a seed node handshake.
2017-07-06 19:18:10 +02:00
Ali Beyad dda68643b6 Removes deprecated usage of the FieldStats API in a test that verifies
sequence number data in Lucene commit points.  Instead, the test
retrieves the _seq_no value from the commit point directly and converts
it to a Long value.
2017-07-06 12:00:00 -04:00
Christoph Büscher 41d0ff32c8 [Tests] Check output of SuggestionBuilder#build method (#25549)
This change adds a basic unit test for the SuggestionSearchContext that is
created as output of SuggestionBuilder#build. The current test only adds checks
for the common fields (like text, prefix, fieldName etc...).

Relates to #17118
2017-07-06 17:32:34 +02:00
Tanguy Leroux d9bc0f48b4 [Docs] Document Bulk Processor for Java High Level REST Client (#25572) 2017-07-06 17:05:10 +02:00
Luca Cavanna bd6d7f1495 Update REST client deps license and notice files (#25573)
We previously grouped all the license and notice files for httpcore, httpcore-nio, httpclient and httpasyncclient under the same license and notice file. There were though subtle differences between those which we didn't keep track of. For instance the httpcore license file has slightly changed since 4.4 which we have missed to track.

This commit goes back to having one license and notice file for each jar, to be completely sure that each dependency is associated with exactly the right licene and notice file.

 Closes #25567
2017-07-06 16:52:17 +02:00
Martijn van Groningen d0f9f425bd
parent/child: Removed ParentJoinFieldSubFetchPhase 2017-07-06 13:15:02 +02:00
Jim Ferenczi 31614c3ddb Remove deprecated fielddata_fields from search request (#25566)
... and inner_hits
2017-07-06 13:02:28 +02:00
Clinton Gormley ca12b1f2a6 Tidied up the disk allocator docs 2017-07-06 12:16:53 +02:00
Martijn van Groningen 407273f81d
parent/child: Support parent id being specified as number in the _source 2017-07-06 11:48:57 +02:00
Luca Cavanna 26bc900058 [DOCS] Rewrite low-level REST client docs and verify snippets compile (#25559)
Using the infra that we now have in place, we can convert the low-level REST client docs so that they extract code snippets from real Java classes. This way we make sure that all the snippets properly compile. Compared to the high level REST client docs, in this case we don't run the tests themselves, as that would require depending on test-framework which requires java 8 while the low-level REST client is compatible with java 7. I think that compiling snippets is enough for now.
2017-07-06 10:05:50 +02:00
Simon Willnauer 38a1df7da1 Use a port range per JVM in MockTransportService (#25565)
Some tests use MockTransportService to do network based testing.
Yet, we run tests in multiple JVMs that means
concurrent tests could claim port that another JVM just released
and if that test tries to simulate a disconnect it might be smart
enough to re-connect depending on what is tested. To reduce the risk,
since this is very hard to debug we use a different default
port range per JVM unless the incoming settings overriding it.

Closes #25301
2017-07-06 09:14:52 +02:00
Lee Hinman 30b5ca7ab7 Refactor PathTrie and RestController to use a single trie for all methods (#25459)
* Refactor PathTrie and RestController to use a single trie for all methods

This changes `PathTrie` and `RestController` to use a single `PathTrie` for all
endpoints, it also allows retrieving the endpoints' supported HTTP methods more
easily.

This is a spin-off and prerequisite of #24437

* Use EnumSet instead of multiple if conditions

* Make MethodHandlers package-private and final

* Remove duplicate registerHandler method

* Remove public modifier
2017-07-05 17:28:10 -06:00
Simon Willnauer 6e5cc424a8 Switch indices read-only if a node runs out of disk space (#25541)
Today when we run out of disk all kinds of crazy things can happen
and nodes are becoming hard to maintain once out of disk is hit.
While we try to move shards away if we hit watermarks this might not
be possible in many situations. Based on the discussion in #24299
this change monitors disk utilization and adds a flood-stage watermark
that causes all indices that are allocated on a node hitting the flood-stage
mark to be switched read-only (with the option to be deleted). This allows users to react on the low disk
situation while subsequent write requests will be rejected. Users can switch
individual indices read-write once the situation is sorted out. There is no
automatic read-write switch once the node has enough space. This requires
user interaction.

The flood-stage watermark is set to `95%` utilization by default.

Closes #24299
2017-07-05 22:18:23 +02:00
Adrien Grand 26de905f1e Fix the documentation to state that the `_id` field is indexed. (#25540) 2017-07-05 16:09:31 +02:00
Jason Tedor 7dcd81b41b Throw back replica local checkpoint on new primary
This commit causes a replica to throwback its local checkpoint to the
global checkpoint when learning of a new primary through a replica
operation.

Relates #25452
2017-07-05 09:17:16 -04:00
Simon Willnauer 7c637a0bfe Ensure `index.mapping.single_type` can only be set on 5.x indices (#25375)
In 6.x we prevent multiple types and default to `index.mapping.single_type: false`
This change removes the registered setting and ensures that it's preserved for
5.x indices.

Relates to #24961
2017-07-05 15:16:40 +02:00
Clinton Gormley 0170e0e8d3 Remove usage of multi-types from the docs and added a page explaining type removal (#25543)
Closes #25401
2017-07-05 12:30:19 +02:00
Tanguy Leroux fefcae3d45 [Docs] Document Update API for Java High Level REST Client (#25536)
This commit adds documentation for Java High Level REST Client's Update API.
2017-07-05 12:16:42 +02:00
javanna 7899dbef3b [DOCS] High Level Client: fix index items order
Also group APIs under single document, multi-document and search
2017-07-05 12:07:09 +02:00
Luca Cavanna 6f8c0453bc [DOCS] add docs for high level client get method (#25538)
Document high level client get method
2017-07-05 11:57:57 +02:00
Russ Cam 83522ab4e5 Important note for MSI upgrade from command line (#25544)
Add an Important admonition for upgrading via the command line
using the Windows MSI Installer. This calls out the need to pass
the same command line options for an upgrade as were used for
the initial installation.
2017-07-05 11:38:21 +02:00
Luca Cavanna d91d96e06e [DOCS] update index, type and id for indexed documents in high level client docs (#25546)
Especially the type change is convenient as it becomes `doc`
2017-07-05 11:32:59 +02:00
Simon Willnauer ca351b60b7 [TEST] Enable transport tracer for RemoteClusterServiceTests#testCollectNodes #25301 2017-07-05 11:23:14 +02:00
Simon Willnauer 8e861b3896 [TEST] Add another valid exception that can occure with concurrent disconnects 2017-07-05 11:23:14 +02:00
Wesley Merkel 7994703903 [Docs] Fix some errors in the index aliases docs (#25449) 2017-07-05 11:16:17 +02:00
Christoph Büscher 3185eaece8 QueryBuilders should implement ToXContentObject (#25530)
All query builders written as self contained xContent objects, to we should mark
them accordingly using ToXContentObject. This also makes it possible to use
things like XContentHelper#toXContent to render query builders in tests.
2017-07-05 09:50:10 +02:00
Tanguy Leroux 3da3632021 [Docs] Document Bulk API for Java High Level REST Client (#25532)
This commit adds documentation for Java High Level REST Client's Bulk API.
2017-07-05 09:26:26 +02:00
Martijn van Groningen 141aa226f4
test: avoid NPE 2017-07-04 20:33:02 +02:00
Adrien Grand e7e5216382 Make totalHits a long in CollapseTopFieldDocs.
Relates to #25349.
2017-07-04 18:35:51 +02:00
Tanguy Leroux c52c3cea68 [Doc] Remove mention of generated fields in get/mget docs (#25492)
This option has been removed in #20102.
2017-07-04 18:06:00 +02:00
Colin Goodheart-Smithe 41abccf6c5 Adds rewrite phase to aggregations (#25495)
* Adds rewrite phase to aggregations

This change adds aggregations to the rewrite performed by the `SearchSourceBuilder`. This means that `AggregationBuilder`s are able to implement a `rewrite()` method where they can return a new `AggregationBuilder` which is functionally the same but in a more primitive form. This is exactly analogous to the rewrite done by the `QueryBuilder`s.

The first aggregation to implement the rewrite are the filter and filters aggregations so they can rewrite the filters they contain.

Closes #17676

* Removes rewrite from PipelineAggregationBuilder

Rewrite is based on shard level information. Since pipeline aggregation are run in the reduce phase it doesn’t make sense to rewrite them on the shards. In fact eventually we shouldn’t be transporting them to the shards at all and should be retaining them on the coordinating node for execution in the reduce phase

* Addresses review comments

* addresses more review comments

* Fixed imports
2017-07-04 16:47:48 +01:00
Simon Willnauer 1c4ef0d214 Upgrade randomizedrunner to 2.5.2 (#25533)
An issue causing confusing error messages during test execution
has been fixed randomizedtesting/randomizedtesting#250
2017-07-04 16:48:11 +02:00
Jun Ohtani 6894ef6057 [Analysis] Support normalizer in request param (#24767)
* [Analysis] Support normalizer in request param

Support normalizer param
Support custom normalizer with char_filter/filter param

Closes #23347
2017-07-04 19:16:56 +09:00
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