Commit Graph

2774 Commits

Author SHA1 Message Date
Adrien Grand 003e19b5fb Merge pull request #15398 from jpountz/remove/_source_format
Remove the `format` option of the `_source` field.
2015-12-11 18:27:27 +01:00
Jason Tedor a087d557f9 Fix NullPointerException in o.e.c.Randomness 2015-12-11 12:10:43 -05:00
Adrien Grand 9fd843748e Remove the `format` option of the `_source` field.
This option allows to force the xcontent type to use to store the `_source`
document. The default is to use the same format as the input format.

This commit makes this option ignored for 2.x indices and rejected for 3.0
indices.
2015-12-11 18:06:20 +01:00
Jason Tedor cd40cd78ba Merge pull request #15299 from jasontedor/collections-shuffle-reproducibility
Remove and forbid use of Collections#shuffle(List) and Random#<init>()
2015-12-11 11:24:56 -05:00
Jim Ferenczi d78e24689b Merge pull request #15364 from jimferenczi/missing_query_removal
Remove the MissingQueryBuilder which was deprecated in 2.2.0.
2015-12-11 17:20:47 +01:00
Jason Tedor 3383c24be0 Remove and forbid use of Collections#shuffle(List) and Random#<init>()
This commit removes and now forbids all uses of
Collections#shuffle(List) and Random#<init>() across the codebase. The
rationale for removing and forbidding these methods is to increase test
reproducibility. As these methods use non-reproducible seeds, production
code and tests that rely on these methods contribute to
non-reproducbility of tests.

Instead of Collections#shuffle(List) the method
Collections#shuffle(List, Random) can be used. All that is required then
is a reproducible source of randomness. Consequently, the utility class
Randomness has been added to assist in creating reproducible sources of
randomness.

Instead of Random#<init>(), Random#<init>(long) with a reproducible seed
or the aforementioned Randomess class can be used.

Closes #15287
2015-12-11 11:16:38 -05:00
Adrien Grand ed53edd4d0 Merge pull request #15344 from jpountz/fix/remove_source_backcompat
Remove back compat for the `_source` compression options.
2015-12-11 17:01:15 +01:00
Daniel Mitterdorfer f5d307e426 BulkItemResponse returns status code instead of status name
In commit fafeb3a, we've refactored REST response handling logic
and returned HTTP status names instead of HTTP status codes for
bulk item responses. With this commit we restore the original
behavior.

Checked with @bleskes.
2015-12-11 16:22:36 +01:00
Simon Willnauer 90ff1ad5fb Merge pull request #15235 from s1monw/remove_recovery_settings
Restore chunksize of 512kb on recovery and remove configurability
2015-12-11 15:27:20 +01:00
Simon Willnauer db15682b3c apply review comments from @bleskes 2015-12-11 15:16:14 +01:00
Adrien Grand afcaa593ae Merge pull request #15358 from jpountz/fix/safe_write_raw
Make XContentGenerator.writeRaw* safer.
2015-12-11 12:18:04 +01:00
Isabel Drost-Fromm 8dad4d03f4 Merge pull request #11598 from srogljan/master
UNICODE_CHARACTER_CLASS fix
2015-12-11 11:53:35 +01:00
Adrien Grand d408313974 Make XContentGenerator.writeRaw* safer.
This method currently allows to write arbitrary bytes in an xcontent stream.
I changed it so that it can only write data to the same stream as the xcontent
(the bos parameter is removed) and that it yells at you if you try to write
raw bytes that can't be recognized as xcontent. Also the logic to copy the
structure instead of appending the bytes directly if the source and target
are of a different xcontent type have been moved to the low-level
XContentGenerator.
2015-12-11 11:13:57 +01:00
Yannick Welsch db5594a2af Support wildcards for getting repositories or snapshots
Closes #15151
2015-12-11 10:20:27 +01:00
Simon Willnauer 12f905a675 Make chunkSize configurabel for tests and use correct close handling for closing streams to not hide original exception 2015-12-11 09:44:08 +01:00
Ryan Ernst 81d6363967 Remove benchmark package
Tons of ancient "benchmarks" exist in elasticsearch. These are main
methods that do some kind of construction of ES classes and time various
things. The problem with these is they are not maintained, and not run.
Refactorings that touch anything that is common in these classes is very
painful. Going through these, almost all would simply not work in 2.x
without modifications (because they do not set path.home).

This change removes the entire benchmark package. If someone needs to
run a benchmark like this, they can look at history for examples if
necessary (although these examples are often not realistic and should
just start real elasticsearch processes in a shell script). Longer term,
we should make this easier to do by having the build support adding real
benchmarks which can be run in jenkins (so we know they actually run,
instead of doing refactorings with pure guesswork as to whether the
benchmark would run correctly).
2015-12-10 19:29:54 -08:00
Ryan Ernst 93de1ed606 Merge pull request #15354 from rjernst/just_node
Remove NodeBuilder
2015-12-10 19:19:55 -08:00
Robert Muir d190283fea Merge pull request #15378 from rmuir/tame_reflection
Remove RuntimePermission("accessDeclaredMembers")
2015-12-10 15:25:44 -05:00
Robert Muir 2741888498 Remove RuntimePermission("accessDeclaredMembers")
Upgrades lucene to 5.5.0-1719088, randomizedtesting to 2.3.2, and securemock to 1.2
2015-12-10 14:26:55 -05:00
Boaz Leskes 09053f5c87 remove safety check from IndexShard#prepareDeleteOnReplica
we are not ready for this yet:

```
        if (shardRouting.primary() && shardRouting.isRelocationTarget() == false) {
            throw new IllegalIndexShardStateException(shardId, state, "shard is not a replica");
        }
```
2015-12-10 16:04:47 +01:00
Boaz Leskes fafeb3abdd Introduce a common base response class to all single doc write ops
IndexResponse, DeleteResponse and UpdateResponse share some logic. This can be unified to a single DocWriteResponse base class. On top, some replication actions are now not about write operations anymore. This commit renames ActionWriteResponse to ReplicationResponse

Last some toXContent is moved from the Rest layer to the actual response classes, for more code re-sharing.

Closes #15334
2015-12-10 15:14:02 +01:00
Jun Ohtani fab44398d9 Analysis: Add detail response support
add explain option
fix char_filter bug

Closes #11076 #15257
2015-12-10 23:10:51 +09:00
Robert Muir 1ef24d2a85 Merge pull request #15328 from rmuir/shave_mustache
Factor mustache -> modules/lang-mustache
2015-12-10 08:46:57 -05:00
Daniel Mitterdorfer fc9afa2bb8 Reduce maximum number of concurrent requests in BulkProcessorIT
The test configuration with seed A23029712A7EFB34 overwhelmed the pool which is invoked
in TransportService#sendLocalRequest().

With this commit we reduce the maximum number of concurrent requests from 10 to 7 and
add the failure message to the test output on the failing assertion for easier analysis.
2015-12-10 14:24:35 +01:00
Jim Ferenczi 176a4fc8da Review ++ 2015-12-10 14:19:19 +01:00
Robert Muir e454fadc22 Merge branch 'master' into shave_mustache 2015-12-10 07:58:24 -05:00
Jim Ferenczi 437488ae64 Remove the MissingQueryBuilder which was deprecated in 2.2.0.
As a replacement use ExistsQueryBuilder inside a mustNot() clause.
So instead of using `new ExistsQueryBuilder(name)` now use:
`new BoolQueryBuilder().mustNot(new ExistsQueryBuilder(name))`.

Closes #14112
2015-12-10 12:55:05 +01:00
Robert Muir 7595c4a3c8 Improve network docs
This makes some minor improvements (does not fix all problems!)

It reorders unicast disco in elasticsearch.yml to be right after the network host,
for better locality.

It removes the warning (unreleased) about publish addresses, lets try to really discourage setting
that unless you need to (behind a proxy server). Most people should be fine with `network.host`

Finally it reorganizes the network docs page a bit:

We add a table of 4 "basic" settings at the very beginning:

* network.host
* discovery.zen.ping.unicast.hosts
* http.port
* transport.tcp.port

The first two being the most important, which addresses to bind and talk to, and the other two
being the port numbers.

The rest of the stuff I tried to simplify and reorder under "advanced" headers.

This is just a quick stab, I still think we need more effort into this thing, but we gotta start somewhere.
2015-12-10 12:01:18 +01:00
Christoph Büscher 79cdc40afe Merge pull request #15324 from cbuescher/highlight-builder-searchContextHighlight
Enable HighlightBuilder to create SearchContextHighlight
2015-12-10 11:15:43 +01:00
Adrien Grand 29859a946d Merge pull request #15337 from jpountz/remove/estimatedNumberType
Remove XContentParser.estimatedNumberType().
2015-12-10 10:09:09 +01:00
Yannick Welsch 17da7fb0ee Merge pull request #15305 from ywelsch/feature/multi-alias-rest
Add support to _aliases endpoint to specify multiple indices and aliases in one action
2015-12-10 09:44:36 +01:00
Ryan Ernst 6f166dd0ff Remove NodeBuilder
The NodeBuilder is currently used to construct a Node. However, this is
really just yet-another-builder that wraps around a Settings.Builder
witha couple convenience methods. But there are very few uses of these
convenience methods.  This change removes NodeBuilder, in favor of just
using the Node constructor.
2015-12-10 00:01:44 -08:00
Areek Zillur 025e9818e7 Refactors TransportReplicationAction to decouple request routing and shard operation logic 2015-12-10 01:32:07 -05:00
Jack Conradson da5b07ae13 Added a new scripting language (PlanA).
Closes #15136
2015-12-09 16:32:37 -08:00
David Pilato f675801b26 add more tests to network service
Follow up for #15340

We test that bind with wilcard IP + fixed IP it raises an exception
We test binding multiple IPs

(cherry picked from commit 2cc5bb7)
2015-12-09 23:17:59 +01:00
Adrien Grand ab44366d93 Remove back compat for the `_source` compression options.
These options have been deprecated before 2.0 so they don't need to be supported
by 3.0.
2015-12-09 19:22:34 +01:00
Yannick Welsch bef0bedba9 Add support to _aliases endpoint to specify multiple indices and aliases in one action
Closes #15305
2015-12-09 19:08:27 +01:00
Christoph Büscher e4721fd02a Addressing review comments 2015-12-09 18:04:58 +01:00
Adrien Grand 3e47f90460 Remove XContentParser.estimatedNumberType().
The goal of this method is to know whether the xcontent impl knows how to
differenciate floats from doubles or longs from ints or if it's just guessing.
However, all implementations return true (which is correct for yaml and json,
but cbor and smile should be able to differenciate). I first tried to implement
this method correctly but it raised many issues because eg. most impls write a
long as an integer when it is small enough. So I suggest that we remove this
method and just treat cbor and smile like yaml and json, which is already what
is happening today anyway.
2015-12-09 14:56:50 +01:00
Colin Goodheart-Smithe b4e0c876d5 Merge pull request #15321 from martinstuga/Refactor-StatsAggegator#15264
Correct typo in class name of StatsAggregator (Closes #14730)
2015-12-09 13:39:27 +00:00
Christoph Büscher cb84b1ff1a Make HighlightBuilder produce SearchContextHighlight
The HighlightBuilder should be able to procude a SeachContextHighlight
object which contains the merged global and field options, also
contains objects that can only be created on the index shard (like
the actual lucene Query object used during highlighting).
This is done by the build() method of the HighlighBuilder. Also
adding tests that make sure the produced SearchContextHighlighter is
similar to the one we would get when parsing the xContent directly
with the current HighlightParseElement.
2015-12-09 11:44:45 +01:00
Boaz Leskes ccd0543172 CancellableThreads should also treat ThreadInterruptedException as InterruptedException
RecoverySource uses the RateLimiter under a cancelable thread. The SimpleRateLimiter used in throws   ThreadInterruptedException on interruption. We should treat it as InterruptedException
2015-12-09 09:29:23 +01:00
Adrien Grand 1909c3d8cc Only text fields should accept analyzer and term vector settings.
Currently almost all our fields accept the `analyzer` and `term_vector` settings
although they only make sense on text fields. This commit forbids those settings
on all fields but `string` and `_all` for indices created on or after version
2.2.0.
2015-12-09 08:42:56 +01:00
Adrien Grand 473e880a7c Merge pull request #15319 from jpountz/enhancement/dynamic_mappings_float
Dynamically map floating-point numbers as floats instead of doubles.
2015-12-09 08:38:27 +01:00
Robert Muir 0bf9e36eaa Merge pull request #15311 from rmuir/symlinks_are_bad
punch thru symlinks when loading plugins/modules
2015-12-09 01:35:00 -05:00
Ryan Ernst b7fb0824be Fix render search template tests 2015-12-08 21:33:48 -08:00
Robert Muir 7f06c12c7f restore randomness in test 2015-12-08 23:44:28 -05:00
Robert Muir a6fe9a4212 move test back now that its fixed 2015-12-08 23:42:18 -05:00
Ryan Ernst 907d3cf878 move template query builder tests back to core (using mockscript) 2015-12-08 20:26:45 -08:00
Robert Muir 2e299860e5 refactor mustache to lang-mustache plugin. No rest tests yet. 2015-12-08 22:45:21 -05:00
Jim Ferenczi 23aeaa88b2 Fixes random failures of org.apache.elasticsearch.test.rest.RestIT
RestTable: ignores right padding for the last cell of a column.
2015-12-08 20:52:24 +01:00
Christoph Büscher d866906612 Merge pull request #15157 from cbuescher/highlight-builder-fromXContent
Add fromXContent() method to HighlightBuilder
2015-12-08 19:39:00 +01:00
Paulo Martins 02b1c32261 Correct typo in class name of StatsAggregator #15264 (Closes) 2015-12-08 17:44:52 +00:00
Adrien Grand f2d8a35888 Dynamically map floating-point numbers as floats instead of doubles.
Close #13851
2015-12-08 18:19:47 +01:00
Ryan Ernst 6f996e9e26 Merge pull request #15300 from rjernst/tribe_cleanup
Fix tribe node to load config file for internal client nodes
2015-12-08 08:07:26 -08:00
Ryan Ernst 7a5126192a Removed unnecessary setting previously used to ignore sysprops in tribe nodes 2015-12-08 08:05:50 -08:00
Christoph Büscher 9ea18fc576 Adding checks for unexpected tokens in parser 2015-12-08 15:50:44 +01:00
Simon Willnauer c6938896aa Merge pull request #15309 from s1monw/handle_source_canceled
Handle cancel exceptions on recovery target if the cancel comes from the source
2015-12-08 15:21:48 +01:00
Jim Ferenczi 14edc84f36 Merge pull request #15250 from jimferenczi/cat_api_fix
:CAT API: remove space at the end of a line
2015-12-08 15:05:25 +01:00
Myll 73a3c326c9 _cat APIs: remove space at the end of a line
Fixes #9464
2015-12-08 15:03:59 +01:00
Britta Weber e0aa481bf5 Merge pull request #15213 from brwe/copy-to-in-multi-fields-exception
throw exception if a copy_to is within a multi field

Copy to within multi field is ignored from 2.0 on, see #10802.
Instead of just ignoring it, we should throw an exception if this
is found in the mapping when a mapping is added. For already
existing indices we should at least log a warning.
We remove the copy_to in any case.

related to #14946
2015-12-08 14:41:07 +01:00
Simon Willnauer 7d6663e6e5 use AtomicBoolean instead of a simple boolean 2015-12-08 14:32:48 +01:00
Robert Muir a6ba351fb2 punch thru symlinks when loading plugins/modules
this ensures the codebase URL matches the permission grant (see matching toRealPath in Security.java)
in the case of symlinks or other shenanigans.

this is best effort, if we really want to support symlinks in any way, we need
e.g. qa or vagrant tests that configure a bunch of symlinks for things and ensure that in jenkins.
this should be easier to do with gradle, as we can just create a symlink'd home if we want
2015-12-08 08:04:11 -05:00
Simon Willnauer 449f9e7258 don't allow writing single bytes on recovery outputstream 2015-12-08 12:41:19 +01:00
Simon Willnauer ceb2797857 Handle cancel exceptions on recovery target if the cancel comes from the source
Today we only handle correctly if the `ExecutionCancelledException` comes from the
local execution. Yet, this can also come from remove and should be handled identically.
2015-12-08 12:01:22 +01:00
Simon Willnauer 8b8de5cb4b Don't send chunks after a previous send call failed. 2015-12-08 11:54:37 +01:00
Simon Willnauer 37b60bd76b more accurate chunk size 2015-12-08 11:20:55 +01:00
Simon Willnauer 414c04eb66 Restore chunksize of 512kb on recovery and remove configurability
This commit restores the chunk size of 512kb lost in a previous but unreleased
refactoring. At the same time it removes the configurability of:
 * `indices.recovery.file_chunk_size` - now fixed to 512kb
 * `indices.recovery.translog_ops` - removed without replacement
 * `indices.recovery.translog_size` - now fixed to 512kb
 * `indices.recovery.compress` - file chunks are not compressed due to lucene's compression but translog operations are.

The compress option is gone entirely and compression is used where it makes sense. On sending files of the index
we don't compress as we rely on the lucene compression for stored fields etc.

Relates to #15161
2015-12-08 11:20:55 +01:00
Boaz Leskes 0809e4a65f typo fix 2015-12-08 09:36:10 +01:00
Boaz Leskes 82b502c21f Make IndexShard operation be more explicit about whether they are expected to run on a primary or replica
This commit cherry picks some infrastructure changes from the `feature/seq_no` branch to make merging from master easier.

More explicitly, IndexShard current have  prepareIndex and prepareDelete methods that are called both on the primary as the replica, giving it a different origin parameter. Instead, this commits creates two explicit prepare*OnPrimary and prepare*OnReplica methods. This has the extra added value of not expecting the caller to use an Engine enum.

Also, the commit adds some code reuse between TransportIndexAction and TransportDeleteAction and their TransportShardBulkAction counter parts.

Closes #15282
2015-12-08 09:08:08 +01:00
Adrien Grand 47bcb33006 Merge pull request #15289 from jpountz/fix/mapper_tokenized
Mapper parsers should not check for a `tokenized` property.
2015-12-08 09:02:38 +01:00
Ryan Ernst 25d60e152f Tribe: Fix tribe node to load config file for internal client nodes
The tribe node creates one local client node for each cluster it
connects to. Refactorings in #13383 broke this so that each local client
node now tries to load the full elasticsearch.yml that the real tribe
node uses.

This change fixes the problem by adding a TribeClientNode which is a
subclass of Node. The Environment the node uses is now passed in (in
place of Settings), and the TribeClientNode simply does not use
InternalSettingsPreparer.prepareEnvironment.

The tests around tribe nodes are not great. The existing tests pass, but
I also manually tested by creating 2 local clusters, and configuring and
starting a tribe node. With this I was able to see in the logs the tribe
node connecting to each cluster.

closes #13383
2015-12-07 20:18:06 -08:00
Jason Tedor 618c2f7af5 Add missing license header to o.e.m.Probes 2015-12-07 22:07:20 -05:00
Simon Willnauer 4e80a5e099 Merge pull request #15234 from s1monw/remove_ancient_settings
Remove ancient deprecated and alternative recovery settings
2015-12-07 21:15:49 +01:00
Adrien Grand c6a73dfcd5 Mapper parsers should not check for a `tokenized` property.
I don't recall of this property of any of our field mappers and it's not in our
docs so I suspect it's very old. The removal of this property will not fail
version upgrades since none of the field mappers use it in toXContent.
2015-12-07 19:15:15 +01:00
Adrien Grand 3a58af04c0 Merge pull request #15245 from jpountz/fix/check_type_name
Make MappedFieldType.checkTypeName part of MappedFieldType.checkCompatibility.
2015-12-07 18:03:07 +01:00
Christoph Büscher c57672c9b3 Adding checks and tests for exceptions on unknown fieldnames 2015-12-07 16:52:53 +01:00
Christoph Büscher 6a7eedd8ae Switching HighlighterBuilder to use ParseFields 2015-12-07 14:56:05 +01:00
Jason Tedor 914486795f Addtional simplifications in IndexingMemoryController
This commit removes some unneeded null checks from
IndexingMemoryController that were left over from the work in #15251,
and simplifies the try-catch block in
IndexingMemoryController#updateShardBuffers.
2015-12-07 08:42:11 -05:00
Jim Ferenczi da380af10b Merge pull request #15216 from jimferenczi/copy_to_dynamic_object
Fix copy_to when the target is a dynamic object field.
2015-12-07 14:16:18 +01:00
Jim Ferenczi 8558a40894 Fix copy_to when the target is a dynamic object field.
Fixes #11237
2015-12-07 14:14:00 +01:00
Christoph Büscher aa69c4a20b Add fromXContent method to HighlightBuilder
For the search refactoring the HighlightBuilder needs a way to
create new instances by parsing xContent. For bwc this PR start
by moving over and slightly modifying the parsing from
HighlighterParseElement and keeps parsing for top level highlighter
and field options separate. Also adding tests for roundtrip
of random builder (rendering it to xContent and parsing it and
making sure the original builder properties are preserved)
2015-12-07 11:24:27 +01:00
Ryan Ernst 5402277462 Fix plugin service check for missing descriptor to allow ioexception 2015-12-06 23:09:00 -08:00
Robert Muir 1329ef487a Merge pull request #15262 from rmuir/filter_classes_in_scripts
Filter classes loaded by scripts
2015-12-06 10:29:56 -05:00
Michael McCandless fe5570dba8 use dummy mac address if anything goes wrong asking for the real one 2015-12-06 06:10:43 -05:00
Robert Muir 2169a123a5 Filter classes loaded by scripts
Since 2.2 we run all scripts with minimal privileges, similar to applets in your browser.
The problem is, they have unrestricted access to other things they can muck with (ES, JDK, whatever).
So they can still easily do tons of bad things

This PR restricts what classes scripts can load via the classloader mechanism, to make life more difficult.
The "standard" list was populated from the old list used for the groovy sandbox: though
a few more were needed for tests to pass (java.lang.String, java.util.Iterator, nothing scary there).

Additionally, each scripting engine typically needs permissions to some runtime stuff.
That is the downside of this "good old classloader" approach, but I like the transparency and simplicity,
and I don't want to waste my time with any feature provided by the engine itself for this, I don't trust them.

This is not perfect and the engines are not perfect but you gotta start somewhere. For expert users that
need to tweak the permissions, we already support that via the standard java security configuration files, the
specification is simple, supports wildcards, etc (though we do not use them ourselves).
2015-12-05 21:46:52 -05:00
Jason Tedor 74a81b4a26 Remove logging statement when no shards are active 2015-12-05 11:30:17 -05:00
Jason Tedor fe0b9be472 Simplify shard inactive logging
This commit simplifies shard inactive debug logging to only log when the
physical shard is marked as inactive. This eliminates duplicate logging
that existed in IndexShard#checkIdle and
IndexingMemoryController#checkIdle, and eliminates excessive logging
that was occurring when the shard was already inactive as a result of
the work in #15252.
2015-12-05 11:20:23 -05:00
Jason Tedor 73a0cc6488 Clarify variable name in IndexingMemoryController#availableShards 2015-12-05 09:23:46 -05:00
Ryan Ernst 7ac094fdc5 Remove unused dependency on rest spec in core integ tests 2015-12-04 19:48:40 -08:00
Ryan Ernst 62a0e0bc2b Fix plugin test to account for possibly extra dir by mock fs 2015-12-04 17:55:31 -08:00
Robert Muir 506fa617da Merge pull request #15253 from rmuir/getClassLoader
ban RuntimePermission("getClassLoader")
2015-12-04 18:34:08 -05:00
Ryan Ernst 50716c3941 Plugins: Add nicer error message when an existing plugin's descriptor is missing
Currently, when a user tries to install an old plugin (pre 2.x) on a 2.x
node, the error message is cryptic (just printing the file path that was
missing, when looking for the descriptor). This improves the message to
be more explicit that the descriptor is missing, and suggests the
problem might be the plugin was built before 2.0.

closes #15197
2015-12-04 14:11:37 -08:00
Jason Tedor bbef8acd3c Cleanup ClusterServiceIT#testClusterStateBatchedUpdates
This commit addresses some issues that arose during the review of #14899
but were lost during squash while integrating into master.
 - the number of test threads is dropped to at most eight
 - a local variable is renamed for clarity
 - task priorities are randomized
2015-12-04 16:36:29 -05:00
Jason Tedor e7952e2023 Fix test bug in ClusterServiceIT#testClusterStateBatchedUpdates
This commit fixes a test bug in
ClusterService#testClusterStateBatchedUpdates. In particular, in the
case that an executor did not receive a task assignment from the random
assignments, it would not have an entry in the map of executors to
counts of assigned tasks. The fix is to just check if each executor has
an entry in the counts map.
2015-12-04 16:25:36 -05:00
Jason Tedor b1a67b1c69 Simplify IndexingMemoryController#checkIdle
This commit further simplifies IndexingMemoryController#checkIdle after
the changes in #15251.
2015-12-04 16:10:43 -05:00
Robert Muir 46377778a9 Merge branch 'master' into getClassLoader 2015-12-04 15:58:36 -05:00
Robert Muir b0c64910b0 ban RuntimePermission("getClassLoader")
this gives more isolation between modules and plugins.
2015-12-04 15:58:02 -05:00
Jason Tedor 5a391f116b Merge pull request #15251 from jasontedor/stateless-indexing-memory-controller
IndexingMemoryController should not track shard index states
2015-12-04 15:18:40 -05:00
Jason Tedor 56328160c9 Absorb core ShardsIndicesStatusChecker logic into body of run 2015-12-04 15:16:22 -05:00
Jason Tedor 5341404f01 IndexingMemoryController should not track shard index states
This commit modifies IndexingMemoryController to be stateless. Rather
than statefully tracking the indexing status of shards,
IndexingMemoryController can grab all available shards, check their idle
state, and then resize the buffers based on the number of and which
shards are not idle.

The driver for this change is a performance regression that can arise in
some scenarios after #13918. One scenario under which this performance
regression can arise is if an index is deleted and then created
again. Because IndexingMemoryController was previously statefully
tracking the state of shards via a map of ShardIds, the new shards with
the same ShardIds as previously existing shards would not be detected
and therefore their version maps would never be resized from the
defaults. This led to an explosion in the number of merges causing a
degradation in performance.

Closes #15225
2015-12-04 15:01:47 -05:00
Ryan Ernst 01d48e2062 Merge branch 'master' into jigsaw 2015-12-04 11:29:49 -08:00
Lee Hinman 46ca2d679d Merge remote-tracking branch 'dakrone/remove-get-forcemerge' 2015-12-04 10:21:57 -07:00
Adrien Grand be033f1362 Make MappedFieldType.checkTypeName part of MappedFieldType.checkCompatibility. 2015-12-04 17:15:49 +01:00
Yannick Welsch 8dcc692373 Ignore RejectedExecutionException in NodesFaultDetection
Closes #15212
2015-12-04 16:35:20 +01:00
Adrien Grand e5ed5b908f Check mapping compatibility up-front.
Today we only check mapping compatibility when adding mappers to the
lookup structure. However, at this stage, the mapping has already been merged
partially, so we can leave mappings in a bad state. This commit removes the
compatibility check from Mapper.merge entirely and performs it _before_ we
call Mapper.merge.

One minor regression is that the exception messages don't group together errors
that come from MappedFieldType.checkCompatibility and Mapper.merge. Since we
run the former before the latter, Mapper.merge won't even have a chance to let
the user know about conflicts if conflicts were discovered by
MappedFieldType.checkCompatibility.

Close #15049
2015-12-04 14:02:04 +01:00
Adrien Grand 3f18487afa Merge pull request #15177 from jpountz/remove/MergeMappingException
Remove MergeMappingException.
2015-12-04 13:55:54 +01:00
Christoph Büscher 5d0689581b Geo: Remove `translated` state from LineStringBuilder
The `translated` flag makes LineStringBuilder stateful and gets set
to true under certain conditions when building a Shape or Geometry
from the ShapeBuilder. This makes building operations not be idempotent,
so calling build() more than once on a LineStringBuilder might change the
builder itself. This PR fixes this by replacing the instance variable by
a local `translated` flag that is only updated internally during the
building process and created again on any subsequent calls to build()
or buildGeometry().
2015-12-04 12:57:52 +01:00
Adrien Grand 3f86adddbf Remove MergeMappingException.
Failures to merge a mapping can either come as a MergeMappingException if they
come from Mapper.merge or as an IllegalArgumentException if they come from
FieldTypeLookup.checkCompatibility. I think we should settle on one: this pull
request replaces all usage of MergeMappingException with
IllegalArgumentException.
2015-12-04 12:56:26 +01:00
javanna fae494aa84 Java api: allow to specify ttl as a time value (either as a string or using TimeValue)
The ttl could be specified as a time value only via the REST layer. That is now possible via java api too, either as a string or as a proper TimeValue. The internal format in IndexRequest becomes now TimeValue, which will then still converted to a long before storing the document.

Closes #15047
2015-12-04 11:51:22 +01:00
Yannick Welsch fef043a5bf Persist currently started allocation IDs to index metadata
Closes #14964
2015-12-04 11:31:48 +01:00
Yannick Welsch 342665300b Add capabilities for serializing map-based cluster state diffs
- Supports ImmutableOpenIntMap besides java.util.Map and ImmutableOpenMap
- Map keys can be any value (not only String)
- Map values do not have to implement Diffable interface. In that case custom value serializer needs to be provided.
2015-12-04 11:24:22 +01:00
Simon Willnauer 536e7e1268 Remove ancient deprecated and alternative recovery settings
Several settings have been deprecated or are replaced with new settings after refactorings
in version 1.x. This commit removes the support for these settings.

The settings are:

 * `index.shard.recovery.translog_size`
 * `index.shard.recovery.translog_ops`
 * `index.shard.recovery.file_chunk_size`
 * `index.shard.recovery.concurrent_streams`
 * `index.shard.recovery.concurrent_small_file_streams`
 * `indices.recovery.max_size_per_sec`
2015-12-04 09:48:00 +01:00
Robert Muir 688935df1c fix broken plugin warning 2015-12-04 02:38:56 -05:00
Robert Muir c78c8bae08 improve logger output on startup 2015-12-04 02:23:34 -05:00
Robert Muir 699b140d69 update lists, rename stuff to be clearer, remove public method that is unused 2015-12-04 01:43:07 -05:00
Robert Muir 7160c5ec15 list modules separately in pluginservice 2015-12-04 01:13:17 -05:00
Robert Muir 763747df71 don't let pluginmanager install modules 2015-12-03 23:36:02 -05:00
Robert Muir 208b46d94b add leniency for tests 2015-12-03 23:25:57 -05:00
Ryan Ernst f2cebd9b3b Merge branch 'master' into jigsaw 2015-12-03 20:02:44 -08:00
Robert Muir 794264023a add module loading logic (untested) 2015-12-03 23:01:03 -05:00
Robert Muir da8fe687fc add modules/ infra (but no loading via pluginservice yet) 2015-12-03 22:34:24 -05:00
Ryan Ernst b50d94efab Merge pull request #15228 from rjernst/cli_error
Cli tools: Use toString instead of getMessage for exceptions
2015-12-03 19:01:33 -08:00
Ryan Ernst f78c732ca9 Cli tools: Use toString instead of getMessage for exceptions
When not in debug mode, we currently only print the message of an
exception. However, this is not usually useful without knowing what the
exception type was. This change makes cli tools use toString() on the
exception so we get the type + message.
2015-12-03 17:27:45 -08:00
Jason Tedor 6613b3a0d6 Merge pull request #15221 from jasontedor/avoid-trace-logging-allocations-in-transport-broadcast-by-node-action
Avoid trace logging allocations in TransportBroadcastByNodeAction
2015-12-03 17:17:01 -05:00
Lee Hinman f709b7283f Remove `GET` option for /_forcemerge
POST should be used to indicate this is not just a retrieval operation.

Resolves #15165
2015-12-03 13:56:15 -07:00
Jason Tedor de0e1f5e2f Avoid trace logging allocations in TransportBroadcastByNodeAction
This commit wraps the trace logging statements in
TransportBroadcastByNodeAction in trace enabled checks to avoid
unnecessarily allocating objects.

The most egregious offenders were the two trace logging statements in
BroadcastByNodeTransportRequestHandler#onShardOperation. Aside from the
usual object allocations that occur when invoking ESLogger#trace (the
allocated object array for the varargs Object... parameter), these two
logging statements were invoking ShardRouting#shortSummary generating a
bunch of char arrays and Strings (from the StringBuilder, and so a bunch
of array copies as well). In a scenario where there are a lot of shards
and this method is being invoked frequently (e.g., constantly hitting
the _stats endpoint), these two unprotected trace logging statements
were generating a lot of unnecessary allocations.
2015-12-03 14:38:16 -05:00
Jason Tedor b58d82f66c Remove obsolete flag in ShardStateAction$ShardRoutingEntry 2015-12-03 14:08:35 -05:00
Jason Tedor 928d53a884 Apply shard starts in a single batch 2015-12-03 14:04:10 -05:00
Jason Tedor 99eac0e7d7 Use general cluster state batching mechanism for shard started
This commit modifies the handling of shard started cluster state updates
to use the general cluster state batching mechanism. An advantage of
this approach is we now get correct per-listener notification on
failures.
2015-12-03 14:04:10 -05:00
Jason Tedor 182c22f23f Merge pull request #15016 from jasontedor/shard-failure-batch
Use general cluster state batching mechanism for shard failures
2015-12-03 14:02:48 -05:00
Jason Tedor b70d97f36b Remove unnecessary method in AllocationService 2015-12-03 13:42:05 -05:00
Jason Tedor 73a2d3085a Rename variable for clarity in ShardFailedClusterStateHandler#execute 2015-12-03 13:41:34 -05:00
Adrien Grand d2e07f21e0 Merge pull request #15217 from jpountz/fix/simplify_MetaDataMappingService
Simplify MetaDataMappingService.
2015-12-03 16:26:08 +01:00
Adrien Grand 3ff91baedf Simplify MetaDataMappingService.
Now that we create all types on indices that receive a mapping update, creation
of temporary indices could get simpler.
2015-12-03 16:06:51 +01:00
Jason Tedor d1fd1fb908 Remove unnecessary early-out in MetaDataMappingService#executeRefresh
This commit removes a simple early-out check in
MetaDataMappingService#executeRefresh. The early-out is unnecessary
because the cluster state task execution framework will not invoke
ClusterStateTaskExecutor#execute if the list of tasks is empty.
2015-12-03 09:05:19 -05:00
Jason Tedor 310e98f51d Update stale Javadoc in MetaDataMappingService#executeRefresh
This commit updates a stale Javadoc on
MetaDataMappingService#executeRefresh. Previously this method handled
refresh and update tasks. Update tasks have been removed and the method
was renamed, but the Javadoc was not updated to reflect this.
2015-12-03 09:05:19 -05:00
Martijn van Groningen d0fbd9d1c4 index template: Disallow index template pattern to be the same as an alias name
This can cause index creation to fail down the line.
2015-12-03 13:35:16 +01:00
Boaz Leskes c5301e853a reduced the number of shards in RecoveryWhileUnderLoadIT.testRecoveryWhileRelocating 2015-12-03 10:00:48 +01:00
Boaz Leskes 9930e6883d Move IndicesService.canDeleteShardContent to use IndexSettings
Just a minor cleanup/simplification

Closes #15059
Closes #15150
2015-12-03 09:55:07 +01:00
Adrien Grand 6ff82260a7 Merge pull request #15029 from jpountz/remove/onIndexService
Remove Plugin.onIndexService.
2015-12-03 09:46:30 +01:00
Adrien Grand 612ef4488e Add missing license header. 2015-12-03 09:41:06 +01:00
Adrien Grand 79ff2ddd20 Merge pull request #15202 from jpountz/fix/clear_empty_query_cache
Fix NPE when a segment with an empty cache gets closed.
2015-12-03 09:38:08 +01:00
Jason Tedor ab45d69b16 Remove unused import in o.e.c.l.Releasables 2015-12-02 16:29:04 -05:00
Adrien Grand 7d25623b1f Fix NPE when a segment with an empty cache gets closed.
This is due to the fact that the query cache will still call the
onDocIdSetEviction callback in this case but with a number of entries equal to
zero.

Close #15043
2015-12-02 21:59:20 +01:00
Areek Zillur 3d8c32008e [TEST] geo completions work with geo point fields 2015-12-02 13:01:33 -05:00
Jason Tedor 199a05311e Remove unchecked warnings rendered unnecessary 2015-12-02 10:55:25 -05:00
Jason Tedor 05430a788a Remove and forbid use of the type-unsafe empty Collections fields
This commit removes and now forbids all uses of the type-unsafe empty
Collections fields Collections#EMPTY_LIST, Collections#EMPTY_MAP, and
Collections#EMPTY_SET. The type-safe methods Collections#emptyList,
Collections#emptyMap, and Collections#emptySet should be used instead.
2015-12-02 10:41:59 -05:00
Adrien Grand 79188ed38d Treat mappings at an index-level feature.
Today we try to have type-level granularity when dealing with mappings. This
does not play well with the cross-type validations that we are adding. For
instance we prevent the `_parent` field to point to an existing type. This
validation would be skipped today in the case of dedicated master nodes, since
those master nodes would only create the type that is being updated when
updating a mapping.
2015-12-02 16:32:12 +01:00
Robert Muir b7f497627f Merge pull request #15172 from rmuir/nuke_unused_deps
remove unused core dependencies
2015-12-02 07:20:11 -05:00