Commit Graph

10482 Commits

Author SHA1 Message Date
Ryan Ernst 1ad64a97ec Mappings: Remove includeExisting flag from adding ObjectMapper and
FieldMapper listeners

This flag is unused by the 2 places that add these listeners.
2015-01-08 09:08:54 -08:00
Simon Willnauer 959e3ca9da [CORE] Fold engine into IndexShard
This commit removes most of the Engine abstractions and removes
Engine exposure via dependency injection. It also removes the Holder
abstraction and makes the engine itself start at constrcution time.
It removes the start method from the engine entire which means no engine
instances exists until it's started. There is also no way to stop the
engine to restart, it needs to be an entire new Engine
2015-01-08 17:48:27 +01:00
Martijn van Groningen dedaf9387e Core: Also check if indices resolved via aliases resolution aren't closed and deal with this according to IndicesOptions.
Closes #9057
2015-01-08 16:45:34 +01:00
Martijn van Groningen b0b61ee0c3 Renamed allowNoIndices to failNoIndices and changed parameter order. 2015-01-08 16:43:56 +01:00
Simon Willnauer 78fc7c3f01 [TEST] Ensure shard lock is acquired before we try the timeout version 2015-01-08 15:37:31 +01:00
Colin Goodheart-Smithe ecfe72ebcc Indices API: Fix to make GET Index API consistent with docs
This fix ensures that calls to the GET alias/mappings/settings/warmers APIs return the aliases/mappings/settings/warmers object even if there is no content within them.. This make them consistent with the GET Index API docs and the breaking changes in 1.4 docs

Closes #9148
2015-01-08 08:48:44 +00:00
Boaz Leskes ad66d25fa2 Test: trace logging for testDeleteSafe 2015-01-07 23:16:19 +01:00
Simon Willnauer acf6132a99 Fix 1.5.0 Lucene version constant 2015-01-07 22:13:12 +01:00
Simon Willnauer 77493762e2 [TEST] Add back MockIndexEngine
This test class was lost accidentially in a8fa650
2015-01-07 16:38:21 +01:00
Adrien Grand fda727e20c Internal: assert that we do not call blocking code from transport threads.
This currently only adds checks to BaseFuture, but this should already cover
lots of client code. We could add more in the future, like interactions with
the filesystem and so on.

Close #9164
2015-01-07 14:08:40 +01:00
Martijn van Groningen 20f7be378b Removed parent parameter from update request, because it is just sets the routing.
The routing option should be used instead. The parent a child document points to can't be updated.

Closes #4538
2015-01-07 10:26:20 +01:00
Martijn van Groningen 687be70736 Made sure that named filters and queries defined in a wrapped query and filter are not lost.
Closes #6871
2015-01-07 09:10:16 +01:00
Martijn van Groningen c94d056454 Fixed a bug that was caused by specifying routing on a multi percolate request causing an ArrayIndexOutOfBoundsException.
The multi percolate shard responses are collected in an atomic array which uses the shard id is used as index, but the number of shards the multi percolate request was meant to go to was used as size of this array instead the total number of shards an index has. This caused the exception when routing was used.

Closes #6214
2015-01-07 08:49:25 +01:00
Simon Willnauer 7ec8973fbc [CORE] Delete shard content under lock
Once we delete the the index on a node we are closing all resources
and subsequently need to delete all shards contents from disk. Yet
this happens today under a lock (the shard lock) that needs to be
acquried in order to execute any operation on the shards data
path. We try to delete all the index meta-data once we acquired
all the shard lock but this operation can run into a timeout which causes
the index to remain on disk. Further, all shard data will be left on
disk if the timeout is reached.

This commit removes all the shards data just before the shard lock
is release as the last operation on a shard that belongs to a deleted
index.
2015-01-06 21:53:28 +01:00
Ryan Ernst f7f99b8dbf Stats: Added verbose option to segments api, with full ram tree as first
additional element per segment.

This commit adds a verbose flag to the _segments api.  Currently the
only additional information returned when set to true is the full
ram tree from lucene for each segment.
2015-01-06 10:04:52 -08:00
Simon Willnauer 09b4d0e097 [EXEC] Remove reduced stack size
We used to reduces the stack size to 256kb. This commit removes
this optimization and relies on the JVMs default.

Closes #9135
2015-01-06 17:35:45 +01:00
Adrien Grand bc86796592 Core: Remove terms filter cache.
This is our only cache which is not 'exact' and might allow for stalled results.
Additionally, a similar cache that we have and needs to perform lookups in other
indices in order to run queries is the script index, and for this index we rely
on the filesystem cache, so we should probably do the same with terms filters
lookups.

Close #9056
2015-01-06 17:21:20 +01:00
Simon Willnauer 236e2491b4 [ALLOCATION] Remove primary balance factor
The `cluster.routing.allocation.balance.primary` setting has caused
a lot of confusion in the past while it has very little benefit form a
shard allocatioon point of view. Users tend to modify this value to
evently distribute primaries across the nodes which is dangerous since
a prmiary flag on it's own can trigger relocations. The primary flag for a shard
is should not have any impact on cluster performance unless the high level feature
suffereing from primary hotspots is buggy. Yet, this setting was intended to be a
tie-breaker which is not necessary anymore since the algorithm is deterministic.

This commit removes this setting entriely.
2015-01-06 16:43:39 +01:00
Robert Muir 8948b489d6 core: Populate metadata.writtenBy for pre 1.3 index files.
Today this not populated (null) in these cases. But it would be useful to have
    this available, even just for improved error messages.

    The trickiest part today is the handling of 1.2.x files written with
    lucene 4.8+ which have both ES checksums and lucene ones. This is now simplified:
    when the lucene checksum is there, we always use it.

Closes #9152
2015-01-06 09:54:39 -05:00
Simon Willnauer 4900f52619 [ALLOCATION] Weight deltas must be absolute deltas
In some situations the shard balanceing weight delta becomes negative. Yet,
a negative delta is always treated as `well balanced` which is wrong. I wasn't
able to reproduce the issue in any way other than useing the real world data
from issue #9023. This commit adds a fix for absolute deltas as well as a base
test class that allows to build tests or simulations from the cat API output.

Closes #9023
2015-01-06 15:48:44 +01:00
Martijn van Groningen ca68136628 Made the `nested`, `reverse_nested` and `children` aggs ignore unmapped nested fields or unmapped child / parent types.
Closes #8760
2015-01-06 12:14:15 +01:00
Adrien Grand 4cb23a0520 Search: Fix paging on strings sorted in ascending order.
For the comparator to work correctly, we need to give it the same value in
`setTopValue` as the value that it gave back in `value`.

Close #9136
2015-01-06 11:48:05 +01:00
Adrien Grand 999bec1243 Make DistributorDirectory not call fsync on sub directories and missing files.
Related to #9145
2015-01-06 11:15:42 +01:00
Boaz Leskes 9090e0381f Internal: AdapterActionFuture should not set currentThread().interrupt()
If someone blocks on it and it is interrupted, we throw an ElasticsearchIllegalStateException. We should not set Thread.currentThread().interrupt(); in this case because we already communicate the interrupt through an exception.

Similar to #9001

Closes #9141
2015-01-06 11:03:27 +01:00
Adrien Grand cd04851206 Recovery: RecoveryTarget does not fsync the right file name.
Close #9144
2015-01-06 09:24:18 +01:00
Adrien Grand 90f98579a2 Upgrade to Lucene 5.0.0-snapshot-1649544.
A couple of changes that triggerred a refactoring in Elasticsearch:

 - LUCENE-6148: Accountable.getChildResources returns a collection instead of
   a list.

 - LUCENE-6121: CachingTokenFilter now propagates reset(), as a result
   SimpleQueryParser.newPossiblyAnalyzedQuery has been fixed to not reset both
   the underlying stream and the wrapper (otherwise lucene would barf because of
   a doubl reset).

 - LUCENE-6119: The auto-throttle issue changed a couple of method
   names/parameters. It also made
   `UpdateSettingsTests.testUpdateMergeMaxThreadCount` dead slow so I muted this
   test until we clea up merge throttling to use LUCENE-6119.

Close #9145
2015-01-06 09:24:18 +01:00
Alexander Reelsen 8626c18ad9 Settings: Ensure fields are overriden and not merged when using arrays
In the case you try to merge two settings, one being an array and one being
a field, together, the settings were merged instead of being overridden.

First config
my.value: 1

Second config
my.value: [ 2, 3 ]

If you execute

settingsBuilder().put(settings1).put(settings2).build()

now only values 2,3 will be in the final settings

Closes #8381
2015-01-06 09:13:10 +01:00
tlrx a5127d2ffd Plugins: Installation failed when bin/ and plugins/ directories are on different filesystems
Plugin installation failed when bin/, conf/ and plugins/ directories are on different file systems. The method File.move() can't be used to move a non-empty directory between different filesystems.

I didn't find a simple way to unittest that, even with in-memory filesystems like jimfs or the Lucene test framework.

Closes #8999
2015-01-06 08:45:59 +01:00
Robert Muir 9f6a6a832f fix TODO for master, we don't need to support this version here 2015-01-05 15:31:49 -05:00
Robert Muir 8f2f2c5663 Tests: add 0.20 index and fix test bugs in assertNewReplicasWork() 2015-01-05 15:30:18 -05:00
Clinton Gormley 0d9fad79e0 Fixed typo in geoshape exception
Invaild -> Invalid
2015-01-05 13:27:54 +01:00
Clinton Gormley 75cc7077c7 Update plugins.asciidoc
Added entity resolution plugin for duplication detection

Related to #9131
2015-01-05 12:53:37 +01:00
Britta Weber 9454593d6a [TEST] mute ExceptionRetryTests 2015-01-03 18:40:19 +01:00
David Pilato a50d82c44b [Doc] Use byte[] as example instead of String
Closes #8973.
2015-01-02 16:20:32 +01:00
Britta Weber f45e6ae3f9 [index] Prevent duplication of documents when retry indexing after fail
If bulk index request fails due to a disconnect, unavailable shard etc, the request is
retried once before actually failing. However, even in case of failure the documents
might already be indexed. For autogenerated ids the request must not add the
documents again and therfore canHaveDuplicates must be set to true.

closes #8788
2015-01-02 15:44:47 +01:00
Nicholas Knize b21024b5f9 [GEO] Throw helpful exception for Polygons with holes outside the shell
A recent situation occured where a MultiPolygon coordinate array was accidentally defined as a single polygon with multiple holes. Since the intent was a MultiPolygon, the holes of the unintended Polygon fell outside the outer shell.  This exposed a bug in the contains logic inside BasePolygonBuilder. An ArrayIndexOutOfBoundsException was being thrown instead of a more useful ElasticsearchParseException( "hole is not within polygon" ).  This pull request fixes the bug and adds additional unit tests for verifying proper MultiPolygon type parsing.

closes #9071
2015-01-02 08:14:07 -06:00
Simon Willnauer 93dddcdfd9 [TEST] Wait for green if index is closed and reopened
if we reopen an index and the majority of the replicas where
not created the reopen will fail sicne on master this runs with
local gatway all the time.
2015-01-02 14:58:18 +01:00
Simon Willnauer 3e37c89932 [INTERNAL] Remove OperationRouting abstraction
This commit removes the unneeded OperationRouting interface and flattens
the package structure inside cluster.routing
2015-01-02 12:17:35 +01:00
Simon Willnauer b936c2f845 [RECOVERY] Allow cancel waiting for mapping changes
This commit interrupts the wait for mapping change if the index
shard gateway is waiting for the master on a mapping update.
2015-01-02 11:02:45 +01:00
Simon Willnauer 54ce210c8e [RECOVERY] Release store lock before blocking on mapping updates
This can lead to sporadic shard creating timeouts if the same shard is
created, closed and created again on the same node. The reason for this is
that we holding on to the store reference while blocking on the mapping update
that will prevent the shard lock from being released. Holding the lock is unnecessary
in this case and can simply be removed.
2015-01-02 11:02:19 +01:00
Mikhail Korobov 707025fb7a [Docs] fix curl examples in Nodes Stats docs
Closes #9118
2014-12-31 14:01:37 +01:00
Adrien Grand 56974bf867 [TEST] Fix GroovyScriptTests failures. 2014-12-31 10:02:45 +01:00
Ryan Ernst 6304f68715 Scripting: Make _score in groovy scripts comparable
closes #8828
closes #9094
2014-12-30 16:38:44 -08:00
Clinton Gormley f83909f7ae Docs: The regexp query defaults to the `ALL` flag, and removed
the `AUTOMATON` flag which is not used in Elasticsearch.

Closes #6180
2014-12-30 19:53:31 +01:00
Nicholas Knize 0e24f34b0c [GEO] GIS envelope validation
ShapeBuilder expected coordinates for Envelope types in strict Top-Left, Bottom-Right order. Given that GeoJSON does not enforce coordinate order (as seen in #8672) clients could specify envelope bounds in any order and be compliant with the GeoJSON spec but not the ES ShapeBuilder logic. This change loosens the ShapeBuilder requirements on envelope coordinate order, reordering where necessary.

closes #2544
closes #9067
closes #9079
closes #9080
2014-12-30 11:54:07 -06:00
Lee Hinman 31652a8b3d Fix TransportNodesListShardStoreMetaData for custom data paths
Cleans up the testReusePeerRecovery test as well

The actual fix is in TransportNodesListShardStoreMetaData.java, which
needs to use `nodeEnv.shardDataPaths` instead of `nodeEnv.shardPaths`.

Due to the difficulty in tracking this down, I've added a lot of
additional logging. This also fixes a logging issue in GatewayAllocator
2014-12-30 17:50:38 +01:00
Clinton Gormley 904f20a41b Update setup.asciidoc
Add a note about using the same JVM version on all nodes and clients
2014-12-30 17:40:51 +01:00
Simon Willnauer bc65afba8a [TEST] Wait for threads to finish / start before asserting 2014-12-30 15:45:28 +01:00
Adrien Grand 3af3def30b Remove some dead code. 2014-12-30 14:30:40 +01:00
Lee Hinman a4e2230ebd Add index.data_path setting
This allows specifying the path an index will be at.

`index.data_path` is specified in the settings when creating an index,
and can not be dynamically changed.

An example request would look like:

POST /myindex
{
  "settings": {
    "number_of_shards": 2,
    "data_path": "/tmp/myindex"
  }
}

And would put data in /tmp/myindex/0/index/0 and /tmp/myindex/0/index/1

Since this can be used to write data to arbitrary locations on disk, it
requires enabling the `node.enable_custom_paths` setting in
elasticsearch.yml on all nodes.

Relates to #8976
2014-12-29 14:40:50 +01:00