Commit Graph

5477 Commits

Author SHA1 Message Date
Simon Willnauer c6c709eda2 [TEST] Register data.path for all nodes on close in InternalTestCluster
We need to register those data paths otherwise we might miss path that
need to get cleaned when using local gatway etc. which can otherwise
cause imports of dangeling indices.
2014-11-18 13:39:06 +01:00
Michael McCandless 2f40b464ad Test: force merge index in the end of IndexStatsTests.throttleStats
This works around slow IO (fsync) causing the test-framework cleanup
to timeout at 30 seconds when trying to delete the index.

Closes #8528
2014-11-18 07:25:16 -05:00
Igor Motov fd8a56dc0b Snapshot/Restore: keep the last legacy checksums file at the end of restore
This commit fixes the issue caused by restore process deleting all legacy checksum files at the end of restore process. Instead it keeps the latest version of the checksum intact. The issue manifests itself in losing checksum for all legacy files restored into post 1.3.0 cluster, which in turn causes unnecessary snapshotting of files that didn't change.

Fixes #8119
2014-11-17 19:50:53 -05:00
Igor Motov b0dde6ee4a Snapshot/Restore: restore of indices that are only partially available in the cluster
Fixes the issue with restoring of an index that had only some of its primary shards allocated before it was closed.

Fixes #8224
2014-11-17 18:47:58 -05:00
markharwood 6f79d67f81 Bulk indexing issue - missing parent routing causes NullPointerException.
Now each error is reported in bulk response rather than causing entire bulk to fail.
Added a Junit test but the use of TransportClient means the error is manifested differently to a REST based request - instead of a NullPointer the whole of the bulk request failed with a RoutingMissingException. Changed TransportBulkAction to catch this exception and treat it the same as the existing logic for a ElasticsearchParseException - the individual bulk request items are flagged and reported individually rather than failing the whole bulk request.

Closes #8365
2014-11-17 17:16:35 +00:00
Ken Wu d1c6d3b7b0 fix of Bulk update child doc, NPE error message when parent is not specified #8365
- Throw an RoutingMissingException instead of NPE
2014-11-17 17:13:57 +00:00
Andreas Kohn 66cf4ecc54 Docs: Fix typo in the javadoc for #tieBreaker()
Closes #8503
2014-11-17 16:57:15 +01:00
Adrien Grand e70b4d835b Search: Do not force the post-filter to be loaded into a BitSet.
Close #8488
2014-11-17 15:46:13 +01:00
Martijn van Groningen 28f3ea1b8d Test: Let the random parent/child tests use the query and filter parsers instead of creating the queries and filters in a custom way.
By using the query and filter parsers we increase the test coverage and make the random parent/child tests simpler.
2014-11-17 10:05:46 +01:00
Boaz Leskes 461c20049f Test: CorruptedFileTest.testCorruptionOnNetworkLayer used node settings when creating an index
Test used `indices.recovery.concurrent_streams` when creating an index but this is a node setting. Moved it to the node settings and added similar settings to speed up concurrent recoveries.

Also fixed a misleading log message in ShardRecoveryHandler when logging a remove corruption
2014-11-16 23:54:36 +01:00
Simon Willnauer b0b7c917c3 Prevent double wrapping directories in MockDirectoryWrapper 2014-11-16 20:54:49 +01:00
Simon Willnauer e6908de04a [TEST] Close node env otherwise windows can't delete tmp files 2014-11-16 17:44:38 +01:00
Simon Willnauer 176b4eb1ed Fix synchronization - leftover from refactoring 2014-11-16 15:58:10 +01:00
Simon Willnauer 1c64a113de [CORE] Intorduce shards level locks to prevent concurrent shard modifications
Today it's possible that the data directory for a single shard is used by more than on
IndexShard->Store instances. While one shard is already closed but has a concurrent recovery
running and a new shard is creating it's engine files can conflict and data can potentially
be lost. We also remove shards data without checking if there are still users of the files
or if files are still open which can cause pending writes / flushes or the delete operation
to fail. If the latter is the case the index might be treated as a dangeling index and is brought
back to life at a later point in time.

This commit introduces a shard level lock that prevents modifications to the shard data
while it's still in use. Locks are created per shard and maintined in NodeEnvironment.java.
In contrast to most java concurrency primitives those locks are not reentrant.

This commit also adds infrastructure that checks if all shard locks are released after tests.
2014-11-16 14:24:29 +01:00
Boaz Leskes 37661aed60 Logging: BroadcastOperationAction - added trace logging for successful shard-level responses
In order to be able to trace the exact shards that participated in the operation.
2014-11-15 18:33:56 +01:00
Martijn van Groningen 983a108776 Percolator: Remove `index.percolator.allow_unmapped_fields` setting.
There should be no option to opt out from strict field resolution for percolator query parsing.

Closes #8439
2014-11-14 22:39:07 +01:00
Martijn van Groningen 5714b0a7ad Aggregations: Changed child filters to not require a random access based bitset in `nested` agg.
Also the nested agg now requires docs to be consumed / scored in order.

Closes #8454
2014-11-14 21:40:44 +01:00
Martijn van Groningen 284491d874 Core: In the bitset cache only eagerly load bitsets for parent nested object fields.
Don't eagerly cache parent type filters in bitset cache or nested object fields that are leafs.
Also let parent/child queries not rely on FixedBitSetFilter, but rather on regular Filter

Closes #8440
2014-11-14 21:00:14 +01:00
Ken Wu 31fa4dc58b Configuration: Tab characters in YAML should throw an exception.
Throw an exception if there is a 'tab' character in the elasticsearch.yml file

Close #8259
2014-11-14 16:24:52 +01:00
nwarz e77f9720d2 Mapping: Fixes Merging of default analyzer
Fixed behaviour where two representations of the default index analyzer weren't being treated as equivalent. Added REST test to confirm fix.

Closes #2716
2014-11-14 09:58:26 +00:00
Olivier Favre 4d68d3d053 Provide more context variables in update scripts
In addition to `_source`, the following variables are available through
the `ctx` map: `_index`, `_type`, `_id`, `_version`, `_routing`,
`_parent`, `_timestamp`, `_ttl`.

Some of these fields are more useful still within the context of an
Update By Query, see #1607, #2230, #2231.
2014-11-14 10:14:39 +01:00
Alex Ksikes 936b4c63fc Term Vectors: Fix NPE with dfs and no tvs
Fixes a bug with dfs option for when term vectors are not stored and not generated.
2014-11-14 09:11:13 +01:00
Alexander Reelsen 9956e7721d Tests: Improve netty test behaviour
Based on some test failures, this commit fixes two minor things

* Bind ports only on so called ephemeral ports to prevent try to
  bind to ports where elasticsearch already runs on
* Remove @Network annotation as it was used in a wrong scope
2014-11-13 15:48:50 +01:00
Colin Goodheart-Smithe f56976c2b3 Removed bwc for GetIndexRequest serialisation 2014-11-13 14:20:42 +00:00
Colin Goodheart-Smithe 353574d6af Indices API: Fix GET index API always running all features
Previous to this change all features (_alias,_mapping,_settings,_warmer) are run regardless of which features are actually requested. This change fixes the request object to resolve this bug
2014-11-13 13:22:46 +00:00
Philip McMahon 4194a699c0 Logging: Add log4j-extras dependency
Close #7927
2014-11-13 12:39:30 +00:00
Colin Goodheart-Smithe 972afe61a0 Mappers: Better validation of mapping JSON
Closes #7205
2014-11-12 14:32:25 +00:00
Martijn van Groningen 0b15859e33 Discovery: Removed unnecessary DiscoveryService reference from LocalDiscover, which causes circular Guice dependencies errors. 2014-11-12 11:25:41 +01:00
Michael McCandless 7a22bfba3c Core: still don't load bloom filters, even when Directory instance doesn't have a codecService 2014-11-11 16:56:20 -05:00
Michael McCandless a783d342d2 Test: dump all threads when delete index fails during test cleanup 2014-11-11 10:49:26 -05:00
Simon Willnauer 16cb0dc7a6 [TEST] Disable compression in BWC test for version < 1.3.2
The compression bug fixed in #7210 can still strike us since we are
running BWC test against these version. This commit disables compression
forcefully if the compatibility version is < 1.3.2 to prevent debugging
already known issues.
2014-11-11 14:12:34 +01:00
Lee Hinman f7d0f4d4e2 Refactor term analysis for simple_query_string prefix queries
Also fixes an issue where the token stream could be non-closed if an
exception occured.
2014-11-11 12:00:27 +01:00
Jörg Prante 8aa64c6b76 Query: add option for analyze wildcard/prefix also to simple_query_string query
The query_string query has an option for analyzing wildcard/prefix (#787) by a best effort approach.

This adds `analyze_wildcard` option also to simple_query_string.

The default is set to `false` so the existing behavior of simple_query_string is unchanged.
2014-11-11 10:12:17 +01:00
Michael McCandless 85fba3636a Test: restore logging to prior state 2014-11-10 18:09:12 -05:00
Michael McCandless 91bef2e40f Test: switch to TRACE logging for some components 2014-11-10 16:30:40 -05:00
Boaz Leskes 59117125b4 Internal: extend refresh-mapping logic to the _default_ type
When data nodes receive mapping updates from the master, the parse it and merge it into their own in memory representation (if there). If this results in different bytes then the master sent, the nodes will send a refresh-mapping command to indicate to the master that it's byte level storage of the mapping should be refreshed via the document mappers. This comes handy when the mapping format has changed, in a backwards compatible manner, and we want to make sure we can still rely on the bytes to identify changes.  An example of such a change can be seen at #4760.

This commit extends the logic to include the `_default_` type, which was never refreshed before. In some unlucky scenarios, this caused the _default_ mapping to be parsed with every cluster state update.

Closes #8413
2014-11-10 20:40:52 +01:00
Michael McCandless 8aebb9656b Core: add max_determinized_states to query_string and regexp query/filter
This prevents too-difficult regular expressions from consuming
excessive RAM/CPU; the default max_determinized_states is 10,000 (same
as Lucene) but query_string and regepx query/filter can override
per-request.

The also upgrades to a new Lucene 5.0.0 snapshot.

Closes #8386

Closes #8357
2014-11-10 13:43:48 -05:00
Ryan Ernst ba621ee325 Scripting: Add score() back to AbstractSearchScript
See #8377
closes #8416
closes #8417
2014-11-10 07:46:46 -08:00
Colin Goodheart-Smithe d0da605a39 [TEST] added Get Index bwc test 2014-11-10 09:14:39 +00:00
Adrien Grand 144813629a Internal: Inverse DocIdSets' heuristic to find out fast DocIdSets.
DocIdSets.isFast(DocIdSet) has two issues:
 - it works on the DocIdSet interface while some doc sets can generate either
   slow or fast sets depending on their options (eg. whether an OrDocIdSet is
   fast or not depends on the wrapped clauses).
 - it only works because the result of this method is only taken into account
   when a DocIdSet has non-null `bits()`.

This commit changes this method to work on top of a DocIdSetIterator and to use
a black-list rather than a white list: slow iterators should really be the
exception rather than the rule.

Close #8380
2014-11-10 09:40:44 +01:00
Boaz Leskes a1d5bcaa35 Test: MinimumMasterNodesTests.testCanNotBringClusterDown should always set minimum master nodes. 2014-11-10 09:29:20 +01:00
Martijn van Groningen 696beb6e13 Core: Remove NestedDocsFilter, because it isn't used and also don't eagerly load it in bitset filter cache.
Closes #8414
2014-11-09 22:51:56 +00:00
Simon Willnauer 1368229075 [PING] Don't bubble up exception if we are shutting down and ping schedules get rejected 2014-11-09 19:27:45 +01:00
Simon Willnauer 0ff44d4d27 [STORE] Synchronize operations that modify file mappings on DistributorDirectory
The rename(String, String) method doesn't allow this implementation to use a simple
concurrent map. There is a race during a rename operation where files are not fully
renamed but already visible via #listAll(). This inconsistency can lead to problems
when opening commit points since the pending_segments_N as well as segments_N are visible
but not yet atomically renamed.

Yet, non of the methods that are synced are long running such that adding sychronization
doesn't introduce bottlenecks here. The Direcotry#sync(...) method is not synchronized since
it doesn't change any mapping nor does it depend on the mapping.
2014-11-09 19:05:33 +01:00
Simon Willnauer 2eccbf50fe [STORE] Calculate Alder32 Checksums for legacy files in Store#checkIntegrity
Previously we didn't calculate this checksums even though we have a checksum
to compare. Since we now also verify checksums for legacy files #checkIntegrity
should also calculate the legacy checksums.

Closes #8407
2014-11-09 18:18:59 +01:00
Michael McCandless 6bb7f7a76f more debug logging 2014-11-09 05:31:57 -05:00
Robert Muir 0eb3402795 Internal: harden recovery for old segments
When a lucene 4.8+ file is transferred, Store returns a VerifyingIndexOutput
that verifies both the CRC32 integrity and the length of the file.

However, for older files, problems can make it to the lucene level. This is not great
since older lucene files aren't especially strong as far as detecting issues here.

For example, if a network transfer is closed on the remote side, we might write a
truncated file... which old lucene formats may or may not detect.

The idea here is to verify old files with their legacy Adler32 checksum, plus expected
length. If they don't have an Adler32 (segments_N, jurassic elasticsearch?, its optional
as far as the protocol goes), then at least check the length.

We could improve it for segments_N, its had an embedded CRC32 forever in lucene, but this
gets trickier. Long term, we should also try to also improve tests around here, especially
backwards compat testing, we should test that detected corruptions are handled properly.

Closes #8399

Conflicts:
	src/main/java/org/elasticsearch/index/store/Store.java
	src/test/java/org/elasticsearch/index/store/StoreTest.java
2014-11-09 04:13:37 -05:00
Chris Mattmann f47fb6b1cf fix mention of Apache License, version 2.
Closes #8400
2014-11-08 19:14:51 +01:00
Veres Lajos 4059e4ac86 typo fixes - https://github.com/vlajos/misspell_fixer
Closes #8323
2014-11-08 18:55:57 +01:00
Michael McCandless 37baba0f18 Core: add debug logging to InternalEngine.close 2014-11-08 05:49:20 -05:00