Commit Graph

4692 Commits

Author SHA1 Message Date
Adrien Grand 76511158b5 Fielddata: Fix the ordinals impl for sparse fields.
Caused by #6908
2014-07-23 17:39:43 +02:00
Simon Willnauer b51bd3a645 Add version 1.2.4 and 1.3.1 to the version table 2014-07-23 16:26:48 +02:00
Simon Willnauer be96f57c11 [TEST] Fix SimpleThreadPoolTests to exclude test infra threads 2014-07-23 14:44:08 +02:00
mikemccand cc4d7c6272 Core: don't load bloom filters by default
This change just changes the default for index.codec.bloom.load to
false: with recent performance improvements to ID lookup, such as
#6298, bloom filters don't give much of a performance gain anymore,
and they can consume non-trivial RAM when there are many tiny
documents.

For now, we still index the bloom filters, so if a given app wants
them back, it can just update the index.codec.bloom.load to true.

Closes #6959
2014-07-23 05:58:41 -04:00
Lee Hinman 15ccd787a5 [TEST] Maven reproductions should always include 'clean' target 2014-07-23 11:47:58 +02:00
mikemccand 5ccd44519a Test: make test less evil 2014-07-23 05:35:52 -04:00
mikemccand 55986907e8 Test: add more verbosity when this test fails 2014-07-23 05:23:15 -04:00
Lee Hinman c38a9d73e7 [TEST] Add test for _score and doc[] access in Groovy scripts 2014-07-23 09:58:38 +02:00
Britta Weber 734e656a91 Make _all field accessible with GET
GET only returned null even when stored if requested with GET like this:

`curl -XGET "http://localhost:9200/test/test/1?fields=_all"`

Instead, it should simply behave like a String field and return the
concatenated fields as String.

closes #6924
2014-07-23 09:16:35 +02:00
Adrien Grand 08f8731b6f Core: Drop UnsafeUtils.
This class potentially does unaligned memory access and does not bring much
now that we switched to global ords for terms aggregations.

Close #6962
2014-07-23 08:41:11 +02:00
Areek Zillur f39d4e1f89 PhraseSuggester: Collate option should allow returning phrases with no matching docs
A new option `prune` has been added to allow users to control phrase suggestion pruning when `collate`
is set. If the new option is set, the phrase suggestion option will contain a boolean `collate_match`
indicating whether the respective result had hits in collation.

CLoses #6927
2014-07-22 17:17:15 -04:00
Simon Willnauer 0faffcf372 [TEST] Add simple sort assertions for bwc tests
Today we only do count searches to ensure sane results are returned
after upgrading etc. This change adds sorting to the picture asserting
on simple numeric sorting that uses field data etc. after upgrading.

Relates to #6967
2014-07-22 22:22:09 +02:00
Shay Banon 50ececbbcf Unicast discovery: only disconnect from temporary connected nodes
In unicast discovery, we try to reuse existing discovery nodes based on the node address they have. If we find an existing node based on its address, and for some reason its not connected, don't add it to the list of nodes to disconnect from, as that (full) connection is useful down the road
closes #6966
2014-07-22 21:29:57 +02:00
Shay Banon 88f3afe4b5 Fix connect concurrency, can cause connection nodes to close
Looking at the connect code, if 2 threads at the same time try and connect to a node, and both enter sequentially the connectLock code block, the second one would try and put the connection in the map, and close the replaced channels, which will cause the existing connection to close as well (since it removes the node from the connectedNodes map)
To fix this, simply make sure we properly check the existence of the connection within the connectionLock block, so there won't be concurrent connections going on.
While doing this, also went over all the mutation code that handles disconnections, and made sure they are properly done only within a connection lock.
closes #6964
2014-07-22 19:48:47 +02:00
mikemccand 72b3d6ef75 Test: make sure randomizer doesn't swap in SerialMergeScheduler on us 2014-07-22 13:06:04 -04:00
mikemccand 1e92f0f4ff Core: allow index.merge.scheduler.max_thread_count to be updated dynamically
Lucene allows the max_thread_count to be updated, but this wasn't
fully exposed in Elasticsearch.

Closes #6925
2014-07-22 11:23:46 -04:00
Clinton Gormley f14af3599a Fixed typo in AbstractFieldMapper
similariry -> similarity
2014-07-22 15:54:09 +02:00
Brian Murphy 7d9b012ca1 [FIX] Fix update parser to accept script_id 2014-07-22 14:22:57 +01:00
Adrien Grand 3c142e550d Fielddata: Switch to Lucene DV APIs.
This commits removes BytesValues/LongValues/DoubleValues/... and tries to use
Lucene's APIs such as NumericDocValues or RandomAccessOrds instead whenever
possible.

The next step would be to take advantage of the fact that APIs are the same in
Lucene and Elasticsearch in order to remove our custom comparators and use
Lucene's.

There are a few side-effects to this change:
 - GeoDistanceComparator has been removed, DoubleValuesComparator is used instead
   on top of dynamically computed values (was easier than migrating
   GeoDistanceComparator).
 - SortedNumericDocValues doesn't guarantee uniqueness so long/double terms
   aggregators have been updated to make sure a document cannot fall twice in
   the same bucket.
 - Sorting by maximum value of a field or running a `max` aggregation is
   potentially significantly faster thanks to the random-access API.

Our aggs and p/c aggregations benchmarks don't report differences with this
change on uninverted field data. However the fact that doc values don't need
to be wrapped anymore seems to help a lot. For example
TermsAggregationSearchBenchmark reports ~30% faster terms aggregations on doc
values on string fields with this change, which are now only ~18% slower than
uninverted field data although stored on disk.

Close #6908
2014-07-22 15:16:24 +02:00
Brian Murphy 0de30e1798 [TEST] Fix indexed script test. 2014-07-22 13:58:07 +01:00
Nik Everett 79433d23e3 Update: Detect noop updates sent with doc_as_upsert
This should help prevent spurious updates that just cause extra writing
and cache invalidation for no real reason.

Close #6822
2014-07-22 14:55:34 +02:00
Brian Murphy ebcc1e0bf5 [FIX] Indexed scripts should always use script_id. 2014-07-22 13:49:31 +01:00
Simon Willnauer 55df94d91e Revert "Fix InternalSearchHits serialization to be deterministic"
This reverts commit 8db7b2b20b.
2014-07-22 14:43:31 +02:00
Simon Willnauer 8db7b2b20b Fix InternalSearchHits serialization to be deterministic
The assertion on binary equality for streamable serialization
sometimes fails due to the usage of identify hashmaps inside
the InternalSearchHits serialization. This only happens if
the number of shards the result set is composed of is very high.
This commit makes the serialziation deterministic and removes
the need to serialize the ordinal due to in-order serialization.
2014-07-22 14:14:31 +02:00
Brian Murphy 924f91588b [TEST] Reduce the number of threads in StressUpdateDelete test. 2014-07-22 11:16:32 +01:00
Boaz Leskes a344fe6590 IndicesStore fix logging format 2014-07-22 07:47:40 +03:00
Boaz Leskes fee22fc0b2 [Discovery] fix MembershipAction.sendJoinRequestBlocking should now expect an empty response
The change introduced in #6949 (do not serialize the cluster state) also means master now responds with an empty response rather then a JoinResponse. However, sendJoinRequestBlocking still expected a JoinRequest.
2014-07-22 00:43:01 +03:00
Boaz Leskes 690820dae3 [Discovery] remove unneeded cluster state serialization during cluster join process
At the moment we serialize the cluster state in JoinResponse and ValidateJoinRequest. However this state is not used anywhere and can be removed to save on network overhead

Closes #6949
2014-07-21 23:30:07 +03:00
Brian Murphy c74552e006 [TEST] Stress update/delete
Reduce top end of scaling parameters to avoid OOMs on nightly runs.
2014-07-21 21:16:41 +01:00
Shay Banon 8dca4b7e07 More lenient type parsing in histo/cardinality aggs
closes #6948
closes #6893
2014-07-21 21:31:37 +02:00
Brian Murphy b0ce090876 [TEST] Stress Update/Delete
Create the test index with merging disabled so deletes don't get merged away
this was breaking the version calculation.
2014-07-21 20:11:05 +01:00
Brian Murphy 6d641ea40d [TEST] Remove TransportUpdateActionTest
This test has been made obselete by the UpdateTests.
2014-07-21 17:55:51 +01:00
Brian Murphy cbb4edf2ae [TEST] Plugin Manager
Undo removal of change.
2014-07-21 16:25:31 +01:00
Brian Murphy 8b169617a2 [TEST] Stress test for update and delete concurrency.
This test deletes and updates using upserts documents over several threads in a
tight loop. It counts the number of responses and verifies that the versions at
the end are correct.
2014-07-21 16:04:21 +01:00
Simon Willnauer e730c76be7 [RESTORE] Fail restore if snapshot is corrupted
today if a snapshot is corrupted the restore operation
never terminates. Yet, if the snapshot is corrupted there
is no way to restore it anyway. If such a snapshot is restored
today the only way to cancle it is to delete the entire index which
might cause dataloss. This commit also fixes an issue in InternalEngine
where a deadlock can occur if a corruption is detected during flush
since the InternalEngine#snapshotIndex aqcuires a topLevel read lock
which prevents closing the engine.

Closes #6938
2014-07-21 16:15:53 +02:00
Simon Willnauer d65a9d63a2 [Engine] `index.fail_on_corruption` is not updateable
The `index.fail_on_corruption` was not updateable via the index settings
API. This commit also fixed the setting prefix to be consistent with other
setting on the engine. Yet, this feature is unreleased so this won't break anything.

Closes #6941
2014-07-21 14:59:44 +02:00
Martijn van Groningen f3114fe774 [TEST] top_hits aggs with breath_first collect mode only fails if scoring is used (score based sort or track_scores) 2014-07-21 11:21:50 +02:00
Martijn van Groningen ba1042e7d1 Aggregations: Track scores should be applied properly for `top_hits` aggregation.
Closes #6934
2014-07-21 10:03:42 +02:00
Martijn van Groningen 2d2088b259 [TEST] Temporarily ignore transport update tests. 2014-07-21 09:57:03 +02:00
Simon Willnauer 6e81cb5cd6 [TEST] Add SuppressSysoutChecks to DistributorDirectoryTest 2014-07-20 19:20:18 +02:00
Shay Banon 2c07588a1a [TEST] an active shard might also be relocating 2014-07-20 10:44:24 +02:00
Alexander Reelsen 1816951b6b Netty: Refactoring to make MessageChannelHandler extensible
Small refactorings to make the MessageChannelHandler more extensible.
Also allowed access to the different netty pipelines

This is the fix after the first version had problems with the HTTP
transport due to wrong reusing channel handlers, which is the reason
why tests failed.

Relates #6889
Closes #6915
2014-07-18 16:30:31 +02:00
javanna bbf7e6be92 Plugins: Introduced pluggable filter chain to be able to filter transport actions execution
It's now possible to inject action filters from plugins via `ActionModule#registerFilter` through the following code:

```
    public void onModule(ActionModule actionModule) {
          actionModule.registerFilter(MyFilter.class);
    }
```

Also made `TransportAction#execute` methods final to enforce the execution of the filter chain. By default the chain is empty though.

Note that the action filter chain is executed right after the request validation, as the filters might rely on a valid request to do their work.

Closes #6921
2014-07-18 16:18:50 +02:00
Adrien Grand 97f4247880 [TESTS] Switch more tests to ElasticsearchSingleNodeTest.
This avoids loading modules manually all the time.
2014-07-18 14:35:00 +02:00
Shay Banon 972fa10945 Better message for invalid internal transport message format
closes ##6916
2014-07-18 13:49:38 +02:00
Simon Willnauer a302f3a9dd [TEST] Randomize Preference in search requests
Closes #6863
2014-07-18 12:30:53 +02:00
Simon Willnauer 6b519633ab [TEST] Randomize FS Translog implementation
Closes #6658
2014-07-18 11:51:42 +02:00
Simon Willnauer d79717c341 [CLIENT] Unknown node version should be a lower bound
Today when we start a `TransportClient` we use the given transport
addresses and create a `DiscoveryNode` from it without knowing the
actual nodes version. We just use the `Version.CURRENT` which is an
upper bound. Yet, the other node might be a version less than the
currently running and serialisation of the nodes info might break. We
should rather use a lower bound here which is the version of the first
release with the same major version as `Version.CURRENT` since this is
what we officially support.

This commit moves to use the minimum major version or an RC / Snapshot
if the current version is a snapshot.

Closes #6894
2014-07-18 11:31:15 +02:00
Alex Ksikes f22f3db30f Term Vectors API: Computes term vectors on the fly if not stored in the index.
Adds the ability to the Term Vector API to generate term vectors for some
chosen fields, even though they haven't been explicitely stored in the index.

Relates to #5184
Closes #6567
2014-07-17 23:29:05 +02:00
Simon Willnauer 6fc5acd760 Return null info if service is not started
Closes #6906
2014-07-17 16:47:46 +02:00
Simon Willnauer 2bec59ec3e [Bulk] Release semaphore again after close
The bulk processor tries to acquire all leases for the semaphore to wait
for all pending requests. Yet, we should release them afterwards again to
ensure we don't ever deadlock if there is a bug in the processor.
This commit also adds a testcase for this method
2014-07-17 16:24:43 +02:00
matt-preston 42b71a004a [Bulk] Add blocking close method to BulkProcessor
Blocks until all bulk requests have completed.

Closes #4158
Closes #6314
2014-07-17 15:57:45 +02:00
uboness cc8f7ddb9a Added three frequency levels for resource watching
It's now possible to register watchers along with a specified check frequency. There are three frequencies: low, medium, high. Each one is associated with a check interval that determines how frequent the watchers will check for changes and notify listeners if needed. By default, the intervals are 5s, 30s and 60s respectively, but they can also be customized in the settings. also:

  - Added the WatcherHandle construct by which one can stop it (remove it) and resume it (re add it). Also provices access to the watchers itself and the frequency by which it's checked
  - Change the default frequency to 30 seconds interval (used to be 60 seconds). The only watcher that is currently effected by this is the script watcher (now auto-loading scripts will auto-load every 30 seconds if changed)
2014-07-17 14:57:53 +02:00
Boaz Leskes bdbe86dd2d [Store] delete unallocated shards under a cluster state task
This is to prevent a rare racing condition where the very same shard gets allocated to the node after our sanity check that the cluster state didn't check and the actual deletion of the files.

Closes #6902
2014-07-17 14:51:07 +02:00
Alexander Reelsen bb421d7ea3 Revert "Netty: Refactoring to make MessageChannelHandler extensible"
This results in unstable tests, most likely due to Channels being mixed
up by wrongly creating the pipelines. Needs investigation and a test.

This reverts commit db7f0d36af.
2014-07-17 14:49:15 +02:00
Boaz Leskes 38d8e3ccc2 [Infra] remove indicesLifecycle.Listener from IndexingMemoryController
The IndexingMemoryController determines the amount of indexing buffer size and translog buffer size each shard should have. It takes memory from inactive shards (indexing wise) and assigns it to other shards. To do so it needs to know about the addition and closing of shards. The current implementation hooks into the indicesService.indicesLifecycle() mechanism to receive call backs, such shard entered the POST_RECOVERY state. Those call backs are typically run on the thread that actually made the change. A mutex was used to synchronize those callbacks with IndexingMemoryController's background thread, which updates the internal engines memory usage on a regular interval. This introduced a dependency between those threads and the locks of the internal engines hosted on the node. In a *very* rare situation (two tests runs locally) this can cause recovery time outs where two nodes are recovering replicas from each other.

 This commit introduces a a lock free approach that updates the internal data structures during iterations in the background thread.

Closes #6892
2014-07-17 14:31:38 +02:00
Adrien Grand 9714dd55c2 Refactoring: Rename FieldMapper.termsFilter to fieldDataTermsFilter.
FieldMapper has two methods
`Filter termsFilter(List values, @Nullable QueryParseContext)` which is supposed
to work on the inverted index and
`Filter termsFilter(QueryParseContext, List, QueryParseContext)` which is
supposed to work on field data. Let's rename the second one to
`fieldDataTermsFilter` and remove the unused `QueryParseContext`.

Close #6888
2014-07-17 12:42:18 +02:00
Martijn van Groningen 9037365adf [TEST] Use array* helper assert methods instead of verifying the array directly 2014-07-17 09:39:51 +02:00
David Pilato 26bac39e0e bin/plugin removes itself
If you call `bin/plugin --remove es-plugin` the plugin got removed but the file `bin/plugin` itself was also deleted.

We now don't allow the following plugin names:

* elasticsearch
* plugin
* elasticsearch.bat
* plugin.bat
* elasticsearch.in.sh
* service.bat

Closes #6745
2014-07-17 08:57:01 +02:00
Alexander Reelsen db7f0d36af Netty: Refactoring to make MessageChannelHandler extensible
Small refactorings to make the MessageChannelHandler more extensible.
Also allowed access to the different netty pipelines

Closes #6889
2014-07-17 08:28:55 +02:00
Boaz Leskes 6fe1d9860e [Scripts] GroovyScriptEngineService don't create ScoreAccess if lookup is null 2014-07-17 08:05:10 +02:00
Ryan Ernst 7139f44241 Scripts: Make ScoreAccessor utility available for other script engines.
With the removal of setNextScore in #6864, script engines must use
the Scorer to find the score of a document.  The DocLookup is updated
appropriately to do this, but most script engines require a Number to be
bound for numeric variables.  Groovy already had an encapsulation for
this funtionality, and this moves it out to be shared with other script
engines.

closes #6898
2014-07-16 16:33:04 -07:00
Ryan Ernst 770447ce1a Scripting: Remove setNextScore in SearchScript.
While it would be nice to do this all the way up the chain (into
score functions), this at least removes the weird dual
setNextScore/setScorer for SearchScripts.

closes #6864
2014-07-16 15:10:01 -07:00
Martijn van Groningen ca7fa4f9ec Query: When parent doc is found stop iterating over segments and continue with the next top matching child doc.
The parent doc has been found and there is no need to check subsequent segments.

Closes #6895
Closes #1843
2014-07-17 00:01:06 +02:00
Martijn van Groningen 473d1717be Search: Added support for named filters/queries inside nested filters and queries.
Closes #6293
2014-07-16 23:43:18 +02:00
Alexander Reelsen 70bad405c3 Serialization: Fix bwc issue by falling back to old threadpool serialization
This fixes an issue introduced by the serialization changes in #6486
which are not needed at all. Node that the serialization itself is not broken
but the TransportClient uses its own version on initial connect and getting
the NodeInfos.
2014-07-16 17:58:32 +02:00
Simon Willnauer 90ea4610c8 [FIELDDATA] Use KeyedLock in IndexFieldDataService
Today we synchronize when updating the IndexFieldDataService
datastructures. This might unnecessarily block progress if multiple
request need different fielddata instance for different fields.

This commit also fixes clear calls to actually consistently clear
the caches in the case of an exception.

Closes #6855
2014-07-16 15:49:17 +02:00
Simon Willnauer e30176cc69 Add read/write lock semantics to KeyedLock 2014-07-16 15:49:00 +02:00
Alexander Reelsen b0c0ff8ac0 Threadpool Info: Allow to serialize negative thread pool sizes
As a SizeValue is used for serializing the thread pool size, a negative number
resulted in throwing an exception when deserializing (using -ea an assertionerror
was thrown).

This fixes a check for changing the serialization logic, so that negative numbers are read correctly, by adding an internal UNBOUNDED value.

Closes #6325
Closes #5357
2014-07-16 15:25:53 +02:00
Martijn van Groningen 62da59f76f [TEST] Verify if clear cache request went to all shards. 2014-07-16 13:48:39 +02:00
Colin Goodheart-Smithe 8260138e59 Aggregations: Fixed Histogram key_as_string bug
The key as string field in the response for the histogram aggregation will now only show if format is specified on the request.

Closes #6655
2014-07-16 11:36:48 +01:00
Brian Murphy cbd2a97abd [DOCS] : Indexed scripts/templates
These are the docs for the indexed scripts/templates feature.
Also moved the namespace for the REST endpoints.

Closes #6851
2014-07-16 10:49:02 +01:00
Adrien Grand 7e44fe6017 [TESTS] Stabilize DisabledFieldDataFormatTests by setting number_of_replicas to 0. 2014-07-16 10:37:25 +02:00
Boaz Leskes 84ad29ddfa [Recovery] don't start a gateway recovery if source node is not found
Due to change introduced in #6825, we now start a local gateway recovery for replicas, if the source node can not be found. The recovery then fails because we never recover replicas from disk.

Closes #6879
2014-07-16 10:01:01 +02:00
Boaz Leskes d869163b66 [Infra] re-send failed shard messages when receiving a cluster state that still refers to them
In rare cases we may fail to send a shard failure event to the master, or there is no known master when the shard has failed (ex. a couple of node leave the cluster canceling recoveries and causing a master to step down at the same time). When that happens and a cluster state arrives from the (new) master we should resend the shard failure in order for the master to remove the shard from this node.

Closes #6881
2014-07-16 09:59:49 +02:00
Martijn van Groningen f1c2cdb9c8 Store: Only send shard exists requests if shards exist locally on disk and are not allocated on that node according to the cluster state.
Closes #6870
2014-07-16 08:23:32 +01:00
Ryan Ernst 35037e31b2 [AGGS] Pass current docid being processed to scripts.
Scripts may internally cache based on docid (as expressions do). This
change makes numeric aggregations using scripts pass the docid when
it changes.
2014-07-15 14:40:12 -07:00
Shay Banon 323210729e Releasable XContentBuilder
make the builder releasable (auto closeable), and use it in shards state
also make XContentParser releasable (AutoCloseable) and not closeable since it doesn't throw an IOException
closes #6869
2014-07-16 04:28:03 +09:00
Shay Banon 9345194a65 Share numeric data analyzer instances between mappings
use similar mechanism that shares numeric analyzers for long/double/... for dates as well. This has nice memory save properties with many date fields mapping case, as well as analysis saves (thread local resources)
closes #6843
2014-07-16 04:24:52 +09:00
Ryan Ernst e764c5f08a Fix transient testScore failure by making DF consistent for query. 2014-07-15 11:18:13 -07:00
Brian Murphy 86dfad24fe [FIX] normalize serialization of ScriptType in UpdateRequest 2014-07-15 18:14:48 +01:00
Nik Everett da5fb34163 Mappings: Add transform to document before index.
Closes #6566
2014-07-15 18:40:46 +02:00
Adrien Grand 56cfa8e47e [TEST] Enforce that the node from ElasticsearchSingleNodeTest is alone in its cluster.
In particular, this removes the ability to create new node and adds the ability
to get a reference to the single node that the cluster is made of.
2014-07-15 17:26:52 +02:00
mikemccand ba443a4819 Test: make test less evil so it doesn't take so long 2014-07-15 11:19:18 -04:00
Simon Willnauer 05d92b9b68 [TEST] Enforce provided settings in test base classes
Enviorment variables might override the tests settings even if
they are explicitly set. Other base classes like InternalTestCluster
also specify `config.ignore_system_properties: true` to ensure `what
we set is what we get`
2014-07-15 17:06:20 +02:00
Ryan Ernst 64ab22816c Scripting: Add script engine for lucene expressions.
These are javascript expressions, which can only access numeric
fielddata, parameters, and _score. They can only be used for searches (not document updates).

closes #6818
2014-07-15 07:49:01 -07:00
Simon Willnauer 1464bea00f Added [1.4.0] version 2014-07-15 16:16:50 +02:00
Simon Willnauer 3900d61254 [TESTS] Add ElasticsearchSingleNodeTest.
This test makes it easy to create a lightweight node (no http, indices stored
in RAM, ...) whose main purpose is to get an instance of the Guice injector
for unit tests.

This should help not have to update lots of unit tests when we add a new
Guice dependency.
2014-07-15 15:42:58 +02:00
Patrick Peschlow 9742d08f53 [UPDATE] Handle document missing exception on retry correctly.
Throwables thrown on update retries are now caught and handled via
the provided callback. This commit also contains an integration test
demonstrating the bug and validating the fix.

Closes #6355
Closes #6724
2014-07-15 14:52:29 +02:00
javanna 3c54eb9b8f Internal: make transport action name available in TransportAction base class
Each transport action is associated with at least an action name, which is the action name that gets serialized together with the request and identifies what to do with the request itself. Also, the action name is the name of the registered transport handler that handles incoming request for the transport action.

This commit makes the action name available in a generic manner in the TransportAction base class, so that it can be used when needed by subclasses, or in the base class for instance for action filtering.

Closes #6860
2014-07-15 14:35:35 +02:00
mikemccand 4194ab31c8 Core: don't close/reopen IndexWriter when changing RAM buffer size
Today we close/reopen IW when we change the RAM buffer but that's
costly because it means the next NRT reader is a full reopen.  The RAM
buffer size setting is a live one in IndexWriter, even if there are no
buffered docs in RAM when you call it.

Separately it would be nice if Lucene let you manage a "reader pool"
that could outlive individual IW instances ...

Closes #6856
2014-07-15 08:32:30 -04:00
Simon Willnauer 557b634f4a [SEARCH] Wrap filter only once in ApplyAcceptedDocsFilter
We potentially wrap the given filter multiple times when iterating the
subreaders. We only need to do this once.

Closes #6873
2014-07-15 12:44:35 +02:00
Simon Willnauer 7de9d3d2cb [TEST] Fix test to use keyword analyzer since it relies on exact terms without processing 2014-07-15 12:26:51 +02:00
Simon Willnauer 82cc227da3 Added missing version based serialization 2014-07-15 12:13:45 +02:00
Brian Murphy 73d93e5fd8 Indexed Scripts/Templates: cleanup
This commit cleans up some code around the indexed script/templates feature.
Remove dead code in ScriptService.
Remove setXScript methods for UpdateRequestBuilder and use setScript(script,type) instead
2014-07-15 10:49:39 +01:00
Simon Willnauer 2bac455cd0 Add version check before reading script type in UpdateRequest 2014-07-15 10:16:08 +02:00
Simon Willnauer 70bd24ed14 [TEST] use higher timeout to wait for balanced cluster
CorruptFileTest sometimes hits conditions where lots of rebalancing
happens. In such a case the default timeout is just not enough - this
timeout just makes sure that the cluster has enough time to balance
itself.
2014-07-15 09:56:41 +02:00
Areek Zillur 0bd774423d [TEST] fix random preference string tests to accomodate for the new more strict preference type 2014-07-14 20:15:00 -04:00
Areek Zillur d0d1b98d23 Stats: Expose IndexWriter and VersionMap RAM usage to ShardStats and _cat endpoint
This commit adds the RAM usage of IndexWriter and VersionMap

Closes #6483
2014-07-14 19:46:12 -04:00
Areek Zillur 4fb79fe787 [TEST] fix random preference string test to accomodate for the new more strict preference type 2014-07-14 19:01:04 -04:00
Areek Zillur 0173298f29 [TEST] fix PhraseInIndex test bug for shard failure 2014-07-14 17:12:51 -04:00
Areek Zillur 76343899ea Phrase Suggester: Add collate option to PhraseSuggester
The newly added collate option will let the user provide a template query/filter which will be executed for every phrase suggestions generated to ensure that the suggestion matches at least one document for the filter/query.
The user can also add routing preference `preference` to route the collate query/filter and additional `params` to inject into the collate template.

Closes #3482
2014-07-14 16:07:52 -04:00
Simon Willnauer f8be82f54a [TEST] close IW before listing directory content 2014-07-14 22:00:03 +02:00
uboness 04b412b597 Added more utility methods to Settings
- names() to return the direct settings names
- getAsSettings(String) to return the settings mapped to the given name (like getByPrefix(...) except no need to provide a tailing '.')
2014-07-14 20:25:35 +02:00
mikemccand f392a99bd9 Test: add diagnostics to get some details next time this test fails 2014-07-14 13:48:56 -04:00
Brian Murphy 9c0b25dcce [TEST] Fix test issues with branches still using mvel as default scripting language 2014-07-14 16:51:17 +01:00
Simon Willnauer c91ec7c730 [TEST] fix compile problems on Java 8 2014-07-14 17:17:24 +02:00
Brian Murphy e79b7086de Indexed Scripts/Templates: Add support for storing/deleting/getting scripts/template from an index.
This change allow elasticsearch users to store scripts and templates in an index for use at search time.
Scripts/Templates are stored in the .scripts index. The type of the events is set to the script language.
Templates use the mustache language so their type is be "mustache".
Adds the concept of a script type to calls to the ScriptService types are INDEXED,INLINE,FILE.
If a script type of INDEXED is supplied the script will be attempted to be loaded from the indexed, FILE will
look in the file cache and INLINE will treat the supplied script argument as the literal script.
REST endpoints are provided to do CRUD operations as is a java client library.
All query dsl points have been upgraded to allow passing in of explicit script ids and script file names.
Backwards compatible behavior has been preserved so this shouldn't break any existing querys that expect to
pass in a filename as the script/template name. The ScriptService will check the disk cache before parsing the
script.

Closes #5921 #5637 #5484
2014-07-14 14:37:55 +01:00
Boaz Leskes dcb2107a1d [Test] testSingleNodeWithFlush should wait for yellow
O.w. it can restart a node before all primaries are started , leading to a red state down the road...
2014-07-14 15:13:52 +02:00
mikemccand 80774877ff Test: add test case verifying updating merge IO throttle settings works
Closes #6842
2014-07-14 08:37:29 -04:00
Martijn van Groningen b275393e01 [TEST] For connection rules make TransportAddress the identity instead of DiscoveryNode.
For unicast ping the DiscoveryNode identity is based on its id, which in that stage is a dummy value, this breaks any rule in the mock tran
However the TransportAddress is a valid value in unicast ping and all other places, so that is a better alternative.

Closes #6836
2014-07-14 12:52:45 +02:00
Clinton Gormley 6e70edb0a4 Analysis: Improve Hunspell error messages
The Hunspell service would throw a confusing error message if more than
one affix file was present.  This commit distinguishes between the two
error cases: where there are no affix files and when there are too many
affix files.

Also implements lazy dictionary loading, which was used in the tests
but not implemented.

Closes #6850
2014-07-14 12:13:32 +02:00
Britta Weber 74927adced significant terms: infrastructure for changing easily the significance heuristic
This commit adds the infrastructure to allow pluging in different
measures for computing the significance of a term.
Significance measures can be provided externally by overriding

- SignificanceHeuristic
- SignificanceHeuristicBuilder
- SignificanceHeuristicParser

closes #6561
2014-07-14 11:00:50 +02:00
Boaz Leskes 8865e60e93 [Transport] possible NPE during shutdown for requests using timeouts
Closes #6849
2014-07-14 10:52:29 +02:00
Simon Willnauer 86bc79202d [ENGINE] Mark store as corrupted before sending failed shard
We have to mark a shard as corrupted if necessary before the
shard failed event is fired ie. before we call the corresponding
listener in the engine. Otherwise the shard might be re-allocated
on the same node and just started up without being marked as corrupted.

Relates to #5924
2014-07-14 10:14:58 +02:00
Simon Willnauer e8ff007852 [RECOVERY] Increment Store refcount on RecoveryTarget
We should make sure we have incremented the store refcount
before we start the recovery on the recovyer target.

Closes #6844
2014-07-14 09:18:25 +02:00
Boaz Leskes ab11c6821d [Test] one more tweak to testLocalNodeMasterListenerCallbacks 2014-07-13 17:59:45 +02:00
Boaz Leskes c3e842e363 [Test] renamed testListenerCallbacks to testLocalNodeMasterListenerCallbacks
Also clean up internal variable namings and fixed usage of wrong setting causing last node to not use the min_master_node settings.
2014-07-13 17:51:01 +02:00
Martijn van Groningen af38b9f7ba Core: Added missing return statements.
Closes #6841
2014-07-13 15:53:05 +02:00
Igor Motov 60b317caa4 Snapshot/Restore: Add ability to restore indices without their aliases
Closes #6457
2014-07-13 17:52:41 +09:00
Shay Banon f7a88fdd3e [TEST] wait for green before deleting mapping 2014-07-13 17:21:26 +09:00
Shay Banon fb6d847aac [TEST] wait for green before deleting mapping 2014-07-13 17:17:14 +09:00
Boaz Leskes 5e3742762a [Test] testHostOnMessages - only decrease latch after setting transport addresses 2014-07-12 09:11:27 +02:00
Martijn van Groningen 05ca763b10 [TEST] Ensure that one node is part of the cluster. 2014-07-11 17:51:35 +02:00
Martijn van Groningen 6547ff3eb0 Print trace log if not enough master nodes could be found. 2014-07-11 17:42:11 +02:00
uboness 25a21c6a01 Cleanup of the transport request/response messages
Now both TransportRequest and TransportResponse inherit from a base TransportMessage that holds the message headers and also now added the remote transport address (where this message came from).
2014-07-11 16:41:01 +02:00
Boaz Leskes c4c0270c52 [Tests] Enhance ZenUnicastDiscoveryTest
This started out as a simple correction to a missing setting problem, but go bigger into more general work on the ZenUnicastDiscoveryTets suite. It now works with both network and local mode. I also merge the different ZenUnicast test suites into a single place.

Closes #6835
2014-07-11 16:37:52 +02:00
Britta Weber 6d8fff65dc Throw exception if function in function score query is null
closes #6292 #6784
2014-07-11 13:57:11 +02:00
Shay Banon 43a5cbe9be Only use IndexShard instance to lookup recovery status
make sure we use the instance itself to look it up, and not the shard id, as we might get another instance
leftover from #6825
2014-07-11 11:38:36 +02:00
Boaz Leskes f480969503 [Gateway] set a default of 5m to `recover_after_time` when any to the `expected*Nodes` is set
The `recovery_after_time` tells the gateway to wait before starting recovery from disk. The goal here is to allow for more nodes to join the cluster and thus not start potentially unneeded replications. The `expectedNodes` setting (and friends) tells the gateway when it can start recovering even if the `recover_after_time` has not yet elapsed. However, `expectedNodes` is useless if one doesn't set `recovery_after_time`. This commit changes that by setting a sensible default of 5m for `recover_after_time` *if* a `expectedNodes` setting is present.

Closes #6742
2014-07-11 11:28:45 +02:00
Alex Ksikes af4eee594c More Like This: ensures selection of best terms is indeed O(n)
Previously the size of the priority queue was wrongly set to the total number
of terms. Instead, it should be set to 'maxQueryTerms'. This makes the
selection of best terms O(n), instead of O(n*log(n)).

Jira patch: https://issues.apache.org/jira/browse/LUCENE-5795

Closes #6657
2014-07-11 11:14:31 +02:00
Shay Banon 01ca81e2a3 Improve handling of failed primary replica handling
Out of #6808, we improved the handling of a primary failing to make sure replicas that are initializing are properly failed as well. After double checking it, it has 2 problems, the first, if the same shard routing is failed again, there is no protection that we don't apply the failure (which we do in failed shard cases), and the other was that we already tried to handle it (wrongly) in the elect primary method.
This change fixes the handling to work correctly in the elect primary method, and adds unit tests to verify the behavior
The change also expose a problem in our handling of replica shards that stay initializing during primary failure and electing another replica shard as primary, where we need to cancel its ongoing recovery to make sure it re-starts from the new elected primary
closes #6825
2014-07-11 10:51:59 +02:00
Simon Willnauer a84777e990 [TEST] Fix CorruptedFileTest to always corrupt the latest delete generation if a .del file is picked 2014-07-11 10:22:11 +02:00
Simon Willnauer 35a52cd04a [TEST] Temporarily don't corrupt .del files since they are generational and we might pick the wrong one 2014-07-11 08:41:38 +02:00
Boaz Leskes 8f0a4ed390 [Test] testCorruptionOnNetworkLayer had a typo in test name. 2014-07-11 08:30:46 +02:00
Simon Willnauer bb964e7817 Revert "Improve handling of failed primary replica handling"
This reverts commit 75ed24f6b6.
2014-07-10 21:30:15 +02:00
Lee Hinman 107534c062 Do not ignore ConnectTransportException for shard replication operations
A ConnectTransportException should fail the replica shard

Closes #6183
2014-07-10 18:49:05 +02:00
Shay Banon 75ed24f6b6 Improve handling of failed primary replica handling
Out of #6808, we improved the handling of a primary failing to make sure replicas that are initializing are properly failed as well. After double checking it, it has 2 problems, the first, if the same shard routing is failed again, there is no protection that we don't apply the failure (which we do in failed shard cases), and the other was that we already tried to handle it (wrongly) in the elect primary method.
This change fixes the handling to work correctly in the elect primary method, and adds unit tests to verify the behavior
closes #6816
2014-07-10 18:30:18 +02:00
Simon Willnauer 4f131dfffb [TEST] Fold SuggestActionTest into SuggestSearchTests
Instead of running the tests twice this commit just randomizes the API
that we use to return the suggestions.
2014-07-10 18:02:10 +02:00
Colin Goodheart-Smithe 0e5f9898d1 Aggregations: DateHistogramBuilder accepts String preOffset and postOffset
This is what DateHistogramParser expects so will enable the builder to build valid requests using these variables.
Also added tests for preOffset and postOffset since these tests did not exist

Closes #5586
2014-07-10 16:38:09 +01:00
Simon Willnauer 0a988ad8f7 [STORE] Treat reading past EOF as an corrupted index when we fail to read segment infos 2014-07-10 17:25:47 +02:00
Simon Willnauer 81e86eba6e [TEST] Wait for longer on slow nodes until replicating has kicked in 2014-07-10 16:52:51 +02:00
javanna eddb378bae [TEST] added ability to provide settings for external nodes in backwards compatibility tests
Closes #6809
2014-07-10 16:45:16 +02:00
Simon Willnauer e7c67bf03b [TEST] Do RollingUpgrade in BWC tests 2014-07-10 16:24:01 +02:00
Simon Willnauer 62002e8192 [TEST] Close TransportClient after it's used in BulkProcessorTests otherwise it will leave threads behind 2014-07-10 16:06:38 +02:00
Simon Willnauer da148ca8b8 [TEST] Subclass ElasticsearchTestCase in LoggingConfigurationTests 2014-07-10 15:28:38 +02:00
Simon Willnauer 72e6150bc1 [STORE]: Make use of Lucene build-in checksums
Since Lucene version 4.8 each file has a checksum written as it's
footer. We used to calculate the checksums for all files transparently
on the filesystem layer (Directory / Store) which is now not necessary
anymore. This commit makes use of the new checksums in a backwards
compatible way such that files written with the old checksum mechanism
are still compared against the corresponding Alder32 checksum while
newer files are compared against the Lucene build in CRC32 checksum.

Since now every written file is checksummed by default this commit
also verifies the checksum for files during recovery and restore if
applicable.

Closes #5924

This commit also has a fix for #6808 since the added tests in
`CorruptedFileTest.java` exposed the issue.

Closes #6808
2014-07-10 15:04:00 +02:00
Shay Banon 9ca5e6e3e1 Add local node to cluster state
Today, the tribe node needs the local node so it adds it when it starts, but other APIs would benefit from adding the local node, also, adding the local node should be done in a cleaner manner, where it belongs, which is right after the discovery service starts in the cluster service
closes #6811
2014-07-10 14:49:52 +02:00
Simon Willnauer c9266e8b6b [TEST] Wait for primary allocations before restart
This commit ensures that all primaries are allocated before we
restart the node. If one primary is in post recovery when we
restart it will not be allocated otherwise.
2014-07-10 11:54:24 +02:00
Simon Willnauer fcadab869d [TEST] SuppressSysoutChecks on ElasticsearchTokenStreamTestCase 2014-07-10 07:48:12 +02:00
uboness c324103cbb added a fix to the PluginManagerTests to create config & bin dirs if they don't exist 2014-07-10 00:50:11 +02:00
Guillaume Nodet 263819c674 [ENV] Release node env if initialization fails
If the node initialisation fails, make sure the
node environment is closed correctly and thus
all locks (on data directories) being properly released.

Closes #6715
2014-07-10 00:14:52 +02:00
Simon Willnauer d82a434d10 [STORE] Make a hybrid directory default using `mmapfs` and `niofs`
`mmapfs` is really good for random access but can have sideeffects if
memory maps are large depending on the operating system etc. A hybrid
solution where only selected files are actually memory mapped but others
mostly consumed sequentially brings the best of both worlds and
minimizes the memory map impact.
This commit mmaps only the `dvd` and `tim` file for fast random access
on docvalues and term dictionaries.

Closes #6636
2014-07-10 00:01:43 +02:00
Simon Willnauer b69fa52588 [TEST] Mute PluginManagerTests#testLocalPluginInstallWithBinAndConfig 2014-07-10 00:00:41 +02:00
Simon Willnauer 9e4d738d7e [TEST] SuppressSysoutChecks on ElasticsearchPostingsFormatTest 2014-07-09 23:24:31 +02:00
uboness 6dae32b09a Added a check on moving bin & config plugin dirs
Plugins can contain bin & config sub-dirs that are copied to es's bin & config directories. If moving these directories fails we now throw an error.
2014-07-09 23:05:12 +02:00
Shay Banon 808c52706a [TEST] relax size test, to not run into OOM 2014-07-09 23:03:06 +02:00
Shay Banon 94539979c7 [TEST] make completion tests more resilient to delayed mapping
especially the tests that check for update of mapping, we need to make sure that the cluster is green so mappings won't get override, also, put mapping during index creation when possible
2014-07-09 22:19:06 +02:00
uboness 610900b781 Enables plugins to define default logging configuration for their needs.
- adds support for multiple logging configurations under the config dir (will pick up any logging.xxx in the config folder tree)
- plugins can now define a top level config directory that will be copied under es config dir and will be renamed after the plugin name (same as the support we have the plugin "bin" dirs)

 Closes #6802
2014-07-09 21:46:21 +02:00
Shay Banon 3e202b4343 Improve large bytes request handling by detecting content composite buffer
There is a special type of request that tries to not allocate another buffer when sending bytes request (used by the public cluster state action). With the new pages bytes reference support, the content can already be a composite channel buffer, take that into account when building the actual composite buffer that will be sent over the network
closes #6756
2014-07-09 21:40:15 +02:00
Shay Banon 8910e09beb Disable JSONP by default
By default, disable the option to use JSONP in our REST layer
closes #6795
2014-07-09 21:17:17 +02:00
Shay Banon b301132d7b [TEST] move more tests to assertBusy from awaitBusy 2014-07-09 21:16:23 +02:00
Shay Banon 386a14370a Upgrade to jackson core 2.4.1.1
Note, we had to disable the symbol overflow, since the many mapping case was tripping it
closes #6789
2014-07-09 17:49:51 +02:00
Areek Zillur 95a5eedd3c Merge pull request #6792 from areek/fix/6717
Remove Lucene's deprecated PatternAnalyzer
2014-07-09 11:18:51 -04:00
Valdis Rigdon 747fd38411 [Test] BackgroundIndexer uses the wrong logger
Closes #6781
2014-07-09 16:49:05 +02:00
Clinton Gormley d0441857cd Fix typo in Hunspell logging 2014-07-09 15:56:07 +02:00
Simon Willnauer 73b9d37064 Add v1.2.3 to Version.java 2014-07-09 15:02:18 +02:00
Shay Banon ecde4e0c8e Improve Settings#get lookup for camel case support
Today, if we miss on a get on setting, we try its camel case version. The assumption is that in our code, we never use camel case to lookup a setting, but we want to support camel case if the user provided one.
This can be expensive (#toCamelCase) when the get on the setting is done in a tight call, which is evident when running the allocation deciders as part of the reroute logic.
Instead of doing the camel case check on get, prepare an additional map that includes all the settings that are provided as came case, and try and lookup from it if needed.
closes #6765
2014-07-09 14:23:37 +02:00
Martijn van Groningen 9abb7c45b4 Store: Before removing shard physically from disk verify that another node in the cluster actually holds an active shard copy.
Closes #6692
2014-07-09 12:57:04 +02:00
Boaz Leskes 684e698627 [Code] Control whether MapperService docMapper iterator should contain DEFAULT_MAPPING
At the moment one can iterate the MapperService to go through all document mappers. This includes the document mapper of DEFAULT_MAPPING, which may be surprising and lead to unintended results. This commit removes the Iterable implementation and add a docMappers method that asks the caller to make an explicit choice

Closes #6793
2014-07-09 11:31:52 +02:00
Boaz Leskes af119dfdd9 [Engine] checkVersionMapRefresh shouldn't use indexWriter.getConfig(). We run it out of lock, the indexWriter may be closed..
Relates to #6443, #6786

Closes #6794
2014-07-09 10:43:28 +02:00
Areek Zillur 14af0cb0f3 Remove Lucene's deprecated PatternTokenizer
Instead of using the PatternTokenizer, the functionality was replicated by using Lucene's StopFilter, PatterTokenizer and LowerCaseFilter

Closes #6717
2014-07-08 21:39:39 -04:00
Simon Willnauer 57cd8f765f [ENGINE] Prevent NPE if engine is closed while version map is checked
We check if the version map needs to be refreshed after we released
the readlock which can cause the the engine being closed before we
read the value from the volatile `indexWriter` field which can cause an
NPE on the indexing thread. This commit also fixes a potential uncaught
exception if the refresh failed due to the engine being already closed.

Relates to #6443
Closes #6786
2014-07-09 00:22:31 +02:00
Shay Banon b97b670011 add more options to many mappings test 2014-07-08 23:46:33 +02:00
Shay Banon c9a46978e1 Remove intern calls on FieldMapper#Names
remove internal callas on FieldMappers#Names, we properly reuse FieldMapper, so there is no need to try and call intern in order to reuse the names. This can be heavy with many fields and continuous mapping parsing.
closes #6747
2014-07-08 20:17:48 +02:00
Shay Banon 5643563730 Add missing pre built analysis components
closes #6770
2014-07-08 19:54:05 +02:00
Shay Banon bb92d46163 [TEST] move tribe tests to use assertBusy 2014-07-08 19:06:59 +02:00
Shay Banon 10030a63cc Add assertBusy helper test method
We use awaitBusy in our tests, the problem is that we have to check if it awaited or not, and then try and keep around somehow more info around why the predicate failed and a timeout happened.
The idea of assertBusy is to allow to simply write "regular" test code, and if the test code trips, it will busy wait till a timeout. This allows us to keep around the assertion information and properly throw it for information that is inherently kept in the failure itself.
2014-07-08 18:58:10 +02:00
mikemccand 7335b5db22 Translog: change flush_threshold_ops to unlimited by default, so we only flush by byte size by default
If you are indexing tiny documents then the previous default (5000)
was too low, causing excessive fsyncs with high indexing rates.  With
this change we now only flush by byte size (200 MB) by default for
better indexing performance for tiny documents.

Closes #6783
2014-07-08 12:42:17 -04:00
mikemccand a8417a7de3 Core: trigger refresh when the live version map is using too much RAM
When refresh_interval is long or disabled, and indexing rate is high,
it's possible for live version map to use non-trivial amounts of RAM.
With this change we now trigger a refresh in such cases to clear the
version map so we don't use unbounded RAM.

Closes #6443
2014-07-08 12:07:48 -04:00
Colin Goodheart-Smithe c85133c857 Aggregations: Aggregation names can now include dot
Aggregation name are now able to use any character except '[', ']', and '>". Dot syntax may still be used to reference values (e.g. in the order field) but may only defence the value directly beneath the last aggregation in the list. more complex structures will need to be accessed using the aggname[value] syntax

Closes #6702
2014-07-08 15:05:46 +01:00
Boaz Leskes c9b0816b29 [Discovery] verify connect when sending a rejoin cluster request
When a master receives a cluster state from another node, it compares the local cluster state with the one it got. If the local one has a higher version, it sends a JoinClusterRequest to the other master to tell it step down. Because our network layer is asymmetric, we need to make sure we're connected before sending.

Closes #6779
2014-07-08 14:41:53 +02:00
javanna 8dedbd01df Core: don't replace indices within the ActionRequest with the concrete ones, and make sure check blocks is executed on concrete indices
Concrete indices is now called multiple times when needed instead of changing what's inside the incoming request with the concrete indices. Ideally we want to keep the original aliases or indices or wildcard expressions in the request.

Also made sure that the check blocks is done against the concrete indices, which wasn't the case for delete index, delete mapping, open index, close index, types exists and indices exists.

Closes #6694
Closes #6777
2014-07-08 14:18:26 +02:00
Boaz Leskes caf11ff2fb Revert "[Discovery] immediately start Master|Node fault detection pinging"
In #6706 we change the master validation to start pining immediately after a new master as ellected or a node joined. The idea is to have a quicker response to failures. This does however create a problem if the new master has yet fully processed it's ellection and responds to the ping with a NoLongerMasterException. This causes the source node to remove the current master and ellect another, only to find out it's not a master either and so forth. We are moving this change to the feature/improve_zen branch, where the improvements we made will cause the situation to be handled properly.

This reverts commit ae16956e07.
2014-07-08 13:35:08 +02:00
Shay Banon 6a4f61a7d2 [TEST] more consistent toString on cluster state, print with assertTimeout 2014-07-08 13:09:16 +02:00
Boaz Leskes 83770c2583 [Test] Revert temporary fixes for update mapping on recovery issue
This reverts:
"Test: Temporarily change delete/put_mapping to wait for green": commit e408f8f638c2dd97a3ec86c8a9ac940f43ab37a0.
"[TEST] wait for green to update mapping": commit b3641a2ee6eb23318d49f5f04b39149e70c2b65b.
2014-07-07 22:27:25 +02:00
Boaz Leskes 867d88795b [Recovery] only send mapping updates to master if needed
The change added in #6762 helps making sure the pending mapping updates are processed on all nodes to prevent moving shards to nodes which are not yet fully aware of the new mapping. However it introduced a racing condition delete_mapping operations, potentially causing a type to be added after it's deletion. This commit solves this by only sending a mapping update if the mapping source has actually changed.

Closes #6772
2014-07-07 21:39:22 +02:00
Shay Banon 135404fffc [TEST] wait for green to update mapping
before we update the mapping, make sure the index is green, so a delayed recovery update mapping will not override the mapping itself
2014-07-07 18:42:20 +02:00
Shay Banon 807b2409ee Don't update default mapping on phase2 recovery
the default mapping is not merged, but updated in place, and only put mapping API can change it, no need to make sure it has been properly updated on the master. This can cause conflicts when a put mapping for it happens at the same time.
closes #6771
2014-07-07 18:40:05 +02:00
mikemccand 15b81c91f7 Core: remove per-ID locking when ID was auto-generated
When we know the ID for the document we are about to index was
auto-generated, we don't need to acquire/release the per-ID lock,
which might provide small speedups during highly concurrent indexing.

Closes #6584
2014-07-07 11:35:33 -04:00
Clinton Gormley f97ff704cf Query DSL: Improved explanation for match_phrase_prefix
The match_phrase_prefix provided the same explanation as the match_phrase
query. There was no indication that the last term was run as a prefix
query.

This change marks the last term (or terms if there are multiple terms
in the same position) with a *

Closes #2449
2014-07-07 14:42:31 +02:00
Boaz Leskes 7f5f4e842e [Relocation] process pending mapping update in phase 2
During phase1 we copy over all lucene segments. These may refer to mapping updates that are still queued up to be sent to master. We must make sure those pending updates are processed before completing the relocation.

Relates to #6648

Closes #6762
2014-07-07 13:21:16 +02:00
Lee Hinman 7023caa1a1 Allow primaries that have never been allocated to be allocated if under the low watermark
Fixes #6196
2014-07-07 11:48:11 +02:00
Shay Banon b471aeb24c Call callback on actual mapping processed
only callback the registered callback listeners when mapping have actually been processed...
closes #6748
2014-07-07 09:42:05 +02:00
Shay Banon 8d793391da [TEST] wait for threads to finish writing before checking
we need to make sure we wait for all threads to finish executing, since there might still be a thread around even post await (i.e. just starting) performing updates
2014-07-06 16:08:09 +02:00
Shay Banon 7ca296987d [TEST] remove repeat lefover... 2014-07-06 12:24:16 +02:00
Shay Banon 6e99448620 [TEST] test didn't take into account other cluster service tasks
The pending tests on an actual node should take into account that other tasks might be executing on that node, thus failing when it happens
2014-07-06 12:23:50 +02:00
Shay Banon 045ce097c9 [TEST] only mark the event as processed when its out of its execution 2014-07-05 19:08:31 +02:00
Britta Weber 2a69ae2f0d Add license header to ManyMappingsBenchmark.java 2014-07-05 18:10:18 +02:00
Shay Banon 1d860f70ca Improve pending api to include current executing class
the pending tasks api will now include the current executing tasks (with a proper marker boolean flag)
this will also help in tests that wait for no pending tasks, to also wait till the current executing task is done
closes #6744
2014-07-05 17:40:52 +02:00