Commit Graph

6625 Commits

Author SHA1 Message Date
javanna c914134355 Scripting: remove groovy sandbox
Groovy sandboxing was disabled by default from 1.4.3 on though since we found out that it could be worked around, so it makes little sense to keep it and maintain it.

Closes #10156
Closes #10480
2015-04-28 11:27:50 +02:00
javanna 371bc5a6b3 Java api: implement toString in CountRequestBuilder
Similarly to what SearchRequestBuilder does, we print out a string representation of the query that the count request builder holds.

Closes #5555
2015-04-28 11:22:15 +02:00
javanna 78608536e2 Java api: SearchRequestBuilder#toString to print out the query without wiping the request source
Best effort to print out the search source depending on how it was set to the SearchRequestBuilder, don't call `internalBuilder() as that causes the content of the request to be wiped.

Closes #5576
2015-04-28 11:22:15 +02:00
Robert Muir 10f2e0e2ba Merge pull request #10844 from rmuir/sm_cleanup
Security manager cleanups
2015-04-28 05:12:07 -04:00
Tanguy Leroux 8b0674c18d Tests: Add backward compatibility test for cluster state with blocks 2015-04-28 10:50:53 +02:00
Jun Ohtani 933edf7bcc Analysis: Fix wrong position number by analyze API
Add breaking chages comment to migrate docs
Fix the stopword included text using stopword filter
2015-04-28 17:44:41 +09:00
Tanguy Leroux 2ce0ea15b0 Internal: Remove deprecated METADATA cluster block level
This commit removes the deprecated ClusterBlockLevel.METADATA, replaced in #9203 with METADATA_READ and METADATA_WRITE.
2015-04-28 10:25:06 +02:00
Isabel Drost-Fromm 180403fc32 Fix JSON encoding for Mustache templates.
This pull request replaces the current self-made implementation of JSON encoding special chars with re-using the Jackson JsonStringEncoder. Turns out the previous implementation also missed a few special chars so had to adjust the tests accordingly (looked at RFC 4627 for reference).

Note: There's another JSON String encoder on our classpath (org.apache.commons.lang3.StringEscapeUtils) that essentially does the same thing but adds quoting to more characters than the Jackson Encoder above.

Relates to #5473
2015-04-28 10:11:45 +02:00
Ryan Ernst 5812753dbc Backcompat: Add test for missing filter
The _field_names field was fixed in 1.5.1 (#10268) to correctly be
disabled for indexes before 1.3.0.  However, only the exists filter
was updated to check this enabled flag on 1.x/1.5. The missing
filter on those branches still checks the field type to see if it
is indexed, which causes the filter to always try and use
the _field_names field for those old indexes.

This change adds a test to the old index tests for missing filter.

closes #10842
2015-04-28 01:08:12 -07:00
Robert Muir f599c237bd Security manager cleanups
1. initialize SM after things like mlockall. Their tests currently
   don't run with securitymanager enabled, and its simpler to just
   run mlockall etc first.
2. remove redundant test permissions (junit4.childvm.cwd/temp). This
   is alreay added as java.io.tmpdir.
3. improve tests to load the generated policy with some various
   settings and assert things about the permissions on configured
   directories.
4. refactor logic to make it easier to fine-grain the permissions later.
   for example we currently allow write access to conf/. In the future
   I think we can improve testing so we are able to make improvements here.
2015-04-27 20:29:57 -04:00
Lee Hinman 240bcc3f08 Don't create a new BigArrays instance for every call of `withCircuitBreaking`
Since the circuit breaking service doesn't actually change for
BigArrays, we can eagerly create a new instance only once and use that
for all further invocations of `withCircuitBreaking`.
2015-04-27 12:47:56 -06:00
Simon Willnauer d164526d27 Remove `_shutdown` API
Thsi commit removes the `_shutdown` API entirely without any replacement.
Nodes should be managed from the operating system not via REST APIs
2015-04-27 17:19:36 +02:00
Adrien Grand 2f777e4736 Release: Add bw indices for 1.4.5 and 1.5.2. 2015-04-27 13:56:02 +02:00
Alexander Reelsen 467b4f6e2d Versioning: Added recent 1.4 and 1.5 releases 2015-04-27 12:57:47 +02:00
markharwood 1b8b993912 Query enhancement: Enable Lucene ranking behaviour for queries on numeric fields.
This changes the default ranking behaviour of single-term queries on numeric fields to use the usual Lucene TermQuery scoring logic rather than a constant-scoring wrapper.

Closes #10628
2015-04-27 09:42:55 +01:00
Adrien Grand d7d39e1938 Reduce code duplication in TransportIndexAction/TransportShardBulkAction.
We have some duplication in TransportIndexAction/TransportShardBulkAction due
to the fact that we have totally different branches for INDEX and CREATE
operations. This commit tries to share the logic better between these two cases.
2015-04-27 10:23:11 +02:00
Adrien Grand 8d30c9a392 Tests: Mark the entire RiverTests suite as AwaitsFix. 2015-04-27 09:27:17 +02:00
Simon Willnauer 061a010453 Revert "Add support for cluster state diffs"
This reverts commit d746e14cf3.
2015-04-27 09:07:02 +02:00
Alexander Reelsen 5d8e9e24c9 HTTP: Ensure url path expansion only works inside of plugins
This prevents reading of files that are not part of the plugin
directory by specifically crafted paths.
2015-04-27 07:47:14 +02:00
Jun Ohtani 9745808c3f Settings: validate number_of_shards/number_of_replicas without index setting prefix
Move the validation logic to MetaDataCreateIndexService
Add ShardClusterSnapshotRestoreTests
Add the validation to RestoreService

Closes #10693
2015-04-27 12:34:32 +09:00
Igor Motov d746e14cf3 Add support for cluster state diffs
Adds support for calculating and sending diffs instead of full cluster state of the most frequently changing elements - cluster state, meta data and routing table.

Closes #6295
2015-04-26 22:36:39 -04:00
Alexander Reelsen 91e2bb193c TransportClient: Ensure netty I/O thread is not blocked
Whenever a transport client executes a request, it uses a built-in
RetryListener which tries to execute the request on another node.

However, if a connection error occurs, the onFailure() callback of
the listener is triggered, the netty I/O thread might still be used
to whatever failure has been added.

This commit offloads the onFailure handling to the generic thread pool.
2015-04-26 21:31:36 +02:00
Simon Willnauer fe331b57b7 [TEST] Don't use extraFS files as legacy files in tests 2015-04-26 21:08:57 +02:00
Simon Willnauer 2c510f0689 Allow double-closing of FSTranslog
the translog might be reused across engines which is currently a problem
in the design such that we have to allow calls to `close` more than once.
This moves the closed check for snapshot on the actual file to exit the loop.

Relates to #10807
2015-04-26 15:13:06 +02:00
Simon Willnauer f87fb95830 [TEST] fail if exception is not thrown 2015-04-26 14:26:22 +02:00
Simon Willnauer 2373c2b43c [TRANSLOG] Fail #snapshot if translog is closed
If the translog is closed while a snapshot opertion is in progress
we must fail the snapshot operation otherwise we end up in an endless
loop.

Closes #10807
2015-04-26 14:03:50 +02:00
Simon Willnauer 768e1c2012 [TEST] Fix test to take care of refresh failures after successful commit 2015-04-26 13:44:29 +02:00
Tanguy Leroux f7d4baacfb Remove working directory
This commit removes the working directory and its associated environment variable "WORK_DIR"
2015-04-25 13:08:36 +02:00
Ryan Ernst 1db380cf49 Merge pull request #10798 from mfussenegger/bigarrays
Internal: Change BigArrays to not extend AbstractComponent

In order to avoid the getLogger(getClass()) calls in the
AbstractComponent constructor.

Seems like BigArrays used to be a Singleton but it actually
no longer is one. Every time a SearchContext is created a
new BigArrays instance is created via the
withCircuitBreaking call.

closes #10798
2015-04-24 15:07:16 -07:00
Mathias Fussenegger 9f20c1c642 change BigArrays to not extend AbstractComponent
In order to avoid the ``getLogger(getClass())`` calls in the
AbstractComponent constructor.

Seems like BigArrays used to be a Singleton but it actually
no longer is one. Every time a SearchContext is created a
new BigArrays instance is created via the
``withCircuitBreaking`` call.
2015-04-24 22:34:32 +02:00
Adrien Grand 46ac32ad4a Merge pull request #10786 from jpountz/fix/dynamic_mappings_on_replicas
Internal: Wait for required mappings to be available on the replica before indexing.
2015-04-24 22:20:50 +02:00
Adrien Grand 3e5b8a21b4 Internal: Wait for required mappings to be available on the replica before indexing.
Due to timing issues, mappings that are required to index a document might not
be available on the replica at indexing time. In that case the replica starts
listening to cluster state changes and re-parses the document until no dynamic
mappings updates are generated.
2015-04-24 22:00:06 +02:00
Ryan Ernst f27f5aaa22 Upgrade to lucene-5.2-snapshot-1675927 2015-04-24 12:38:32 -07:00
Boaz Leskes 389ce39919 CommitStats doesn't need to allow for null values in commit user data
Lucene forbids writing those and MapBuilder.immutableMap doesn't like them either, as discovered by @brwe

Closes #10774
2015-04-24 20:57:09 +02:00
Ryan Ernst 4d672b0369 Mappings: Join MergeResults with MergeContext since they are almost the same
MergeContext currently exists to store conflicts, and providing
a mechanism to add dynamic fields. MergeResults store the same
conflicts. This change merges the two classes together, as well
as removes the MergeFlags construct.

This is in preparation for simplifying the callback structures
to dynamically add fields, which will require storing the mapping
updates in the results, instead of having a sneaky callback to
the DocumentMapper instance. It also just makes more sense that
the "results" of a merge are conflicts that occurred, along with
updates that may have occurred. For MergeFlags, any future needs
for parameterizing the merge (which seems unlikely) can just be
added directly to the MergeResults as simlulate is with this change.
2015-04-24 08:19:46 -07:00
Robert Muir a3d03fdeb8 style changes to Bootstrap 2015-04-24 10:09:30 -04:00
Robert Muir fca05edbd4 add constant only used once to make it harder to read the code 2015-04-24 09:51:01 -04:00
Robert Muir 2d778df4b4 Merge branch 'master' into put_me_in_coach 2015-04-24 09:45:19 -04:00
Shay Banon 209b8cf952 TEST: assert we can create an instance of request 2015-04-24 15:04:25 +02:00
Shay Banon 8dbb79c96a refactor and cleanup transport request handling
This refactoring and cleanup is that each request handler ends up
implementing too many methods that can be provided when the request handler itself
is registered, including a prototype like class that can be used to instantiate
new request instances for streaming.
closes #10730
2015-04-24 14:11:43 +02:00
Simon Willnauer cb615ffecf [TEST] Don't use pretty print in tests Windowns has slight differences 2015-04-24 13:18:35 +02:00
Simon Willnauer c25ca1ebfb [CORE] Simplify IndexStore and friends
Today we have a lot of bloat in the IndexStore and related classes. THe IndexStore interface
is unneeded as we always subclass AbstractIndexStore and it hides circular dependencies
that are problematic when added. Guice proxies them if you have an interface which is bad in
general. This commit removes most of the bloat classes and unifies all the classes we have
into a single one since they all just structural and don't encode any functionality.
2015-04-24 13:10:36 +02:00
Boaz Leskes 5bdfdc42d9 Refactor TransportShardReplicationOperationAction
Refactor TransportShardReplicationOperationAction state management into clear separate Primary phase and Replication phase. The primary phase is responsible for routing the request to the node holding the primary, validating it and performing the operation on the primary. The Replication phase is responsible for sending the request to the replicas and managing their responses.

This also adds unit test infrastructure for this class, and some basic tests. We can extend later as we continue developing.

Closes #10749
2015-04-24 12:39:35 +02:00
Martijn van Groningen b444d2c31a Test: wait for green 2015-04-24 12:06:18 +02:00
Simon Willnauer 3ff0b21c21 Remove dead code 2015-04-24 10:37:55 +02:00
Simon Willnauer 84549f334d [TEST] use toString rather than getDetailedMessage() 2015-04-24 10:09:24 +02:00
Martijn van Groningen dd4a22bfed bulk: Fields defined in the `_default_` mapping of an index template should be picked up when an index alias filter is parsed if a new index is introduced when a document is indexed into an index that doesn't exist yet via the bulk api.
Closes #10609
2015-04-24 09:43:16 +02:00
Simon Willnauer 15d58d91f1 [REST] Render REST errors in a structural way
This commit adds support for structural errors / failures / exceptions
on the elasticsearch REST layer. Exceptions are rendering with at least
a `type` and a `reason` corresponding to the exception name and the message.
Some expcetions like the ones associated with an index or a shard will have
additional information about the index the exception was triggered on or the
shard respectivly.

Each rendered response will also contain a list of root causes which is a list
of distinct shard level errors returned for the request. Root causes are the lowest
level elasticsearch exception found per shard response and are intended to be displayed
to the user to indicate the soruce of the exception.

Shard level response are by-default grouped by their type and reason to reduce the amount
of duplicates retunred. Yet, the same exception retunred from different indices will not be
grouped.

Closes #3303
2015-04-24 09:36:10 +02:00
Boaz Leskes c9d72431a3 Test: add afterIfFailed & afterIfSuccessful to ElasticsearchTestCase
Also use afterIfFailed to log more info from the rest tests
2015-04-24 09:10:23 +02:00
Ryan Ernst 1f5bdca8cc Mappings: Restrict murmur3 field type to sane options
Disabling doc values or trying to index hash values are not
correct uses of this the murmur3 field type, and just cause
problems.  This disallows changing doc values or index options
for 2.0+.

closes #10465
2015-04-23 21:48:42 -07:00