Commit Graph

5517 Commits

Author SHA1 Message Date
Ryan Ernst 3f2946ce6d Fix line length in new indices module tests. 2016-06-27 11:33:22 -07:00
Ryan Ernst 33ccc5aead Merge branch 'master' into mapper_plugin_api 2016-06-27 11:19:59 -07:00
Ryan Ernst f17fcce3ed Add duplicate mapper detection and tests 2016-06-27 11:17:58 -07:00
Jim Ferenczi eb1e231a63 Revert "Rename `fields` to `stored_fields` and add `docvalue_fields`"
This reverts commit 2f46f53dc8.
2016-06-27 17:20:32 +02:00
Simon Willnauer 4fb1c4fe5a Validate settings against dynamic updaters on the master (#19088)
Today all settings are only validated against their validators
that are available when settings are registered. Yet, some settings updaters
have validators that are dynamic ie. their validation depends on other variables
that are only available at runtime. We do not run those validators when settings
are updated causing index updates to fail on the data nodes instead of on the master.

Relates to #19046
2016-06-27 17:18:26 +02:00
Colin Goodheart-Smithe 108ba23073 Pass resolved extended bounds to unmapped histogram aggregator
Previous to this change the unresolved extended bounds was passed into the histogram aggregator which meant extendedbounds.min and extendedbounds.max was passed through as null. This had two effects on the histogram aggregator:

1. If the histogram aggregator was unmapped across all shards, the reduce phase would not add buckets for the extended bounds and the response would contain zero buckets
2. If the histogram aggregator was not unmapped in some shards, the reduce phase might sometimes chose to reduce based on the unmapped shard response and therefore the extended bounds would be ignored.

This change resolves the extended bounds in the unmapped case and solves the above two issues.

Closes #19009
2016-06-27 14:07:37 +01:00
Boaz Leskes cb0824e957 Make shard store fetch less dependent on the current cluster state, both on master and non data nodes (#19044)
#18938 has changed the timing in which we send out to nodes to fetch their shard stores. Instead of doing this after the cluster state resulting of the node's join was published, #18938 made it be sent concurrently to the publishing processes. This revealed a couple of points where the shard store fetching is dependent of the current state of affairs of the cluster state, both on the master and the data nodes. The problem discovered were already present without #18938 but required a failure/extreme situations to make them happen.This PR tries to remove as much as possible of these dependencies making shard store fetching simpler and make the way to re-introduce #18938 which was reverted.

These are the notable changes:
1) Allow TransportNodesAction (of which shard store fetching is derived) callers to supply concrete disco nodes, so it won't need the cluster state to resolve them. This was a problem because the cluster state containing the needed nodes was not yet made available through ClusterService. Note that long term we can expect the rest layer to resolve node ids to concrete nodes, making this mode the only one needed.
2) The data node relied on the cluster state to have the relevant index meta data so it can find data when custom paths are used. We now fall back to read the meta data from disk if needed.
3) The data node was relying on it's own IndexService state to indicate whether the data it has corresponds to an existing allocation. This is of course something it can not know until it got (and processed) the new cluster state from the master. This flag in the response is now removed. This is not a problem because we used that flag to protect against double assigning of a shard to the same node, but we are already protected from it by the allocation deciders.
4) I removed the redundant filterNodeIds method in TransportNodesAction - if people want to filter they can override resolveRequest.
2016-06-27 15:05:06 +02:00
Martijn van Groningen d3cd58eb2f Merges PR #18957
This commit fixes several NPEs caused by implicitly performing a get request for a document that exists with its _source disabled and then trying to access the source. Instead of causing an NPE the following queries will throw an exception with a "source disabled" message (similar behavior as if the document does not exist).:
- GeoShape query for pre-indexed shape (throws IllegalArgumentException)
- Percolate query for an existing document (throws IllegalArgumentException)

A Terms query with a lookup will ignore the document if the source does not exist (same as if the document does not exist).

GET and HEAD requests for the document _source will return a 404 if the source is disabled (even if the document exists).
2016-06-27 09:37:28 +02:00
Martijn van Groningen ba90508b91 fix checkstyle issue 2016-06-27 09:00:13 +02:00
Nik Everett 71b95fb63c Switch analysis from push to pull
Instead of plugins calling `registerTokenizer` to extend the analyzer
they now instead have to implement `AnalysisPlugin` and override
`getTokenizer`. This lines up extending plugins in with extending
scripts. This allows `AnalysisModule` to construct the `AnalysisRegistry`
immediately as part of its constructor which makes testing anslysis
much simpler.

This also moves the default analysis configuration into `AnalysisModule`
which is how search is setup.

Like `ScriptModule`, `AnalysisModule` no longer extends `AbstractModule`.
Instead it is only responsible for building `AnslysisRegistry`. We still
bind `AnalysisRegistry` but we only do so in `Node`. This is means it
is available at module construction time so we slowly remove the need to
bind it in guice.
2016-06-26 07:15:42 -04:00
Jason Tedor c79e27180e Require timeout units when parsing query body
Today when parsing the timeout field in a query body, if time units are
supplied the parser throws a NumberFormatException. Addtionally, the
parsing allows the timeout field to not specify units (it assumes
milliseconds). This commit fixes this behavior by not only allowing time
units to be specified but requires time units to be specified. This is
consistent with the documented behavior and the behavior in 2.x.

Relates #19077
2016-06-25 16:18:25 -04:00
Simon Willnauer 09c0285d9c [TEST] Add unittest for settings update validation 2016-06-25 21:23:41 +02:00
Alex Benusovich 3ca909dfea Fix NPEs due to disabled source
This commit fixes several NPEs caused by implicitly performing a get request for a document that exists with its _source disabled and then trying to access the source. Instead of causing an NPE the following queries will throw an exception with a "source disabled" message (similar behavior as if the document does not exist).:
- GeoShape query for pre-indexed shape (throws IllegalArgumentException)
- Percolate query for an existing document (throws IllegalArgumentException)

A Terms query with a lookup will ignore the document if the source does not exist (same as if the document does not exist).

GET and HEAD requests for the document _source will return a 404 if the source is disabled (even if the document exists).
2016-06-24 22:03:03 -07:00
Ryan Ernst 6995bde710 Merge branch 'master' into mapper_plugin_api 2016-06-24 11:15:06 -07:00
Martijn van Groningen 599a548998 percolator: Don't verify candidate matches with MemoryIndex that are verified matches
If we don't care about scoring then for certain candidate matches we can be certain, that if they are a candidate match,
then they will always match. So verifying these queries with the MemoryIndex can be skipped.
2016-06-24 15:46:55 +02:00
Christoph Büscher 6d5b4a78fe Make parsing of bool queries stricter
Currently we don't throw an error when there is more than one query clause
specified in a must/must_not/should/filter object of the bool query without
using array notation, e.g.:
 { "bool" : { "must" : { "match" : { ... }, "match": { ... }}}}

In these cases, only the first query will be parsed and further behaviour is
unspecified, possibly leading to silently ignoring the rest of the query.
Instead we should throw a ParsingException if we don't encounter an END_OBJECT
token after having parsed the query clause.
2016-06-24 11:49:28 +02:00
Simon Willnauer 148e64d654 [TEST] Port testcase from #19035 to master 2016-06-23 22:53:54 +02:00
Lee Hinman 9a3227108b [TEST] Add ensureGreen for IpRangeIT
Resolves #18584
2016-06-23 09:58:10 -06:00
Yannick Welsch ca6fa9ef19 Fix block checks when no indices are specified (#19047)
Global cluster blocks were not checked if an empty set of indices were passed as argument to the block checking method. This would lead to issues where some operations are already executed on a cluster before it has recovered its cluster state.
2016-06-23 17:52:09 +02:00
Jason Tedor 7f10174362 Upgrade JNA to 4.2.2 and remove optionality
This commit upgrades JNA from version 4.1.0 to 4.2.2. Additionally, this
dependency is now non-optional as JNA is dual-licensed with Apache
License 2.0 since JNA 4.0.0.

Relates #19045
2016-06-23 09:21:40 -04:00
Adrien Grand 7ba5bceebe Add a MultiTermAwareComponent marker interface to analysis factories. #19028
This is the same as what Lucene does for its analysis factories, and we hawe
tests that make sure that the elasticsearch factories are in sync with
Lucene's. This is a first step to move forward on #9978 and #18064.
2016-06-23 10:19:24 +02:00
Adrien Grand 6c8744ecb5 Attempt at fixing IndexStatsIT.testFilterCacheStats.
I suspect recent failures are due to the fact that the cache disables itself
when there is contention. This runs assertions in an assertBusy block since
they should eventually succeed.
2016-06-23 10:16:04 +02:00
Tanguy Leroux 04da1bda0d Move templates out of the Search API, into lang-mustache module
This commit moves template support out of the Search API to its own dedicated Search Template API in the lang-mustache module. It provides a new SearchTemplateAction that can be used to render templates before it gets delegated to the usual Search API. The current REST endpoint are identical, but the Render Search Template endpoint now uses the same Search Template API with a new "simulate" option. When this option is enabled, the Search Template API only renders template and returns immediatly, without executing the search.

Closes #17906
2016-06-23 09:30:53 +02:00
Boaz Leskes 4be94cdc95 revert - Inline reroute with process of node join/master election (#18938)
There are secondary issues with async shard fetch going out to nodes before they have a cluster state published to them that need to be solved first. For example:
- async fetch uses transport node action that resolves nodes based on the cluster state (but it's not yet exposed by ClusterService since we inline the reroute)
- after disruption nodes will respond with an allocated shard (they didn't clean up their shards yet) which throws of decisions master side.
- nodes deed the index meta data in question but they may not have if they didn't recieve the latest CS
2016-06-23 08:41:44 +02:00
Mike McCandless d3d524568e merge master 2016-06-22 16:23:56 -04:00
Nik Everett 6dd9cd72b9 Build valid slices in SearchSourceBuilderTests
The test had a 1 in 500 chance of building and invalid slice.
2016-06-22 14:56:42 -04:00
Nik Everett 6671c0cf09 Tasks: Add completed to the mapping 2016-06-22 12:34:59 -04:00
Nik Everett 6574243077 Fail to start if plugin tries broken onModule
If a plugin declares `onModule(SomethingThatIsntAModule)` then refuse
to start. Before this commit we just logged a warning that flies by in
the console and is easy to miss. You can't miss refusing to start!
2016-06-22 12:20:52 -04:00
Jason Tedor 6d04c1e78e Remove duplicated read byte array methods
This commit removes duplicated methods for reading byte arrays in
StreamInput. One method would read a byte array by repeatedly calling
StreamInput#readByte in a loop, and the other would just call
StreamInput#readBytes. In this commit, we remove the former.

Relates #19023
2016-06-22 11:56:04 -04:00
Jim Ferenczi 2f46f53dc8 Rename `fields` to `stored_fields` and add `docvalue_fields`
`stored_fields` parameter will no longer try to retrieve fields from the _source but will only return stored fields.
`fields` will throw an exception if the user uses it.
Add `docvalue_fields` as an adjunct to `fielddata_fields` which is deprecated. `docvalue_fields` will try to load the value from the docvalue and fallback to fielddata cache if docvalues are not enabled on that field.

Closes #18943
2016-06-22 17:38:30 +02:00
Mike McCandless cbc7ff3f9c NodeService.indicesService is never null 2016-06-22 10:04:33 -04:00
Mike McCandless 52fcdf5e8d merge master 2016-06-22 09:54:40 -04:00
Mike McCandless 1bd0482393 don't include indexing buffer in cluster stats; randomize indexing buffer in NodeInfoStreamingTests; add @Nullable annotation 2016-06-22 09:52:54 -04:00
Nik Everett b0da4719aa Add missing field to PersistedTaskInfo 2016-06-22 07:37:58 -04:00
Jason Tedor 9d6d8152ee Merge pull request #19016 from jasontedor/hot-methods-redux
Hot methods redux
2016-06-22 06:41:38 -04:00
javanna 490d9c8cf7 Merge branch 'master' into feature/http_client 2016-06-22 09:50:07 +02:00
Adrien Grand db9af54ec0 Remove `_timestamp` and `_ttl` on 5.x indices. #18980
This removes the ability to use `_timestamp` and `_ttl` on indices created on
or after 5.0.

Closes #18280
2016-06-22 08:35:54 +02:00
Ryan Ernst e817b5daa3 Plugins: Remove guice from Mapper plugins
This changes adds a MapperPlugin interface which allows pull style
retrieval of mappers and metadata mappers added by plugins. For now, I
have kept the MapperRegistry, but this should be removed in the future
as it is just a silly container for 2 maps which could themselves be
passed around.
2016-06-21 22:50:39 -07:00
Jason Tedor 4f49a261a7 Refactor InternalEngine inner methods
This commit refactors InternalEngine#innerIndex and
InternalEngine#innerDelete to collapse some common logic into a single
method. This has the advantage that it shrinks the bytecode size of
InternalEngine#innerIndex so that it can be inlined.
2016-06-21 21:28:00 -04:00
Jason Tedor abae58b5fb Inline TransportSearchAction#doExecute 2016-06-21 20:48:16 -04:00
Jason Tedor 81ba43888f Inline AbstractSearchAsyncAction#init 2016-06-21 20:48:15 -04:00
Jason Tedor 93c3a89994 Inline StreamOutput#writeGenericValue 2016-06-21 20:48:15 -04:00
Jason Tedor af7f98205a Inline StreamInput#readGenericValue 2016-06-21 20:48:15 -04:00
Jason Tedor 9d1ef62431 Inline ReplicationOperation#execute 2016-06-21 20:48:15 -04:00
Jason Tedor dcd394d83f Inline TaskManager#register 2016-06-21 20:48:09 -04:00
Nik Everett 8925400f67 Remove guice from ScriptService
Makes ScriptModule just a plain class that manages building the
ScriptSettings and ScriptService from plugins. When we *need*
to bind ScriptService with guice we bind it in a lambda.
2016-06-21 16:45:45 -04:00
Tal Levy 28fd684eef Fix ignore_failure behavior in _simulate?verbose (#18987)
- fix it so that processors with the `ignore_failure` option do not
record their exception in the response
- add more tests to make empty `on_failure`. This now throws an
  exception
2016-06-21 13:29:53 -07:00
Simon Willnauer c80e837606 Beef up Translog testing with random channel exceptions (#18997)
Today we only throw random exceptions on the translog writer. This commit
extends it to also throw exceptions during checkpoint writing etc to test
if the correct flags are provided to open method etc.
2016-06-21 21:25:01 +02:00
Martijn van Groningen c7710daed0 Merge pull request #19011 from martijnvg/inner_hits/index_type_id_serialization1
Also do not serialize `_index` key in search response for parent/child inner hits
2016-06-21 21:24:39 +02:00
Boaz Leskes e9230dd889 RejectedExecutionException != EdRejectedExecutionException 2016-06-21 21:08:43 +02:00