Commit Graph

5190 Commits

Author SHA1 Message Date
Christoph Büscher 808ef6cec7 Fix parsing single `rescore` element in SearchSourceBuilder
We are currently only parsing the array-syntax for the rescore part
in SearchSourceBuilder ("rescore" : [ {...}, {...} ]) . We also need
to support "rescore" : {...}

Closes #18439
2016-05-18 15:08:28 +02:00
Clinton Gormley c03dd8a290 Make the index-too-old exception more explicit (#18438)
Closes #18418
2016-05-18 13:33:25 +02:00
Daniel Mitterdorfer de3e7d161f Add tests for null precondition check in BulkRequest
Relates #18347

Checked with @javanna
2016-05-18 12:10:13 +02:00
Yannick Welsch 6dacac49b3 Simplify recovery logic in IndicesClusterStateService (#18405)
- Moves recovery logic into IndexShard
- Simplifies logic to cancel peer recovery of shard where recovery source node changed
- Ensures routing entry is set on initialization of IndexShard
2016-05-18 10:51:57 +02:00
Daniel Mitterdorfer c13df3b6c5 Clear all caches after testing parent breaker
With this commit we clear all caches after testing the parent circuit breaker.
This is necessary as caches hold on to circuit breakers internally. Additionally,
due to usage of CircuitBreaker#addWithoutBreaking() in caches, it's even possible
to go above the limit. As a consequence, all subsequent requests fall victim to
the limit.

Hence, right after the parent circuit breaker tripped, we clear all caches to
reduce these circuit breakers to 0 again. We also exclude the clear caches
transport request from limit check in order to ensure it will succeed. As this is
typically a very small and low-volume request, it is deemed ok to exclude it.

Closes #18325
2016-05-18 09:31:35 +02:00
Jason Tedor ecce53f0df Add I/O statistics on Linux
This commit adds a variety of real disk metrics for the block devices
that back Elasticsearch data paths. A collection of statistics are read
from /proc/diskstats and are used to report the raw metrics for
operations and read/write bytes.

Relates #15915
2016-05-17 16:16:39 -04:00
Jason Tedor 584be0b3f8 Refactor JvmGcMonitorService for testing
This commit refactors the JvmGcMonitorService so that it can be
tested. In particular, hooks are added to verify that the
JvmMonitorService correctly observes slow GC events, and that the
JvmGcMonitorService logs the correct messages.

Relates #18378
2016-05-17 13:05:36 -04:00
Yannick Welsch 9ba554dfd2 Expose previous cluster state only in RoutingAllocation (#18390)
Instead of re-exposing index metadata and blocks in RoutingNodes (which is part of the cluster state before rerouting), expose it as part of the RoutingAllocation which is known to be only temporarily used during reroute.
2016-05-17 19:02:28 +02:00
polyfractal c755a77022 [TEST] Use a reproducible source of randomness in shuffle 2016-05-17 12:55:07 -04:00
Zachary Tong 7c46b57ff2 Add a Sort ingest processor
Sorts an array of values in ascending or descending order. If all elements are numerics, they will be sorted numerically. If values are strings, or mixtures of strings/numbers, the elements will be sorted lexicographically.
2016-05-17 12:06:48 -04:00
Colin Goodheart-Smithe 8c9ca8b518 Moves query profiler classes into their own package
The change also renames fields and methods in the Profilers class.

Note that I had to make ProfileResult a public class (it was package private before) because now classes that call it are in a different package.
2016-05-17 14:20:05 +01:00
Ali Beyad 3764789d96 Removed unused AllocationService member in
TransportClusterAllocationExplainAction

Closes #18381
2016-05-16 18:41:36 -04:00
Robert Muir 8d4c1befe5 Merge pull request #18364 from rmuir/nukeRunAsFloat
Remove LeafSearchScript.runAsFloat(): Nothing calls it.
2016-05-16 17:08:25 -04:00
Adrien Grand 864ed04059 Lessen leniency of the query dsl. #18276
This change does the following:
 - Queries that are currently unsupported such as prefix queries on numeric
   fields or term queries on geo fields now throw an error rather than returning
   a query that does not match anything.
 - Fuzzy queries on numeric, date and ip fields are now unsupported: they used
   to create range queries, we now expect users to use range queries directly.
   Fuzzy, regexp and prefix queries are now only supported on text/keyword
   fields (including `_all`).
 - The `_uid` and `_id` fields do not support prefix or range queries anymore as
   it would prevent us to store them more efficiently in the future, eg. by
   using a binary encoding.

Note that it is still possible to ignore these errors by using the `lenient`
option of the `match` or `query_string` queries.
2016-05-16 17:37:00 +02:00
Colin Goodheart-Smithe e37e8af5e2 Refactor of query profile classes to make way for other profile implementations 2016-05-16 16:15:50 +01:00
Colin Goodheart-Smithe 6eda9f5df6 more tests following review 2016-05-16 09:07:22 +01:00
Colin Goodheart-Smithe 0c449fee4a small fix following rebase on master 2016-05-16 09:07:22 +01:00
Colin Goodheart-Smithe 66d0bdab0c review comments 2016-05-16 09:07:22 +01:00
Colin Goodheart-Smithe ab3121c871 Adds a methods to find (and dynamically create) the mappers for the parents of a field with dots in the field name 2016-05-16 09:07:22 +01:00
Robert Muir 8edf213492 Remove LeafSearchScript.runAsFloat(): Nothing calls it. 2016-05-15 22:59:28 -04:00
Michael McCandless 0d570352dd Merge pull request #18355 from mikemccand/iterables_flatten
Iterables.flatten should not pre-cache the first iterator
2016-05-15 10:21:35 -04:00
Mike McCandless 8d7db7fd7a remove whitespace 2016-05-14 18:50:10 -04:00
Mike McCandless ded8b400b0 Fix concurrency bug in IMC that could lead to negative total indexing bytes 2016-05-14 18:47:26 -04:00
Mike McCandless 48dca45564 leave Iterables.flatten pre-caching the outer Iterable 2016-05-14 17:10:17 -04:00
Mike McCandless 53c2f8b4b6 improve javadocs 2016-05-14 13:46:34 -04:00
Mike McCandless cf2af8961b Iterables.flatten should not pre-cache the first iterator 2016-05-14 13:39:48 -04:00
Ali Beyad d3d57da89f Removes unused methods in the o/e/common/Strings class.
Closes #18346
2016-05-14 08:08:30 -04:00
Daniel Mitterdorfer 009cf434a2 Merge pull request #18347 from danielmitterdorfer/bulk-req-precondition-check
Add not-null precondition check in BulkRequest
2016-05-14 11:25:02 +02:00
Daniel Mitterdorfer a2381640da Add not-null precondition check in BulkRequest
With this commit we add a precondition check to BulkRequest so
we fail early if users pass `null` for the request object.

For a more detailed discussion, see #12038.
This supersedes #12038.

Relates #12038.
2016-05-14 09:59:53 +02:00
Robert Muir 2028691e66 painless: improve exception stacktraces
closes #18319
2016-05-13 15:40:45 -04:00
Lee Hinman 864ba8dac1 Merge remote-tracking branch 'dakrone/there-can-be-only-one2' 2016-05-13 10:28:41 -06:00
Adrien Grand b4dec0ddbe Remove dead code. 2016-05-13 18:27:12 +02:00
Jason Tedor 81898a2e3e Avoid race while retiring executors
Today, a race condition exists when retiring executors. Namely, if an
executor is retired and then the thread pool is terminated, the retiring
of the executor and the termination of the thread pool can race to
remove the retired executor from the queue of retired executors. More
precisely, when the executor is initially retired, it is placed on a
queue of retired executors, and then removed when it is successfully
shutdown. When the pool is terminated, it will also drain the queue of
retired executors. This leads to a time-of-check-time-of-use race where
the draining can see a retired executor on the queue but that retired
executor can be removed upon successful shutdown of that executor. This
leads to the draining attempting to remove an element from the queue
when there is none. This commit addresses this race condition by instead
safely polling the queue.

Relates #18333
2016-05-13 12:26:18 -04:00
Lee Hinman 9bcdafedda Allow only a single extension for a scripting engine
Previously multiple extensions could be provided, however, this can lead
to confusion with on-disk scripts (ie, "foo.js" and "foo.javascript")
having different content. Only a single extension is now supported.

The only language currently supporting multiple extensions was the
Javascript engine ("js" and "javascript"). It now only supports the
`.js` extension.

Relates to #10598
2016-05-13 09:54:31 -06:00
Lee Hinman d5b75491dc Merge remote-tracking branch 'dakrone/remove-script-sandbox' 2016-05-13 09:50:39 -06:00
Britta Weber e7c17fc9fb [TEST] increase logger level until we know what is going on
We have an issue for it too: https://github.com/elastic/elasticsearch/issues/18121
2016-05-13 17:37:17 +02:00
Christoph Büscher a40c397c67 Don't allow `fuzziness` for `multi_match` types cross_fields, phrase and phrase_prefix
Currently `fuzziness` is not supported for the `cross_fields` type
of the `multi_match` query since it complicates the logic that
blends the term queries that cross_fields uses internally. At the
moment using this combination is silently ignored, which can lead to
confusions. Instead we should throw an exception in this case.
The same is true for phrase and phrase_prefix type.

Closes #7764
2016-05-13 17:32:14 +02:00
Jason Tedor 786a6a00d9 Add test for fixed executor rejected count
This commit adds a test that a fixed executors rejected count behaves as
expected. In particular, we test that if we consume the executor, then
stuff the executor queue, further tasks will be rejected and the
rejected stats are updated appropriately. This test also asserts that if
we resize the queue the rejected count is reset to zero.

Relates #18301
2016-05-13 11:27:12 -04:00
Lee Hinman efff3918d8 Remove support for mulitple languages per scripting engine 2016-05-13 09:24:31 -06:00
Lee Hinman a4060f7436 Remove vestiges of script engine sandboxing
This removes all the mentions of the sandbox from the script engine
services and permissions model. This means that the following settings
are no longer supported:

```yaml
script.inline: sandbox
script.stored: sandbox
```

Instead, only a `true` or `false` value can be specified.

Since this would otherwise break the default-allow parameter for
languages like expressions, painless, and mustache, all script engines
have been updated to have individual settings, for instance:

```yaml
script.engine.groovy.inline: true
```

Would enable all inline scripts for groovy. (they can still be
overridden on a per-operation basis).

Expressions, Painless, and Mustache all default to `true` for inline,
file, and stored scripts to preserve the old scripting behavior.

Resolves #17114
2016-05-13 09:24:31 -06:00
Adrien Grand 638da06c1d Add back support for `ip` range aggregations. #17859
This commit adds support for range aggregations on `ip` fields. However it will
only work on 5.x indices.

Closes #17700
2016-05-13 17:22:01 +02:00
Clinton Gormley f2797dbccb Fixed grammar in index-too-old exception (#18327) 2016-05-13 15:08:15 +02:00
Adrien Grand 61b1f4ad0b Fix xcontent rendering of ip terms aggs. #18003
Currently terms on an ip address try to put their binary representation in the
json response. With this commit, they would return a formatted ip address:

```
      "buckets": [
        {
          "key": "192.168.1.7",
          "doc_count": 1
        }
      ]
```
2016-05-13 14:59:36 +02:00
Daniel Mitterdorfer ddbfda2c68 Exclude specific transport actions from request size limit check
We add support to explicitly exclude specific transport actions
from the request size limit check.

We also exclude the following request types currently:

*MasterPingRequest
* PingRequest
2016-05-13 14:21:24 +02:00
Britta Weber d3efe37814 [TEST] mute test for now, we have an issue for it
https://github.com/elastic/elasticsearch/issues/18325
2016-05-13 14:08:17 +02:00
Britta Weber 0d5a2f25d3 [TEST] muste test, we have an issue for it
https://github.com/elastic/elasticsearch/issues/18293
2016-05-13 12:09:30 +02:00
Olivier Bourgain df43230844 Add index name and uuid in IndexAlreadyExistsException default message
Relates #18274
2016-05-12 14:32:30 -04:00
Jason Tedor 0830bd4885 Remove period in min master node check log message
As most of our log messages are not sentences and do not end with
periods, this commit removes a period from the end of the min master
node bootstrap check log message.
2016-05-12 12:48:58 -04:00
Zachary Tong 5ee5cc25cc Move AsciiFolding earlier in FingerprintAnalyzer filter chain
Rearranges the FingerprintAnalyzer so that AsciiFolding comes earlier in the chain (after lowercasing, before stop removal, for maximum deduping power)

Closes #18266
2016-05-12 09:34:15 -04:00
Robert Muir 3b66d40f7c Merge pull request #18284 from rmuir/painless_value_aggregations
_value support in painess?
2016-05-11 20:37:35 -04:00
Robert Muir 6b4e47bf96 this makes aggregations per-document _value fast (bypass hash put, hash get, etc) for painless.
but i have no clue how to test it, it seems this feature never worked via REST?

Should we drop the feature instead?
2016-05-11 15:39:00 -04:00
Ali Beyad 189341da10 CORS handling triggered whether User-Agent is a browser or not
This commit ensures that if CORS is enabled, then Origin headers are
checked regardless of whether the request came from a browser or not.
In the past, we only proceeded with CORS checks if the User-Agent was a
browser.
2016-05-11 15:30:15 -04:00
Ali Beyad fced8dac72 When CORS is enabled, permit requests from the same origin as the
request host, as the request is not a cross origin.

Relates #18256
2016-05-11 15:24:36 -04:00
Ali Beyad 5189eb41c7 Dangling indices are not imported if a tombstone for the same index
(same name and UUID) exists in the cluster state.  This resolves a
situation where if an index data folder was copied into a node's data
directory while the node is running and that index had a tombstone in
the cluster state, the index would still get imported.

Closes #18250
Closes #18249
2016-05-11 12:56:19 -04:00
Adrien Grand ce4af4be42 Remove dead code. 2016-05-11 18:38:07 +02:00
Adrien Grand 866a5459f0 Make significant terms work on fields that are indexed with points. #18031
It will keep using the caching terms enum for keyword/text fields and falls back
to IndexSearcher.count for fields that do not use the inverted index for
searching (such as numbers and ip addresses). Note that this probably means that
significant terms aggregations on these fields will be less efficient than they
used to be. It should be ok under a sampler aggregation though.

This moves tests back to the state they were in before numbers started using
points, and also adds a new test that significant terms aggs fail if a field is
not indexed.

In the long term, we might want to follow the approach that Robert initially
proposed that consists in collecting all documents from the background filter in
order to compute frequencies using doc values. This would also mean that
significant terms aggregations do not require fields to be indexed anymore.
2016-05-11 16:52:58 +02:00
Jason Tedor d0edd13f7b Log setting key not setting object in IMC
This commit modifies two logging statements in the
IndexingMemoryController to log the key for the setting
indices.memory.index_buffer_size instead of the object.

Relates #18191
2016-05-11 10:37:23 -04:00
Yannick Welsch ae01a4f7f9 Increased logging level for testDelayedAllocationChangeWithSettingTo100ms 2016-05-11 11:59:41 +02:00
Jason Tedor 5f0cc79562 Sort plugins in list plugins command
This commit modifies the list plugins command to produce deterministic
output by sorting the plugins by comparing paths.

Relates #18260
2016-05-10 22:06:37 -04:00
Yannick Welsch a0ffe6ea89 [TEST] Ensure creation of valid routing table
An additional sanity check introduced by #17821 makes some tests fail. This check verifies that
only one shard with same shard id is allocated to a node. This commit fixes a bug in
ClusterStateCreationUtils which would construct a cluster state that allocated two shards with same
id to the same node.
2016-05-10 19:40:19 +02:00
Yannick Welsch 7753420540 Make ShardRouting and UnassignedInfo immutable (#17821)
This makes defensive copying of ShardRouting objects obsolete whenever we do a reroute and trashes less objects.
2016-05-10 19:11:04 +02:00
Jason Tedor 81c0b7bfa9 Log exception when join validation fails
Today when join validation fails, we log a warning but do not log the
exception that led to the join validation failing. This commit modifies
this so that we do log this exception.
2016-05-10 11:56:57 -04:00
Yannick Welsch ad5ce598db Use uppercase 'L' for long literal 2016-05-10 17:32:21 +02:00
Gabriel Moskovicz 0660386976 Add plugin information for Verbose mode
Relates #18051
2016-05-10 11:23:17 -04:00
Lee Hinman a45e1cc750 Add test for NullPointerException in SQS when analyzing text produces null query 2016-05-10 08:35:48 -06:00
Lee Hinman 1c54033e92 Merge branch 'pr/18068' 2016-05-10 08:27:43 -06:00
Colin Goodheart-Smithe 319ca82510 Improving parsing of sigma param for Extended Stats Bucket Aggregatio
Improving parsing of sigma param for Extended Stats Bucket Aggregation
2016-05-10 15:11:02 +01:00
Alexander Kazakov 93d1b385a4 Improving parsing of sigma param for Extended Stats Bucket Aggregation #17499 2016-05-10 14:54:54 +03:00
Daniel Mitterdorfer 8972f39a9c Reenable CircuitBreakerServiceIT#testParentChecking() 2016-05-10 12:24:49 +02:00
Colin Goodheart-Smithe 17225d9ac1 Removes the now obsolete SearchParseElement implementations
All implementations of SearchParseElement have been removed since they are no longer used now that parsing is done on the coordinating node. The SearchParseElement and FetchSubPhaseParseElement classes are not removed as currently they are needed for plugins that add a custom fetch sub phase. These will be removed in a follow up PR that will allow fetch sub phase plugins to register a parser in a different way.
2016-05-10 10:06:54 +01:00
Adrien Grand b6556e275a Remove code duplication in FieldsVisitor. #18218
It currently has twice the same method, once with a MapperService instance and
once with a DocumentMapper. This commits only keeps the former.
2016-05-10 08:17:59 +02:00
Adrien Grand f481492af3 Remove FieldMapper.Builder.indexName. #18219
The ability to configure index names that are different from the full name was
removed in 2.0.
2016-05-10 08:17:00 +02:00
Adrien Grand 68e7ac4166 Remove old backward compatibility layer for version lookups. #18215
The current code tries to handle the case that document versions are either
missing or stored in payloads rather than doc values. Since none of the 2.x
releases allowed this, we can remove this logic.
2016-05-10 08:16:05 +02:00
Adrien Grand 5d8f684319 Mapping cleanups. #18180
This removes dead/duplicate code and makes the `_index` field not configurable.
(Configuration used to jus be ignored, now we would throw an exception if any
is provided.)
2016-05-10 08:14:18 +02:00
Jason Tedor eed5b0be4f Increaes timeout on Netty handshake tests
This commit increases the timeout on the Netty handshake tests because
the previous value could cause timeout exceptions on slow machines.
2016-05-09 19:02:54 -04:00
Johnny Lim 0970c59608 Use Strings.toString() for toString() in SearchResponse and GetResponse (#18102) 2016-05-09 16:56:02 -04:00
Jim Ferenczi aef78ceb13 Do not return fieldstats information for fields that exist in the mapping
but not in the index.
2016-05-09 19:24:03 +02:00
Daniel Mitterdorfer 0f36c744d0 Merge remote-tracking branch 'danielmitterdorfer/eager-content-length' 2016-05-09 15:10:01 +02:00
Daniel Mitterdorfer 3a46812a33 Free bytes reserved on request breaker
With this commit we free all bytes reserved on the request
circuit breaker.

Closes #18144
2016-05-09 15:07:41 +02:00
Daniel Mitterdorfer 000dd62318 Determine content length eagerly in HttpServer
With this commit we eagerly evaluate content length in HttpServer
and also pass the same value to ResourceHandlingHttpChannel. With
this change it easier to reason about the content length that is
freed leaving no doubt that it must be identical to the reserved
amount.
2016-05-09 11:11:59 +02:00
Ryan Ernst c740feb3a7 Mappings: Fix ip mapper to correctly serialize a null null_value
We recently added correct serialization for null values, but the helper
method used does not allow null. This fixes serialization to handle the
null.
2016-05-06 17:07:24 -07:00
Tal Levy c1afcb543e add check for non-existent pipelines provided to simulate requests (#18190)
fixes #18139
2016-05-06 13:34:22 -07:00
Jason Tedor d0d2d2be8c Fix exception message in lifecycle
This commit fixes the exception messages for lifecycles when stopping in
illegal states.

Relates #18189
2016-05-06 16:14:43 -04:00
Ryan Ernst 2c3d3d91cb Remove unnecessary nebula source or javadoc plugins 2016-05-06 13:09:48 -07:00
Ryan Ernst 3d1be071c9 Merge branch 'master' into pom_gen 2016-05-06 12:56:51 -07:00
Chris Earle 5be79ed02c Add Failure Details to every NodesResponse
Most of the current implementations of BaseNodesResponse (plural Nodes) ignore FailedNodeExceptions.

- This adds a helper function to do the grouping to TransportNodesAction
- Requires a non-null array of FailedNodeExceptions within the BaseNodesResponse constructor
- Reads/writes the array to output
- Also adds StreamInput and StreamOutput methods for generically reading and writing arrays
2016-05-06 14:59:43 -04:00
Chris Earle 1d5b9f1ce6 Test was not updated with #18187 2016-05-06 13:17:43 -04:00
Tanguy Leroux 0ff5652fff Add node name to Cat Recovery
closes #8041
2016-05-06 16:59:53 +02:00
Britta Weber 901c25b7ff Merge pull request #18183 from brwe/exclude-all-but-text-from-wildcard-highlighting
Exclude all but string fields from highlighting if wildcards are used…
2016-05-06 16:57:25 +02:00
Britta Weber f270ed26c3 fix highlighing for old version indices with string fields 2016-05-06 16:27:31 +02:00
Jason Tedor d52537dc7b Add semicolon query string parameter delimiter
This commit adds support for the semicolon character as a valid query
string parameter delimiter.

Relates #18186
2016-05-06 09:54:26 -04:00
Jason Tedor e90d00ffce Remove handshake from transport client
This commit removes handshaking from the transport client. This
handshaking is not needed because of the existence of the liveness
check.

Relates #18174
2016-05-06 09:17:18 -04:00
Nik Everett b6698c3145 Random script fields can't overlap
This causes round tripping through xcontent to fail.

Closes #18166
2016-05-06 09:01:09 -04:00
Alexander Reelsen b12a42351e Pipeline Stats: Fix concurrent modification exception (#18177)
Due to trying to modify a map while iterating it, a concurrent modification
in the pipeline stats could be thrown. This uses an iterator to prevent this.

Closes #18126
2016-05-06 15:00:41 +02:00
Britta Weber 7b69e4ef43 keyword fields should also be highlighted 2016-05-06 14:29:19 +02:00
Britta Weber d3c5f865be Exclude all but string fields from highlighting if wildcards are used in fieldname
We should prevent highlighting if a field is anything but a text or keyword field.
However, someone might implement a custom field type that has text and still want to
highlight on that. We cannot know in advance if the highlighter will be able to
highlight such a field and so we do the following:
If the field is only highlighted because the field matches a wildcard we assume
it was a mistake and do not process it.
If the field was explicitly given we assume that whoever issued the query knew
what they were doing and try to highlight anyway.

closes #17537
2016-05-06 13:41:16 +02:00
Adrien Grand 93567a2f1b Remove StringBuilder reuse for uid creation. #18181
This would be better handled by escape analysis.
2016-05-06 13:16:58 +02:00
Adrien Grand e88ac11633 Add back Version.V_5_0_0. #18176
This was lost whene releasing alpha2 since the version constant got renamed.
2016-05-06 12:30:22 +02:00
Christoph Büscher 7d14728960 Add xContent shuffling to some more tests
This adds some random shuffling of xContent to some more test cases.

Relates to #5831
2016-05-06 10:46:39 +02:00
Adrien Grand b91df36a62 Fix and test handling of `null_value`. #18090
This was mostly untested and had some bugs.

Closes #18085
2016-05-06 09:28:23 +02:00