Commit Graph

2727 Commits

Author SHA1 Message Date
Yannick Welsch 6b49d728ec Merge pull request #15476 from ywelsch/fix/script-service-tests
[TEST] Fix ScriptServiceTests.testFineGrainedSettings that can loop indefinitely
2015-12-16 18:05:55 +01:00
Yannick Welsch 88a0104687 [TEST] ScriptServiceTests only test single ScriptEngineService 2015-12-16 17:36:14 +01:00
Britta Weber db357f078a Merge pull request #15396 from brwe/java-api-for-synced-flush
Add java API for synced flush

closes #12812
2015-12-16 17:18:18 +01:00
javanna 99f9bd7cfe Throw exception when trying to write map with null keys
Closes #14346
2015-12-16 17:01:04 +01:00
Jason Tedor 89c960b00a Merge pull request #15428 from jasontedor/cluster-state-batch-logging
Explicitly log cluster state update failures
2015-12-16 10:55:14 -05:00
Jason Tedor 02354fc491 More useful assertions in o.e.c.s.InternalClusterService 2015-12-16 10:53:59 -05:00
Jason Tedor 89a09b9bed Master should wait on cluster state publication when failing a shard
When a client sends a request to fail a shard to the master, the current
behavior is that the master will submit the cluster state update task
and then immediately send a successful response back to the client;
additionally, if there are any failures while processing the cluster
state update task to fail the shard, then the client will never be
notified of these failures.

This commit modifies the master behavior when handling requests to fail
a shard. In particular, the master will now wait until successful
publication of the cluster state update before notifying the request
client that the shard is marked as failed; additionally, the client is
now notified of any failures during the execution of the cluster state
update task.

Relates #14252
2015-12-16 10:37:51 -05:00
Jason Tedor 44467df353 Merge pull request #15456 from jasontedor/reorganize-shard-state-action
Reorganize o/e/c/a/s/ShardStateAction.java
2015-12-16 07:37:10 -05:00
Simon Willnauer e83c728265 Merge pull request #15475 from s1monw/beef_up_translog_tests
Beef up TranslogTests with concurrent fatal exceptions test
2015-12-16 12:43:56 +01:00
Simon Willnauer e5dc124811 apply review from @bleskes 2015-12-16 12:27:07 +01:00
Jason Tedor e084e50edb Merge pull request #15461 from jasontedor/cleanup-routing-nodes
Cleanup o/e/c/r/RoutingNodes.java
2015-12-16 06:21:01 -05:00
Yannick Welsch 20dc855644 [TEST] Fix ScriptServiceTests.testFineGrainedSettings that can loop indefinitely 2015-12-16 11:27:45 +01:00
Britta Weber 7a469538bc serialize os name, arch and version too
These three properties are build in the jason response but were not
transported when a node sends the response.

closes #15422
2015-12-16 11:24:11 +01:00
Simon Willnauer 34703a838d Beef up TranslogTests with concurrent fatal exceptions test
Today we only test this when writing sequentially. Yet, in practice we mainly
write concurrently, this commit adds a test that tests that concurrent writes with
sudden fatal failure will not corrupt our translog.

Relates to #15420
2015-12-16 10:25:10 +01:00
Martijn van Groningen 082632dcac aggs: fixed bug in children agg that prevented all child docs from being evaluated
Before we only evaluated segments that yielded matches in parent aggs, which caused us to miss to evaluate child docs in segments we didn't have parent matches for.

The fix for this is stop remember in what segments we have matches for and simply evaluate all segments. This makes the code simpler and we can still quickly see if a segment doesn't hold child docs like we did before.
2015-12-16 10:16:18 +01:00
Jason Tedor 36bd845090 Reorganize o/e/c/a/s/ShardStateAction.java
This commit is a trivial reorganization of
o/e/c/a/s/ShardStateAction.java. The primary motive is have all of the
shard failure handling grouped together, and all of the shard started
handling grouped together.
2015-12-15 22:40:31 -05:00
Jason Tedor d24c83b690 Cleanup o/e/c/r/RoutingNodes.java
This commit applies a few trivial cleanups to o/e/c/r/RoutingNodes.java.
2015-12-15 17:43:38 -05:00
soinlv 015ead0c45 Remove unused import
Closes #15458
2015-12-15 16:31:58 -05:00
Adrien Grand 82a64fd2f8 Fix SearchWhileRelocatingIT so that the type of the mapping matches the type of documents. 2015-12-15 17:22:04 +01:00
Boaz Leskes 6a7fc8fb32 IndexService: format and remove unneeded import 2015-12-15 17:10:32 +01:00
Boaz Leskes 07044e02b9 IndexService: remove unneed inject annotation from 2015-12-15 15:25:17 +01:00
Adrien Grand c7bcb32ae6 Merge pull request #15442 from jpountz/remove/back_compat_path
Remove back compat for the `path` option.
2015-12-15 15:04:04 +01:00
Adrien Grand d94bba2d9c Remove back compat for the `path` option.
The `path` option allowed to index/store a field `a.b.c` under just `c` when
set to `just_name`. This "feature" has been removed in 2.0 in favor of `copy_to`
so we can remove the back compat in 3.x.
2015-12-15 14:55:23 +01:00
Jim Ferenczi 715528a567 Merge pull request #15393 from jimferenczi/terms_agg_getKeyAsString
getKeyAsString and key_as_string should be the same for terms aggregation.
2015-12-15 12:11:23 +01:00
Jim Ferenczi 76713611e9 Format the term with the formatter in LongTerms.Bucket.getKeyAsString in order to be consistent
with the json response field `key_as_string` of the terms aggregation.
2015-12-15 12:10:06 +01:00
Adrien Grand c40099d4ef Merge pull request #15243 from jpountz/fix/field_uniqueness
Validate that fields are defined only once.
2015-12-15 10:38:47 +01:00
Adrien Grand 5d5c6591aa Validate that fields are defined only once.
There are two ways that a field can be defined twice:
 - by reusing the name of a meta mapper in the root object (`_id`, `_routing`,
   etc.)
 - by defining a sub-field both explicitly in the mapping and through the code
   in a field mapper (like ExternalMapper does)

This commit adds new checks in order to make sure this never happens.

Close #15057
2015-12-15 10:37:18 +01:00
Adrien Grand 7473905620 Merge pull request #15313 from jpountz/fix/immutable_mappings
Make mappings immutable.
2015-12-15 10:23:34 +01:00
Adrien Grand 50eeafa75c Make mappings immutable.
Today mappings are mutable because of two APIs:
 - Mapper.merge, which expects changes to be performed in-place
 - IncludeInAll, which allows to change whether values should be put in the
   `_all` field in place.

This commit changes both APIs to return a modified copy instead of modifying in
place so that mappings can be immutable. For now, only the type-level object is
immutable, but in the future we can imagine making them immutable at the
index-level so that mapping updates could be completely atomic at the index
level.

Close #9365
2015-12-15 10:20:28 +01:00
Martijn van Groningen ec908ddfd6 Use transport service to handle RetryOnReplicaException and execute replica action on the current node.
Transport service will delegate to threadpool internally.
2015-12-15 09:32:58 +01:00
Jason Tedor 2e721a0328 Fix IntelliJ query builder type inference issues
This commit addresses two type inference issues that the IntelliJ source
editor struggles with when registering query builder prototypes in
o/e/i/q/IndicesQueriesRegistry.java and
o/e/i/q/f/ScoreFunctionParserMapper.java.
2015-12-14 18:54:35 -05:00
Jason Tedor d64baf0f30 Explicitly log cluster state update failures
This commit adds explicit logging at the DEBUG level for cluster state
update failures. Currently this responsibility is left to the cluster
state task listener, but we should expliclty log these with a generic
message to address cases where the listener might not.

Relates #14899, relates #15016, relates #15023
2015-12-14 17:20:22 -05:00
Jason Tedor 1f0c23a21d Merge pull request #14950 from jasontedor/trace-log-shard-not-available-exceptions
Only trace log shard not available exceptions
2015-12-14 16:20:47 -05:00
Jason Tedor 6b39ff6081 Only trace log shard not available exceptions
This commit changes the behavior of the logging in
TransportBroadcastByNodeAction#onNodeFailure to only trace log
exceptions that are considered shard-not-available exceptions. This
makes the logging consistent with how these exceptions are handled in
the response.

Relates #14927
2015-12-14 16:20:13 -05:00
Costin Leau 7bca97bba6 HDFS Snapshot/Restore plugin
Migrated from ES-Hadoop. Contains several improvements regarding:

* Security
Takes advantage of the pluggable security in ES 2.2 and uses that in order
to grant the necessary permissions to the Hadoop libs. It relies on a
dedicated DomainCombiner to grant permissions only when needed only to the
libraries installed in the plugin folder
Add security checks for SpecialPermission/scripting and provides out of
the box permissions for the latest Hadoop 1.x (1.2.1) and 2.x (2.7.1)

* Testing
Uses a customized Local FS to perform actual integration testing of the
Hadoop stack (and thus to make sure the proper permissions and ACC blocks
are in place) however without requiring extra permissions for testing.
If needed, a MiniDFS cluster is provided (though it requires extra
permissions to bind ports)
Provides a RestIT test

* Build system
Picks the build system used in ES (still Gradle)
2015-12-14 21:50:09 +02:00
Christoph Büscher c7a001dcb4 Merge pull request #15376 from cbuescher/highlight-refactoring-searchSource
Use HighlightBuilder in SearchSourceBuilder
2015-12-14 20:35:07 +01:00
Simon Willnauer bc8745dcc2 Merge pull request #15420 from s1monw/fail_translog_on_tragic_event
Fail and close translog hard if writing to disk fails
2015-12-14 18:30:04 +01:00
Simon Willnauer 943915e05a simplify code and use members directly 2015-12-14 18:06:49 +01:00
Christoph Büscher 59bd21f24f Adding test for Order enum ordinals 2015-12-14 17:29:25 +01:00
Christoph Büscher 6f16317a4b Switch internal representation of order to enum 2015-12-14 16:56:39 +01:00
Simon Willnauer b0144c557c apply feedback from @mikemccand 2015-12-14 16:09:20 +01:00
Christoph Büscher 659bab7105 Use HighlightBuilder in SearchSourceBuilder
After HighlightBuilder implements Writable now, we can remove
the temporary solution for transporting the highlight section in
SearchSourceBuilder from the coordinating node to the shard as
BytesReference and use HighlightBuilder instead.
2015-12-14 15:20:49 +01:00
Christoph Büscher 2ab937d64d Joint parsing of common global Hightlighter and subfield parameters
The top-level highlighter has many options that can be overwritten per
field. Currently there is very similar code for this in two places.
This PR pulls out the parsing of the common parameters into
AbstractHighlighterBuilder for better reuse and to keep parsing of
common parameters more consistent.
2015-12-14 15:09:00 +01:00
Simon Willnauer 6cefdc82f6 Expose tragic event to translog, close translog once we hit a tragic even and fail engine if we hit one too 2015-12-14 15:01:55 +01:00
Simon Willnauer c6003b6f13 apply feedback from @bleskes 2015-12-14 14:36:20 +01:00
Simon Willnauer 2d03a6b808 Fail and close translog hard if writing to disk fails
Today we are super lenient (how could I missed that for f**k sake) with failing
/ closing the translog writer when we hit an exception. It's actually worse, we allow
to further write to it and don't care what has been already written to disk and what hasn't.
We keep the buffer in memory and try to write it again on the next operation.

When we hit a disk-full expcetion due to for instance a big merge we are likely adding document to the
translog but fail to write them to disk. Once the merge failed and freed up it's diskspace (note this is
a small window when concurrently indexing and failing the shard due to out of space exceptions) we will
allow in-flight operations to add to the translog and then once we fail the shard fsync it. These operations
are written to disk and fsynced which is fine but the previous buffer flush might have written some bytes
to disk which are not corrupting the translog. That wouldn't be an issue if we prevented the fsync.

Closes #15333
2015-12-14 13:16:17 +01:00
Christoph Büscher f520f8bfb9 Tests: Add test for parsing "_name" field in RangeQueryParser 2015-12-14 10:07:35 +01:00
Jason Tedor 2602439a51 Delegate to j.u.c.ThreadLocalRandom for Random instances 2015-12-12 17:51:46 -05:00
Ryan Ernst a0c69fe7f9 Remove forbidden suppressions for InetSocketAddress 2015-12-11 18:20:09 -08:00
Ryan Ernst 7cbb955d19 Move forbidden suppression for InetSocketAddress to its own method 2015-12-11 18:08:39 -08:00