Commit Graph

3713 Commits

Author SHA1 Message Date
Igor Motov 99a7d8e41f Add task cancellation mechanism
Only tasks that extend CancellableTask can be cancelled using this mechanism. If a cancellable task has children it can elect to cancel all child tasks as well. In this case a special ban parent request is sent to all nodes. This request does two things: 1) it prevents any tasks with the banned parent task from being started, and 2) it cancels all currently running tasks that have the banned task as a parent. The ban is lifted as soon as the coordinating node notifies all other nodes that the cancelled task has finished executing. If the coordinating node leaves the cluster before it has a chance to lift its bans, all bans set by this coordinating node are automatically removed.

As an option a task can elect to automatically cancel all child tasks if their parent task was running on a node that just left the cluster. This option makes sense for cancellable heavy tasks that have no side-effects and only return results to the coordinating node. With the coordinating node gone, it doesn't make sense to run such tasks any longer since their results will be most likely discarded.
2016-02-09 22:30:57 -05:00
Nik Everett 5c80dd5048 Merge pull request #16567 from nik9000/checkstyle_equals_hashcode
Fail build if we define equals but not hashCode
2016-02-09 22:00:51 -05:00
Nik Everett f76366909a Fail build if we define equals but not hashCode
That is like some kind of cardinal sin or something, right?

We had two violations though they weren't super likely to be keys in a hashmap
any time soon.
2016-02-09 21:29:08 -05:00
Dongjoon Hyun 1d26b4de22 Fix typos in the names of some variables
Closes #16566
2016-02-09 20:35:42 -05:00
Yannick Welsch 0d11443aba Fix filters and null parameters in _aliases command
Closes #16549
Closes #16547
2016-02-09 21:43:42 +01:00
Jason Tedor 40789d818e Remove unused import from o.e.e.Environment 2016-02-09 13:26:32 -05:00
Jason Tedor 1046a43445 Remove unused import from o.e.c.h.MessageDigests 2016-02-09 12:59:26 -05:00
Jason Tedor e6545b63d4 Add Javadocs for o.e.c.h.MessageDigests 2016-02-09 12:56:50 -05:00
Alexander Reelsen 0d4711c2fc Ingest: Add attachment processor
This is a simple port of the mapper attachment plugin to the ingest
functionality, no new features. The only option is to limit
the number of chars to prevent indexing of huge documents.

Fields can be selected in the processor as well.

Close #16303
2016-02-09 17:03:30 +01:00
Simon Willnauer 5cbc7bb93e Merge pull request #16508 from s1monw/issues/16378
Add field names to several mapping errors
2016-02-09 16:17:33 +01:00
Simon Willnauer 35fc6006f7 fix similarity tests 2016-02-09 15:24:57 +01:00
Dongjoon Hyun 3bad16c1ca Rename variables.
This PR renames the following three variables to fix a typo `settting` into `setting`.
 * Rename a static class member:
   INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTTING -> INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTING
 * Rename a parameter: aSettting --> aSetting
 * Rename a local variable: indexSetttings -> indexSettings
2016-02-08 23:13:33 -08:00
Jason Tedor c121af63b4 BootstrapSettings final with private constructor 2016-02-08 17:24:09 -05:00
Simon Willnauer 3dd827017c Merge pull request #16501 from s1monw/trash_thread_local
Detach QueryShardContext from IndexShard and remove obsolete threadlocals
2016-02-08 21:01:35 +01:00
Simon Willnauer 10f55a2df1 simplify method signature 2016-02-08 20:27:22 +01:00
Jason Tedor 06e526ba58 Register bootstrap settings
This commit registers bootstrap settings used on startup. Without
registration, setting any of these settings causes node startup to
fail. By registering these settings (rather than clearing) after use, we
enable them to be visible in any APIs that show all settings.

Closes #16513
2016-02-08 14:15:31 -05:00
Jason Tedor 46ee568695 Log warning if max file descriptors too low
This commit adds logging for a warning message if the max file
descriptor count is too low.

Closes #16506
2016-02-08 11:50:38 -05:00
Simon Willnauer 7cb4baebf5 Add field names to several mapping errors
Closes #16378
2016-02-08 17:46:32 +01:00
Yannick Welsch 7ea4f7400b Require that relocation source is marked as relocating before starting recovery to relocation target 2016-02-08 17:30:33 +01:00
Simon Willnauer 2412dbe599 apply feedback from @colings86 2016-02-08 17:16:12 +01:00
Jason Tedor cbeae225b9 Speedup MessageDigestTests#testToHexString
The purpose of this commit is to speed up the runtime of
MessageDigestTests#testToHexString. As written, the test contains a loop
that creates 1024 test cases leading to a test runtime on the order of a
few seconds. Given build infrastructure, a single test case should
suffice. Therefore, this commit removes this loop so that the test can
execute on the order of a couple hundred milliseconds.
2016-02-08 10:58:34 -05:00
Adrien Grand bf382ce5d8 Merge pull request #16255 from jpountz/fix/search_analyzer_serialization
Fix serialization of `search_analyzer`.
2016-02-08 16:54:08 +01:00
Adrien Grand 12477f38b4 Fix serialization of `search_analyzer`.
We currently have a bug that it will be omitted if the index analyzer is the
default analyzer.
2016-02-08 16:51:36 +01:00
Jason Tedor ef88943e6e Cleanup JavaVersion
This commit includes a few minor cleanups to o/e/b/JavaVersion.java:
 - Stronger argument checking in JavaVersion#parse
 - Use JDK 8 string joiner
 - Keep an immutable copy of the version sequence
2016-02-08 10:43:46 -05:00
Simon Willnauer 96bcb47fc9 Detach QueryShardContext from IndexShard and remove obsolete threadlocals
IndexShard currently holds an arbitraritly used `getQueryShardContext` that comes
out of a ThreadLocal. It's usage is undefined and arbitraty since there is also
such a method with different semantics on `IndexService` This commit removes the threadLocal on
IndexShard as well as on the context itself. It's types are now a member and the QueryShardContext
lifecycle is managed byt SearchContext which passes the types on from the SearchRequest.
2016-02-08 15:05:03 +01:00
Isabel Drost-Fromm 0b3cab6da3 Move sorting tests w/o scripting back to core
In preparation of #16127 this moves sorting tests back to core
that don't actually need scripting or groovy to work.
2016-02-08 14:45:33 +01:00
Boaz Leskes 4decc72da6 Fix recovery translog stats totals when recovering from store
Recovery from store fails to correctly set the translog recovery stats. This fixes it and tightens up the logic bringing it all to IndexShard (previously it was set by the recovery logic).

Closes #15974
Closes #16493
2016-02-08 11:36:59 +01:00
Simon Willnauer 7bfb1dfcc1 [TEST] Don't assert on null value. It's fine to not always see an exception in this part of the test. 2016-02-07 19:58:03 +01:00
Jason Tedor 16fe948a15 Objects#requireNonNull guard in MessageDigests 2016-02-07 11:20:53 -05:00
Jason Tedor d0c03b26f6 Fix trace logging statement in ZenDiscovery 2016-02-06 09:17:49 -05:00
Jason Tedor 542373a779 Avoid cloning MessageDigest instances
This commit modifies the MessageDigests message digest provider to
return a thread local instance of MessageDigest instances instead of
using clone since some providers do not support clone.

Closes #16479
2016-02-06 09:10:31 -05:00
Simon Willnauer b185209b63 Make IndicesWarmer a private class of IndexService
There is no need for IndicesWarmer to be a global accessible class. All it needs
access to is inside IndexService. It also doesn't need to be mutable once it's not a per node
instance. This commit move IndicesWarmer to IndexWarmer and makes the default impls like field data and
norms warming an impl detail. Also the IndexShard doesn't depend on this class anymore, instead it accepts
an Engine.Warmer as a ctor argument which delegates to the actual warmer from the index.
2016-02-05 15:24:17 +01:00
Simon Willnauer 778ec84a7c Merge pull request #16469 from s1monw/simplify_indices_field_data_cache
Simplify IndicesFieldDataCache and detach from guice
2016-02-05 14:24:19 +01:00
Simon Willnauer 9b2f40f627 Merge pull request #16471 from s1monw/no_sys_props_leaked
Apply system properties after all arguemnts are parsed in BootstrapCLIParser
2016-02-05 14:23:00 +01:00
Christoph Büscher 97172aa2fd Merge pull request #16465 from cbuescher/issue-13884-test
Tests: Add test for minimum_should_match for SimpleQueryStringQuery
2016-02-05 13:12:53 +01:00
Christoph Büscher d885fe62ea Add test for minimum_should_match, one term and multiple fields
This adds a test case similar to the issue in #13884 which was
fixed in #16155.
2016-02-05 12:33:13 +01:00
Andrej Kazakov 7f2b369dfd Use Accept header field in cat API
The cat API previously used the Content-Type header field for
determining the media type of the response. This is in opposition to the
HTTP spec which specifies the Accept header field for this purpose. This
commit replaces the use of the Content-Type header field with the Accept
header field in the cat API.

Closes #14421
2016-02-05 06:28:39 -05:00
Simon Willnauer 1e18c9a7b6 Apply system properties after all arguemnts are parsed in BootstrapCLIParser
One of our tests leaked a system property here since we failed after appling some
system properties in BootstrapCLIParser. This is not a huge deal in production since
we exit the JVM if we fail on that. Yet for correctnes we should only apply them if
we manage to parse them all.
This also caused a test failure lately on CI but on an unrelated test:
  https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+periodic/314/console
2016-02-05 11:21:00 +01:00
Simon Willnauer b5ef48ce57 fix more tests 2016-02-05 10:36:02 +01:00
Simon Willnauer 9d07501c96 fix test 2016-02-05 09:54:55 +01:00
Simon Willnauer 00be9e58f2 Simplify IndicesFieldDataCache and detach from guice
Indices level field data cacheing belongs into IndicesService and doesn't need to be
wired by guice. This commit also moves the async cache refresh out of the class into
IndicesService such that threadpool dependencies are removed and testing / creation becomes
simpler.
2016-02-05 09:43:33 +01:00
Martijn van Groningen 7a6adfd93a ingest: Added foreach processor.
This processor is useful when all elements of a json array need to be processed in the same way.
This avoids that a processor needs to be defined for each element in an array.
Also it is very likely that it is unknown how many elements are inside an json array.
2016-02-04 23:44:01 +01:00
Simon Willnauer 59a20015d6 Make TermVectorService static 2016-02-04 17:17:16 +01:00
Simon Willnauer 75802515ea Merge branch 'master' into detach_shard_from_term_vectors 2016-02-04 17:12:09 +01:00
Simon Willnauer 450ee70038 Remove DFS support from TermVector API
Retrieving distributed DF for TermVectors is beside it's esotheric justification
a very slow process and can cause serious load on the cluster. We also don't have nearly
enough testing for this stuff and given the complexity we should remove it rather than carrying it
around.
2016-02-04 16:20:24 +01:00
Yannick Welsch 15507580bb Merge pull request #16243 from ywelsch/fix/remove-shardrouting-version
Remove obsolete version in ShardRouting
2016-02-04 15:52:00 +01:00
Yannick Welsch 4937531a17 Remove obsolete version in ShardRouting
Closes #16243
2016-02-04 15:50:25 +01:00
Boaz Leskes 4cdab159f1 Remove plugability of the gateway
In the spirit of simplification, remove the ability to have a custom gateway. We haven't seen any valid use for it so far.

closes #16448
2016-02-04 15:45:05 +01:00
Boaz Leskes 924e880480 Remove `gateway.initial_meta` and always rely on min master nodes
During initial cluster forming, when  a master is elected, it reaches out to all other masters nodes and ask the last cluster state they persisted. To make sure we select the right state, we must successfully read from a `min_master_nodes` nodes. The gateway currently have specific settings to override this behavior, but I don't think they are ever used. We can drop them and reach out to the discovery layer, the single source of truth for the min master nodes settings.

Closes #16446
2016-02-04 13:42:28 +01:00
Simon Willnauer 30f569f958 Remove dependency from IndexShard on TermVectorService
This dependency is just syntactic sugar and complicates IndexShard creation.
This commit move it out where it's actually used and needed.
2016-02-04 12:55:45 +01:00