Commit Graph

27420 Commits

Author SHA1 Message Date
Lee Hinman d09e64323f Add ability to automatically adjust search threadpool queue_size
This PR adds a new thread pool type: `fixed_auto_queue_size`. This thread pool
behaves like a regular `fixed` threadpool, except that every
`auto_queue_frame_size` operations (default: 10,000) in the thread pool,
[Little's Law](https://en.wikipedia.org/wiki/Little's_law) is calculated and
used to adjust the pool's `queue_size` either up or down by 50. A minimum and
maximum is taken into account also. When the min and max are the same value, a
regular fixed executor is used instead.

The `SEARCH` threadpool is changed to use this new type of thread pool. However,
the min and max are both set to 1000, meaning auto adjustment is opt-in rather
than opt-out.

Resolves #3890
2017-05-16 11:13:16 -06:00
Nik Everett 7ef390068a Move remaining pre-configured token filters into analysis-common (#24716)
Moves the remaining preconfigured token figured into the analysis-common module. There were a couple of tests in core that depended on the pre-configured token filters so I had to touch them:

* `GetTermVectorsCheckDocFreqIT` depended on `type_as_payload` but didn't do anything important with it. I dropped the dependency. Then I moved the test to a single node test case because we're trying to cut down on the number of `ESIntegTestCase` subclasses.
* `AbstractTermVectorsTestCase` and its subclasses depended on `type_as_payload`. I dropped their usage of the token filter and added an integration test for the termvectors API that uses `type_as_payload` to the `analysis-common` module.
* `AnalysisModuleTests` expected a few pre-configured token filtes be registered by default. They aren't any more so I dropped this assertion. We assert that the `CommonAnalysisPlugin` registers these pre-built token filters in `CommonAnalysisFactoryTests`
* `SearchQueryIT` and `SuggestSearchIT` had tests that depended on the specific behavior of the token filters so I moved the tests to integration tests in `analysis-common`.
2017-05-16 13:10:24 -04:00
Jason Tedor a00165913b Adjust comment lengths in IndexShard
This commit adjusts the length of some comments in IndexShard.java that
were written when the column width was set to 100.
2017-05-16 12:26:07 -04:00
Ryan Ernst 97d2657e18 Remove script access to term statistics (#19462)
In scripts (at least some of the languages), the terms dictionary and
postings can be access with the special _index variable. This is for
very advanced use cases which want to do their own scoring. The problem
is segment level statistics must be recomputed for every document.
Additionally, this is not friendly to the terms index caching as the
order of looking up terms should be controlled by lucene.

This change removes _index from scripts. Anyone using it can and should
instead write a Similarity plugin, which is explicitly designed to allow
doing the calculations needed for a relevance score.

closes #19359
2017-05-16 09:10:09 -07:00
Simon Willnauer 1cae850cf5 Add a cluster block that allows to delete indices that are read-only (#24678)
Today when an index is `read-only` the index is also blocked from
being deleted which sometimes is undesired since in-order to make
changes to a cluster indices must be deleted to free up space. This is
a likely scenario in a hosted environment when disk-space is limited to switch
indices read-only but allow deletions to free up space.
2017-05-16 17:34:37 +02:00
Nik Everett c38b3360b6 Allow unstashing values into keys (#24685)
This is almost exclusively for docs test which frequently match the
entire response. This allow something like:
```
  - set: {nodes.$master.http.publish_address: host}
  - match:
      $body:
        {
          "nodes": {
            $host: {
              ... stuff in here ...
            }
          }
        }
```

This should make it possible for the docs tests to work with
unpredictable keys.
2017-05-16 11:16:12 -04:00
Luis Majano 788d8c1ddc Docs: Link to new native ColdFusion (CFML) client (#24690) 2017-05-16 10:50:26 -04:00
Simon Willnauer 65218fea6d Allow resetting settings that use and IP validator (#24713)
The IP validator doesn't expect a null value for a setting that causes NPEs
if a user tries to reset a setting that uses this validator.

Closes #24709
2017-05-16 16:06:24 +02:00
Daniel Mitterdorfer 77762fcbb0 Use correct script name in docs for Windows
With this commit we correct the name of the ES batch script to
`elasticsearch.bat` in the docs and use backslashes in path names.
2017-05-16 15:57:05 +02:00
Zachary Tong 1e97184519 Automatically close releasables after test (#24687)
This moves the releasing logic to the base test, so that individual test cases don't need
to worry about releasing the aggregators.  It's not a big deal for individual aggs,
but once tests start using sub-aggs, it can become tricky to free (without double-freeing)
all the aggregators.
2017-05-16 09:01:38 -04:00
Martijn van Groningen f6e19dcedc
percolator: Fix range queries with date range based on current time.
Range queries with now based date ranges were previously not allowed,
but since #23921 these queries were allowed. This change should really
fix range queries with now based date ranges.
2017-05-16 13:13:11 +02:00
Christoph Büscher 8c6b5a953e [Tests] Add unit test for InternalAdjecencyMatrix aggregation (#24698)
Adding a unit test to InternalAdjecencyMatrix that extends the shared InternalAggregationTestCase
 that we use for testing aggregations.
Relates to #22278
2017-05-16 11:51:45 +02:00
Boaz Leskes a474a13911 testRerouteRecovery should use assertBusy when checking recovery counters
The test check that the number of outgoing/incoming recoveries of a shard is 0 after recoveries were done. Sadly that is not guaranteed by the current recovery logic as we decrement the counters only when all references to the relevant RecoveryTarget object have been released. This may happen in an async fashion to the recovery completion which causes the test to fail. I looked at options to change the recovery logic to have the recovery counters decrease before the recovery is done *under normally circumstances* but I don't see a clean way to do it. Since it won't give hard guarantees anyway I opted to add assertBusy to the test

Closes #24669
2017-05-16 11:09:52 +02:00
Ryan Ernst d966034298 Scripting: Deprecate index lookup (#24691)
This commit adds a deprecation warning if `_index` is used in scripts.
It is emitted each time a script is invoked, but not per document. There
is no test because constructing a LeafIndexLookup is quite difficult,
but the deprecation warning does show up in IndexLookupIT, there is just
no way to assert warnings in integ tests.

relates #19359
2017-05-16 01:41:29 -07:00
Simon Willnauer f9cfe86320 Make RemoteClusterConnectionTests more robust against cancelable threads aborts
Today we assert hart if failure listeners are invoked more than once. Yet, this
can happen if we cancel the execution since the caller and the handler will get
the exception on the cancelable threads and will notify the listener concurrently
if timinig allows. This commit relaxes the assertion towards handling multiple
invocations with `ExecutionCancelledException`

Closes #24010
Closes #24179
Closes vagnerclementino/elasticsearch/#98
2017-05-16 10:01:17 +02:00
Ryan Ernst 6ce597a378 Scripts: Convert template script engines to return String instead of BytesReference (#24447)
Template script engines (mustache, the only one) currently return a
BytesReference that users must know is utf8 encoded. This commit
modifies all callers and mustache to have the template engine return
String. This is much simpler, and does not require decoding in order to
use (for example, in ingest).
2017-05-15 22:37:31 -07:00
Ryan Ernst 548a5c1386 Docs: Add migration note about .yaml and .json removal (#24689)
relates #19391
relates #24633
2017-05-15 13:42:28 -07:00
Jack Conradson 43292979fd Add New Security Script Settings (#24637)
Settings are simplified to allowed_types and allowed_contexts.  If a setting is not specified the default is to enable all for that setting.
2017-05-15 13:37:46 -07:00
Ryan Ernst 2e6dc04025 Re-enable centos-6 2017-05-15 13:00:24 -07:00
Ryan Ernst f1fd5350c9 Test: Fix how packaging test generates expected plugins 2017-05-15 12:58:11 -07:00
Igor Motov 243635222a Move ReindexAction class to core (#24684)
This class is also needed for plugins to use reindex functionality.

Relates to #24578
2017-05-15 14:28:59 -04:00
Vlad Holubiev 557390d7d1 Fix typo in example (grades_count -> types_count) (#24635)
Looks like `doc.grade` was used for examples before. But not anymore - https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-aggregations-metrics-valuecount-aggregation.html
2017-05-15 14:08:46 -04:00
Jason Tedor 92ba969804 Remove Jython hacks
We had a hack in setting up permissions for tests to support testing
the lang-python plugin. We also had a hack to prevent Log4j from
loading a shaded version of Jansi provided by Jython. This plugin has
been removed so these hacks are no longer necessary.

Relates #24681
2017-05-15 12:40:24 -04:00
Luca Cavanna 563e7ddc83 Pass over _routing value with more_like_this items to be retrieved (#24679)
When retrieving documents to extract terms from as part of a more like this query, the _routing value can be set, yet it gets lost. That leads to not being able to retrieve the documents, hence more_like_this used to return no matches all the time.

Closes #23699
2017-05-15 18:15:42 +02:00
Luca Cavanna e14ba81ac1 Make ObjectParser support string to boolean conversion (#24668)
We generally accept string values when a boolean is expected. We've been doing that in our parsing code, but we missed that bit when moving parsing code to ObjectParser, which throws an error instead. This commit makes ObjectParser parse also string values into booleans. It throws an error in case the value is not `true` or `false`.

Closes #21802
2017-05-15 18:15:20 +02:00
Tanguy Leroux dcb63ab8bc Share XContent rendering code in significant terms aggregations (#24677)
The rendering methods in String and Long Significant String aggregations
 and buckets are very similar. They can be factored out in the
 InternalSignificantTerms class an InternalMappedSignificantTerms class.
2017-05-15 16:52:02 +02:00
Tanguy Leroux 578223f679 Make SignificantTerms.Bucket an interface rather than an abstract class (#24670)
This commit changes SignificantTerms.Bucket so that it is not an
abstract class anymore but an interface. It will be easier for the Java
High Level Rest Client to provide its own implementation of
SignificantTerms and SignificantTerms.Bucket. Also, it is now more
coherent with the others aggregations.
2017-05-15 15:14:07 +02:00
Jason Tedor bd5aee8cfa Split disruption test suite
The disruption tests sit in a single test suite which causes these tests
to be single-threaded. We can split this test suite into multiple suites
(logically, of course) enabling them to be run in parallel reducing the
total run time of all integration tests in core. This commit splits the
discovery with service disruptions test suite into three suites
 - master disruptions
 - discovery disruptions
 - cluster disruptions

The last one could probably be better named, it is meant to represent
performing actions in the cluster (indexing, failing a shard, etc.)
while a disruption is taking place.

Relates #24662
2017-05-15 07:47:42 -04:00
Kunal Kapoor fdb6cd8088 Deprecate use of + in index names (#24585)
Use of '+' in index names is implicit. There is no need to support it. This commit deprecates support for it.

Closes #24515
2017-05-15 11:26:51 +02:00
Yannick Welsch bd364c56a8 Mute packagingTest on CentOS 6
Relates #24645
2017-05-15 11:01:35 +02:00
Koen De Groote f185b69e04 Replace manual copying an array or collection with static methods calls (#24657) 2017-05-15 09:35:48 +02:00
Ryan Ernst 17f8d2debd Settings: Remove support for yaml and json config files (#24664)
This commit removes the deprecated support for .yaml and .json files. If
the files still exist, the node will fail to start, indicating the file
must be converted or renamed.

closes #19391
2017-05-14 17:45:04 -07:00
Ryan Ernst e6535bc771 Settings: Update settings deprecation from yml to yaml (#24663)
This converts the deprecation added for 5.5 from .yml to .yaml. Note
that this deprecation has not been released yet.

relates #19391
2017-05-14 17:40:50 -07:00
Jason Tedor 4e21a33689 Clarify disabling swap in docs
Our strong recommendation is disabling swap over any other alternative
to avoid the JVM from landing on disk. This commit clarifies the docs in
this regard.
2017-05-12 16:09:52 -04:00
Jason Tedor 5da940532d Remove Netty logging hack (#24653)
Netty removed a logging guarded we added to prevent a scary logging
message. We added a hack to work around this. They've added the guard
back, so we can remove the hack now.
2017-05-12 16:05:13 -04:00
Jason Tedor 458129a85a Upgrade to Netty 4.1.11.Final
This commit upgrades the Netty dependency from 4.1.10.Final to
4.1.11.Final.

Relates #24652
2017-05-12 15:53:51 -04:00
Jim Ferenczi e804817ce4 #24638 Add the parent-join plugin in the prebuilt transport client by default 2017-05-12 17:25:34 +02:00
Jim Ferenczi 4291880a29 [Tests] #24638 Fix rest high level client docs build by restoring hasChild and hasParent in the tests 2017-05-12 17:03:26 +02:00
Tanguy Leroux f8df2a22e9 SniffNodesSampler should close connection after handling responses (#24632)
With the current implementation, SniffNodesSampler might close the
current connection right after a request is sent but before the response
is correctly handled. This causes to timeouts in the transport client
when the sniffing is activated.

closes #24575
closes #24557
2017-05-12 16:38:50 +02:00
Koen De Groote 878ae8eb3c Size lists in advance when known
When constructing an array list, if we know the size of the list in
advance (because we are adding objects to it derived from another list),
we should size the array list to the appropriate capacity in advance (to
avoid resizing allocations). This commit does this in various places.

Relates #24439
2017-05-12 10:36:13 -04:00
Simon Willnauer e8e2ccdcf5 Call onClose listener in a finally block 2017-05-12 16:32:29 +02:00
Jim Ferenczi 279a18a527 Add parent-join module (#24638)
* Add parent-join module

This change adds a new module named `parent-join`.
The goal of this module is to provide a replacement for the `_parent` field but as a first step this change only moves the `has_child`, `has_parent` queries and the `children` aggregation to this module.
These queries and aggregations are no longer in core but they are deployed by default as a module.

Relates #20257
2017-05-12 15:58:06 +02:00
Simon Willnauer be2a6ce80b Notify onConnectionClosed rather than onNodeDisconnect to prune transport handlers (#24639)
Today we prune transport handlers in TransportService when a node is disconnected.
This can cause connections to starve in the TransportService if the connection is
opened as a short living connection ie. without sharing the connection to a node
via registering in the transport itself. This change now moves to pruning based
on the connections cache key to ensure we notify handlers as soon as the connection
is closed for all connections not just for registered connections.

Relates to #24632
Relates to #24575
Relates to #24557
2017-05-12 15:40:40 +02:00
Yannick Welsch 04e08f5e49 Simplify Discovery interface (#24608)
- Removes clusterState, getInitialClusterState and getMinimumMasterNodes methods from Discovery interface.
- Sets PingContextProvider in ZenPing constructor
- Renames state in ZenDiscovery to committedState
2017-05-12 14:08:14 +02:00
Dimitris Athanasiou b7976bd536 [TEST] Temporarily disable the secure fixture for hdfs tests (#24643)
This keeps failing the build so I am temporarily disabling it
until #24636 gets merged.
2017-05-12 12:58:30 +01:00
Christoph Büscher f06467b6a0 [Tests] Add unit tests for InternalFilters (#24624)
Relates to #22278
2017-05-12 11:48:44 +02:00
Byron Voorbach 70e14d5e3f Fix Source filtering in new field collapsing feature
Update ValueType of FetchSourceContext to OBJECT_ARRAY_BOOLEAN_OR_STRING to be in line with other source_filtering implementations
2017-05-12 09:38:16 +02:00
Koen De Groote 220bd2de6e Make a few class level fields static
This commit converts some final constant instance fields to class
fields.
2017-05-11 22:44:31 -04:00
Jim Ferenczi 7b7e15023a Add rest test for sliced scroll (#24630) 2017-05-12 00:07:24 +02:00
Nik Everett 4d86679f5a Disable reindex-from-old tests in windows
In windows we can't reliable git the pid so we skip the
reindex-from-remote tests from old versions of elasticsearch. This
is OK because we aren't really testing windows here anyway. It isn't
great, but should be safe.
2017-05-11 17:36:03 -04:00