Commit Graph

7525 Commits

Author SHA1 Message Date
Lee Hinman f1f3aa3ac7 [TEST] skip explain reroute REST test until param substitution is implemented 2014-02-28 10:39:07 -07:00
Costin Leau e5e8e592d8 make test assertions relative in IsolatedPluginTests
relates to #5621
2014-02-28 19:11:53 +02:00
Clinton Gormley 53ce0e8e27 [DOCS] Fixed added[] tag version number 2014-02-28 15:29:43 +01:00
Costin Leau 95fa42b701 fix failing IsolatedPluginTests (change numNodes to 0)
(cherry picked from commit f26a369a78ade032df44fcf331f378644f74b9ea)
2014-02-28 16:21:11 +02:00
Zachary Tong 0b6c404c51 [TEST] Dynamically extract node ID for test 2014-02-28 08:41:01 -05:00
Zachary Tong 4fe69528d2 [TEST] Add version and master_node parameter to _cluster/state 2014-02-28 08:27:17 -05:00
Costin Leau a19b77484e Add plugin class space isolation
Each plugin is now loaded in its own classloader to prevent class
conflicts when loading different versions of the same library. It
 is enabled by default and is configurable through
 `plugins.isolation` settings .Additionally, each plugin can
change its own isolation through the `isolation` property in
`es-plugin.properties`- if not specified, the global setting in
ES applies.

Closes #5261
2014-02-28 15:05:20 +02:00
javanna 91f5be6816 [TEST] more assertAcked in SharedClusterShapshotRestoreTests 2014-02-28 12:54:10 +01:00
Martijn van Groningen 03f6f523b0 Added more trace and debug logging 2014-02-28 11:19:18 +01:00
Simon Willnauer a1f66daea9 Move ensureEstimatedStats() after index wiping to ensure everything is cleaned up once the index is removed 2014-02-27 23:11:43 +01:00
Adrien Grand a9592e5523 Add assertion to not forget to replace reflection with the new FilterAtomicReader.unwrap. 2014-02-27 22:41:40 +01:00
Adrien Grand f5306ef8c1 Update Eclipse configuration to Java 1.7. 2014-02-27 22:41:40 +01:00
Simon Willnauer 86bfa6ecdc Improve error reporting on breaker stats assertion 2014-02-27 22:39:39 +01:00
Lee Hinman 550c407994 Remove trace logging from testBreakerWithRandomExceptions() 2014-02-27 13:24:11 -07:00
Lee Hinman e53a43800e Add `explain` flag support to the reroute API
By specifying the `explain` flag, an explanation for the reason a
command can or cannot be executed is returned. No allocation commands
are actually performed.

Returns a response similar to:

{
  "state": {...cluster state...},
  "acknowledged": true,
  "explanations" : [ {
    "command" : "cancel",
      "parameters" : {
        "index" : "decide",
        "shard" : 0,
        "node" : "IvpoKRdtRiGrQ_WKtt4_4w",
        "allow_primary" : false
      },
      "decisions" : [ {
        "decider" : "cancel_allocation_command",
        "decision" : "YES",
        "explanation" : "..."
        } ]
     }, {
      "command" : "move",
      "parameters" : {
        "index" : "decide",
        "shard" : 0,
        "from_node" : "IvpoKRdtRiGrQ_WKtt4_4w",
        "to_node" : "IvpoKRdtRiGrQ_WKtt4_4w"
       },
       "decisions" : [ {
         "decider" : "same_shard",
         "decision" : "NO",
         "explanation" : "shard cannot be allocated on same node [IvpoKRdtRiGrQ_WKtt4_4w] it already exists on"
       },
       etc
       ]
  }]
}

also removes AllocationExplanation from cluster state

Closes #2483
Closes #5169
2014-02-27 09:48:51 -07:00
Simon Willnauer 8ceb98752d Move master to Java 1.7
Closes #5267
2014-02-27 15:12:02 +01:00
Simon Willnauer fe9de7fba2 Use FieldMapper to create the low level term queries in CommonTermQuery
Closes #5258
2014-02-27 14:50:42 +01:00
Adrien Grand 3839454168 Add tracking of allocated arrays.
The BigArrays utility class is useful to generate arrays of various sizes: when
small, arrays will be allocated directly on the heap while larger arrays are
going to be paged and to recycle pages through PageCacheRecycler. We already
have tracking for pages but this is not triggered very often since it only
happens on large amounts of data while our tests work on small amounts of data
in order to be fast.

Tracking arrays directly helps make sure that we never forget to release them.

This pull request also improves testing by:

 - putting random content in the arrays upon release: this makes sure that
   consumers don't use these arrays anymore when they are released as their
   content may be subject to use for another purpose since pages are recycled

 - putting random content in the arrays upon creation and resize when
   `clearOnResize` is `false`.

The major difference with `master` is that the `BigArrays` class is now
instanciable, injected via Guice and usually available through the
`SearchContext`. This way, it can be mocked for tests.
2014-02-27 14:01:12 +01:00
Martijn van Groningen d167a0139a estimator#afterLoad should be invoked once only per reader.
It was being invoked once per reader and parent type combination resulting in more memory being reported to the circuit breaker than actually being used in field data.
2014-02-27 13:26:54 +01:00
Simon Willnauer aacc169007 Add RamUsageEstimator assertion to ElasticsearchIntegrationTest 2014-02-27 11:28:27 +01:00
Lee Hinman 9052838656 Enable trace logging for RandomExceptionCircuitBreakerTests.testBreakerWithRandomExceptions 2014-02-26 15:53:53 -07:00
Bill Hwang 7a48d079d3 Moved es download master url from JDK7 to JDK6 2014-02-26 14:18:44 -08:00
Adrien Grand e1634f66bb Improve `arc` geo-distance accuracy.
Close #5192
2014-02-26 22:21:10 +01:00
Simon Willnauer 9160516b28 Expose `filler_token` via ShingleTokenFilterFactory
Lucene 4.7 supports a setter for the `filler_token` that is
inserted if there are gaps in the token stream. This change exposes
this setting.

Closes #4307
2014-02-26 22:21:10 +01:00
Simon Willnauer 30d7b8de2f Upgrade to Lucene 4.7
Closes #5104
Closes #5129
Closes #3757
2014-02-26 22:21:10 +01:00
Martijn van Groningen 1441fec068 [DOCS] Updated memory considerations for p/c queries and filters. 2014-02-26 22:16:51 +01:00
Martijn van Groningen f488dce18f Moved AbstractHash, BytesRefHash and LongHash to o.e.common.util 2014-02-26 20:33:59 +01:00
Martijn van Groningen 53d5933c15 Added missing licence header. 2014-02-26 20:16:14 +01:00
Martijn van Groningen 0e780b7e99 Migrated p/c queries from id cache to field data. Changed p/c queries to use paging data structures (BytesRefHash, BigFloatArray, BigIntArray) instead of hppc maps / sets.
Also removed the id cache.

Closes #4930
2014-02-26 19:46:05 +01:00
Lee Hinman 5429019920 refactor SimpleQueryParser settings into separate class, add "lenient" option
Fixes #5011
2014-02-26 10:40:34 -07:00
Simon Willnauer 90e57c15e8 [DOCS]: fixed small problem in example json 2014-02-26 16:40:04 +01:00
javanna c2bb3981ba [TEST] removed REST test that checks for delete by query shard failures
The clients return an exception in case of failure and not the whole json response containing failures, thus this tests can only work with the Java REST tests runner
2014-02-26 14:11:40 +01:00
javanna e967400522 Expose delete by query shard failures follow-up
- Removed if conditions on index name and shard_id
- Added REST test
2014-02-26 13:14:52 +01:00
Kevin 850b9d4aab Add failures reason to delete by query response
Closes #5093
2014-02-26 13:14:52 +01:00
Dawid Weiss bdced9c772 Class name typo. 2014-02-26 09:54:55 +01:00
Dawid Weiss d25c14a9e9 Minor cleanups. 2014-02-26 09:52:53 +01:00
Luca Cavanna c58c9cd352 Refactored TransportIndexReplicationOperationAction to be able to expose the shard id related to a shard failure
The `ShardOperationFailedException` is now created within `TransportIndexReplicationAction` passing in the current shard id as a constructor argument.
Also replaced `AtomicReferenceArray<Object>` with `AtomicReferenceArray<ShardActionResult>`, where `ShardActionResult` wraps the `ShardResponse` or the failure, containing all the needed info.
2014-02-25 17:29:12 +01:00
Dawid Weiss ad547eb7fb Remove nanoTime in global cluster randomization in favor of deriving the
seed from the main master seed. Removed shared cluster's seed entirely.

The problem here is that if you don't give cluster's seed then test times
fluctuate oddly, even for a fixed -Dtests.seed=... This shouldn't be the
case -- ideally, the test ran with the same master seed should reproduce
pretty much with the same execution time (and internal logic, obviously).

From the code point of view "global" variables are indeed a problem
because JUnit has no notion of before-suite hooks. And RandomizedRunner
doesn't support context accesses in static class initializers (this is
intentional because there is no way to determine when such initializers
will be executed). A workaround is to move such static global variables to
lazily-initialized methods and invoke them (once) in @BeforeClass hooks.
2014-02-25 16:51:55 +01:00
Shay Banon 83ae1bd55e remove thread local recycler
the thread local recycler requires obtain and recycle to be called on the same thread, while other recyclers do not. Also, it can create heavy recycle usage since it depends on the threads that its being used on. The concurrent / pinned thread base one is by far better than the pure thread local (and is the default) one since it more easily bounds the elements recycled, while still allowing to mix obtain and recycle across threads.

We will end up using the paged recyclers more and more, for example, in our networking output buffer, where obtaining will happen on one thread, while recycling can potentially occur on another thread (the callback thread). Since the limit of binding to a thread of the 2 calls is not really needed, and our best implementation supports going cross threads, there is no real need to impose this restriction.
2014-02-25 14:59:41 +01:00
Simon Willnauer 46fe348b8b Add coming 0.90.12 version to the constants 2014-02-25 10:35:01 +01:00
Simon Willnauer 4a48b93cf5 Implement BlendedTermQuery#extractTerms to support highlighing.
some of the highlighters require term extraction to be implemented in
order to work. BlendedTermQuery doesn't implement the trivial extraction.

Closes #5246
2014-02-25 10:13:08 +01:00
Holger Hoffstätte bac09e2926 Recycler: better lifecycle control for pooled instances (#5214)
- introduce additional destroy() callback that allows better control
over internals of recycled data
- introduced AbstractRecyclerC as superclass for Recycler factories
(Adrien) with empty destroy() by default
- added tests for destroy()
- cleaned up Recycler tests (reduce copy&paste)
2014-02-25 08:49:13 +01:00
javanna 16e350b266 Made SearchContextHighlight.Field class immutable to prevent from erroneously updating it, as it doesn't necessarily map to a single field
A Field instance can map to multiple actual fields when using wildcard expressions. Each actual field should use the proper highlighter depending on the available data structure (e.g. term_vectors), while we currently select the highlighter for the first field and we keep using the same for all the fields that match the wildcard expression.

Modified also how the PercolateContext sets the forceSource option, in a global manner now rather than per field.

Closes #5175
2014-02-25 00:17:01 +01:00
Simon Willnauer 92f132aede Need use ensureYellow() b/c get mapping request checks on actual shard instead of master node 2014-02-24 20:58:44 +01:00
Martijn van Groningen 8c3fa0551f Need use ensureYellow() b/c get mapping request checks the mapping on the master node 2014-02-24 17:49:45 +01:00
Martijn van Groningen 7064056d13 Added TransportGetFieldMappingsIndexAction that uses TransportSingleCustomOperationAction as base class, with the goal to reuse common logic (like: retry on failures, shard picking, connecting to nodes) 2014-02-24 15:54:24 +01:00
Martijn van Groningen d63ab4bd05 [TEST] Added get field mapping test variant that tests with a cluster that has a master only node. 2014-02-24 14:49:22 +01:00
Boaz Leskes 3e10810a8e Change GetFieldMapping API to broadcast requests to nodes hosting the relevant indices.
This is due to the fact that have to have mappers in order to return the response.

Closes #5177
2014-02-24 14:49:22 +01:00
David Pilato ad8a482d19 NPE in PluginsService when starting elasticsearch with a wrong user
When starting elasticsearch with a wrong linux user, it could generate a `NullPointerException` when `PluginsService` tries to list available plugins in `./plugins` dir.

To reproduce:

* create a plugins directory with `rwx` rights for root user only
* launch elasticsearch from another account (elasticsearch for example)

It was supposed to be fixed with #4186, but sadly it's not :-(

Closes #5195.
2014-02-24 11:47:13 +01:00
Clinton Gormley 03ad168b24 [DOCS] Added note about dely in clearing filter cache.
Closes #5231
2014-02-24 11:36:22 +01:00