Commit Graph

12206 Commits

Author SHA1 Message Date
javanna 5a0c456ac2 Internal: Uid#createTypeUids to accept a collection of ids rather than a list, plus rename method variants to avoid clashes
The downside of having createTypeUids accept a list only is that if you do provide a collection nothing breaks at compile time, but you end up calling the same method that accepts an object as second argument. Renamed both methods to avoid clashes to `createUidsForTypesAndId` and `createUidsForTypesAndIds`. The latter accepts now a Collection of Objects rather than just a List.

Closes #11263
2015-05-21 10:41:54 +02:00
Simon Willnauer e91bf8a267 [TEST] Remove corrupted index before checkindex goes wild 2015-05-21 10:21:11 +02:00
Simon Willnauer 4cb21d02a4 Check if the index can be opened and is not corrupted on state listing
We fetch the state version to find the right shard to be started as
the primary. This can return a valid shard state even if the shard is
corrupted and can't even be opened. This commit adds best effort detection
for this scenario and returns an invalid version for the shard if it's corrupted

Closes #11226
2015-05-21 09:52:39 +02:00
Ryan Ernst ea3c5d5820 Merge pull request #11272 from rjernst/refactor/mapper-names
Mappings: Cleanup names handling
2015-05-21 00:36:14 -07:00
Britta Weber 17eec9ddca Merge pull request #11266 from brwe/npe-commitstats
fix NPE when streaming commit stats
2015-05-21 08:51:22 +02:00
Robert Muir 332e50e44f Merge pull request #11273 from rmuir/useless_version
Remove useless outdated forbidden-api version in `-Pdev` config.
2015-05-21 02:26:36 -04:00
Robert Muir 8abb8e4861 Remove useless outdated forbidden-api version in `-Pdev` config. 2015-05-21 02:11:11 -04:00
Igor Motov dd41c68741 Snapshot/Restore: fix FSRepository location configuration
Closes #11068
2015-05-20 22:14:31 -04:00
Yannick Welsch 14c1743f30 Snapshot/Restore: Batching of snapshot state updates
Similar to the batching of "shards-started" actions, this commit implements batching of snapshot status updates. This is useful when backing up many indices as the cluster state does not need to be republished as many times.

Closes #10295
2015-05-20 20:43:02 -04:00
Ryan Ernst 5203205808 Mappings: Cleanup names handling
This clarifies some of the uses of names, so that the ambiguous
"name" is mostly no longer used (does this include path or not?).
sourcePath is also removed as it was not used. Not all the
uses of .name() have been cleaned up because Mapper still has
this, and ObjectMapper depends on it returning the short name,
but I would like to leave finishing that cleanup for a future issue.
2015-05-20 17:07:22 -07:00
Lee Hinman 0a6f7ef379 [DOCS] Mention Integer.MAX_VALUE limit for http.max_content_length
Fixes #11244
2015-05-20 13:08:59 -06:00
Britta Weber 4bdf8aabd7 fix NPE when streaming commit stats
commit id is only written from lucene 5 on
2015-05-20 20:52:37 +02:00
Shay Banon 72fde6f695 Async fetch of shard started and store during allocation
Today, when a primary shard is not allocated we go to all the nodes to find where it is allocated (listing its started state). When we allocate a replica shard, we head to all the nodes and list its store to allocate the replica on a node that holds the closest matching index files to the primary.

Those two operations today execute synchronously within the GatewayAllocator, which means they execute in a sync manner within the cluster update thread. For large clusters, or environments with very slow disk, those operations will stall the cluster update thread, making it seem like its stuck.

Worse, if the FS is really slow, we timeout after 30s the operation (to not stall the cluster update thread completely). This means that we will have another run for the primary shard if we didn't find one, or we won't find the best node to place a shard since it might have timed out (listing stores need to list all files and read the checksum at the end of each file).

On top of that, this sync operation happen one shard at a time, so its effectively compounding the problem in a serial manner the more shards we have and the slower FS is...

This change moves to perform both listing the shard started states and the shard stores to an async manner. During the allocation by the GatewayAllocator, if data needs to be fetched from a node, it is done in an async fashion, with the response triggering a reroute to make sure the results will be taken into account. Also, if there are on going operations happening, the relevant shard data will not be taken into account until all the ongoing listing operations are done executing.

The execution of listing shard states and stores has been moved to their own respective thread pools (scaling, so will go down to 0 when not needed anymore, unbounded queue, since we don't want to timeout, just let it execute based on how fast the local FS is). This is needed sine we are going to blast nodes with a lot of requests and we need to make sure there is no thread explosion.

This change also improves the handling of shard failures coming from a specific node. Today, those nodes were ignored from allocation only for the single reroute round. Now, since fetching is async, we need to keep those failures around at least until a single successful fetch without the node is done, to make sure not to repeat allocating to the failed node all the time.

Note, if before the indication of slow allocation was high pending tasks since the allocator was waiting for responses, not the pending tasks will be much smaller. In order to still indicate that the cluster is in the middle of fetching shard data, 2 attributes were added to the cluster health API, indicating the number of ongoing fetches of both started shards and shard store.

closes #9502
closes #11101
2015-05-20 17:55:02 +02:00
Shay Banon 1568eca962 [TEST] simplify number of data nodes in #testReplicaCorruption 2015-05-20 17:51:03 +02:00
jaymode a40ba3be5a default socket reuse address value should be non null
The default for reuse address was null on Windows and casting to a boolean would
result in a NPE. This makes the default on Windows false and changes the return
type to a boolean and removes the need to check for nulls.
2015-05-20 09:52:06 -04:00
Simon Willnauer 40bd56b918 Merge pull request #11241 from s1monw/readd_fail_on_recovery
[RECOVERY] Add engine failure on recovery finalization corruption back
2015-05-20 14:35:02 +02:00
Clinton Gormley 409e4e5f73 REST test: Fixed index-seal test
Fixed bad YAML, and changed to wait for yellow instead of green, because
REST tests usually run on a single node
2015-05-20 13:46:43 +02:00
Simon Willnauer 0bc5b35a59 [TEST] Add better assertion messages 2015-05-20 13:00:26 +02:00
Adrien Grand 42ad677127 Tests: Compare the length of cluster states serialized as a String, not the binary representation.
Due to the fact that the binary representation uses some compression, we can't
be sure that they will be equal even if they store the same content.
2015-05-20 12:05:04 +02:00
Simon Willnauer 51c9f73947 Include num_docs in the commit stats
This also fixes a potential race condition when the number of docs
is compared across shards with the same seal ID since the assertion
was taking the number of docs form the live index reader which might
not be equivalent to the committed num docs.
2015-05-20 11:33:07 +02:00
Simon Willnauer 44b0edd2b8 Notify Listener if transport throws an exception 2015-05-20 11:23:12 +02:00
Clinton Gormley 5e4d5e1c64 Docs: Included the index-seal docs in the indices section 2015-05-20 11:20:12 +02:00
Alexander Reelsen bc5bf9784d Cleanup: Remove generics need in ContextAndHeaderHolder
Generics were only needed for setting a header, that returned
the object being set (most likely the request), but none of
the other methods did this.
2015-05-20 10:49:45 +02:00
Adrien Grand b4ec9044ed Fix abusive assertion. 2015-05-20 10:10:53 +02:00
Ryan Ernst eaf35c4e4a Merge pull request #11243 from rjernst/remove/type-listener
Mappings: Remove document parse listener
2015-05-20 00:00:57 -07:00
Adrien Grand e90740ad74 Merge pull request #11233 from jpountz/fix/compressedstring_equals
Internal: Fix CompressedString.equals.
2015-05-20 08:39:51 +02:00
Adrien Grand fd1954d74f Internal: Fix CompressedString.equals.
CompressedString relied on the assumption that two CompressedString instanes
are equal if there compressed representation are equal. Unfortunately this is
not always true because the compressed representation also depends on when
flush() was called on the output stream or on the size of the hash table that
has been used at compression time.
2015-05-20 08:36:42 +02:00
Igor Motov 21ed6bb90c Core: Don't allow indices containing too-old segments to be opened
When index is introduced into the cluster via cluster upgrade, restore or as a dangled index the MetaDataIndexUpgradeService checks if this index can be upgraded to the current version. If upgrade is not possible, the newly upgraded cluster startup and restore process are aborted, the dangled index is imported as a closed index that cannot be open.

Closes #10215
2015-05-19 23:37:05 -04:00
Ryan Ernst 26ef40a46d Mappings: Remove document parse listener
There was previously a single user of the parse listener, MLT API.
However, now that this is gone, there is no need for it.
2015-05-19 15:35:45 -07:00
Simon Willnauer 8949cb85fb [RECOVERY] Add engine failure on recovery finalization corruption back
This engine failure on finalization corruption was lost on refactorings and
should be added back.
2015-05-19 22:24:02 +02:00
Simon Willnauer eaa8576bba Remove all corruption markers if finalization fails 2015-05-19 22:15:48 +02:00
Simon Willnauer 7025a27f78 Revert "Revert "Ensure we mark store as corrupted if we fail to read the segments info""
This reverts commit 5fbb6a714d.
2015-05-19 20:28:01 +02:00
Ryan Ernst 4dd4f48a2f Merge pull request #11216 from rjernst/remove/smart-field-mappers
Mappings: Remove SmartNameFieldMappers
2015-05-19 10:49:21 -07:00
Simon Willnauer 5fbb6a714d Revert "Ensure we mark store as corrupted if we fail to read the segments info"
This reverts commit 70b4bb6e0e.
2015-05-19 17:53:25 +02:00
Simon Willnauer 70b4bb6e0e Ensure we mark store as corrupted if we fail to read the segments info
This commit also reenables CorruptedFileTest#testReplicaCorruption which had
a missing `GatewayAllocator.INDEX_RECOVERY_INITIAL_SHARDS: "one"` setting.

Closes #11226
2015-05-19 17:41:53 +02:00
jaymode 2e94753c95 [Test] set socket reuse address when using unicast discovery
When we use unicast discovery in tests, we test for available ports by binding to ports and if
the bind was successful, we use that port. This has a timing issue on certain operating systems
the socket can still be in a TIME_WAIT causing subsequent binds to fail before a certain timeout.
Setting reuse address on the Java socket will instruct the underlying operating system to allow
the socket to be bound to immediately, usually by specifying the SO_REUSEADDR socket option.
2015-05-19 10:59:25 -04:00
Adrien Grand 52899c87ef Merge pull request #11224 from jpountz/enhancement/filtered_query_forbidden
Search: Make FilteredQuery a forbidden API.
2015-05-19 15:35:24 +02:00
Simon Willnauer 348e14fa85 [TEST] Wait for green until testing Version.FORCE 2015-05-19 15:35:09 +02:00
Adrien Grand 4131bcbec7 Search: Make FilteredQuery a forbidden API.
This commit makes FilteredQuery a forbidden API and also removes some more usage
of the Filter API. There are some remaining code using filters for parent/child
queries but I'm not touching this as they are already being refactored in #6511.
2015-05-19 15:33:43 +02:00
Adrien Grand fae1a0731f Tests: Add tests for `null_value`. 2015-05-19 15:32:55 +02:00
Britta Weber 55139659bb Merge pull request #11179 from elastic/feature/synced_flush
Seal indices for faster recovery
2015-05-19 15:17:16 +02:00
Simon Willnauer 242a452142 Merge branch 'master' into feature/synced_flush
Conflicts:
	src/main/java/org/elasticsearch/index/engine/InternalEngine.java
2015-05-19 14:55:45 +02:00
Simon Willnauer 78d7e5b695 Minor cleanups in SyncedFlushService 2015-05-19 14:53:39 +02:00
Simon Willnauer b3f1a5da4a Merge pull request #11225 from s1monw/remove_flush_needed
[ENGINE] Remove flushNeeded in favor of IW#hasUncommittedChanges()
2015-05-19 14:53:09 +02:00
Simon Willnauer 2439faaf5b [TEST] Add more engine unittests for sync IDs 2015-05-19 14:43:03 +02:00
Shay Banon 643c2049a2 [TEST] add await fix for #11226 2015-05-19 14:40:02 +02:00
Simon Willnauer d6e7817666 [ENGINE] Remove flushNeeded in favor of IW#hasUncommittedChanges()
We maintain a boolean that is obsolete since IW maintains the same
property that we can just piggyback on.
2015-05-19 14:10:07 +02:00
Shay Banon a1a16276da [TEST] Add a corrupted replica test verifying its still allocated
Add a test that verifies that even though all replicas are corrupted on all available nodes, and listing of shard stores faield, it still get allocated and properly recovered from the primary shard
2015-05-19 13:18:43 +02:00
Simon Willnauer 488be75d19 Add some words about the purpose of a seal etc. 2015-05-19 12:26:08 +02:00
Simon Willnauer 9d2852f0ab Merge branch 'master' into feature/synced_flush
Conflicts:
	src/main/java/org/elasticsearch/index/engine/InternalEngine.java
	src/main/java/org/elasticsearch/index/shard/IndexShard.java
	src/main/java/org/elasticsearch/indices/recovery/RecoverySourceHandler.java
	src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java
2015-05-19 12:16:22 +02:00