Commit Graph

3876 Commits

Author SHA1 Message Date
Simon Willnauer b4f0603169 Change default merge throttling to 50MB / sec
The current setting of 20MB/sec seems to be too conservative given
the capabilities of modern hardware. Even on cloud infrastructure this
seems to be too lowish. A 50MB default should provide better out of the box
performance
2014-04-22 21:08:40 +02:00
Lee Hinman 029b13cf68 Parse has_child query/filter after child type has been parsed
Fixes #5783
Fixes #5838
2014-04-22 09:29:48 -06:00
Shay Banon 8136a38b3f Improved bloom filter hashing
Make improvements to how bloom filter hashing works based on guava 17 upcoming changes, see more here (https://code.google.com/p/guava-libraries/issues/detail?id=1119)
In order to do it, introduce a hashing enum, and use the (unused until now) hash type serialization to choose the correct hashing used based on serialized version.
Also, move to use our own optimized murmur hash for the new hashing logic.
2014-04-22 17:17:25 +02:00
Lee Hinman 57bee03193 [DOCS] Add /_search_shards documentation 2014-04-22 08:54:32 -06:00
Simon Willnauer cb9f7c1da5 [TEST] Randomize translog setting per index 2014-04-22 16:41:00 +02:00
Simon Willnauer 1cf62e7782 Use unlimited flush_threshold_ops for translog
Currently we use 5k operations as a flush threshold. Indexing 5k documents
per second is rather common which would cause the index to be committed on
the lucene level each time the flush logic runs which is 5 seconds by default.
We should rather use a size based threshold similar to the lucene index writer
that doesn't cause such agressive commits which can slow down indexing significantly
especially since they cause the underlying devices to fsync their data.
2014-04-22 16:37:07 +02:00
Boaz Leskes 1434f6bcbb A new ClusterStateStatus to indicate cluster state life cycles
When the ClusterService applies a new cluster state, it is first assigned as the new active one and then all listeners are called. Some of ES's features sample the current state and try to take action on it (for example index a document). If that fails, they will wait for change in the cluster state and try again (for example, wait for a shard to start and try indexing again).

If you're unlucky you sample the state after it has been assigned as the "active" state but before all listeners has done the work. In this cases the action take (i.e., indexing a doc) will still fail (as the shard is not yet started) but waiting for a new state may take a long time or fail.

This commit adds a new ClusterStateStatus that allows to better track the stages a cluster state goes through (currently `RECEIVED`, `BEING_APPLIED` & `APPLIED`). This allows detecting that a cluster state is not yet fully applied and retry without waiting for a new state to arrive.

This commit also adds a utility class , ClusterStateObserver, to make this pattern slightly simpler and avoid common pit falls.

Closes #5741
2014-04-22 10:14:41 +02:00
Simon Willnauer 41cc1f5bcb [TEST] Ensure that iteration order of TestSection is consistent 2014-04-22 10:06:58 +02:00
Simon Willnauer ae911f6e75 [TEST] Remove ambigious 4th suggestion - order differs slightly on Java 8 2014-04-22 10:00:02 +02:00
javanna 918da65d35 [TEST] Added blacklist to be able to skip specific REST tests
The blacklist can be provided through -Dtests.rest.blacklist and supports a comma separated list of globs
e.g. -Dtests.rest.blacklist=get/10_basic/*,index/*/*

Also added some missing docs and made it clearer that the suite/test descriptions effectively contains their (relative) path (api/yaml_file/test section)

Closes #5881
2014-04-22 09:52:48 +02:00
Andrew Selden 3121ad20dd Return valid empty JSON response when no recovery information
This is a fix to send back to the client a valid empty JSON response in
the case when we have no recovery information.

Closes #5743
2014-04-21 16:52:25 -07:00
Andrew Selden 1f7f72135a Bug fix for hung clients on cluster without benchmark nodes
This is a fix for a bug whereby a cluster that has no nodes started with
-Des.node.bench=true will cause clients to hang if they attempt to
submit a benchmark.

Also adds REST tests to validate fix

Closes #5754
2014-04-21 15:08:50 -07:00
Shay Banon 2f8fc98012 [TEST] make fetch time in millis test more resilient
beef up the fetch work, and increase teh number of iterations (since we count in nanos, but reports in rounded millis)
2014-04-22 00:00:08 +02:00
Shay Banon aa86a51070 Use loopback when localhost is not resolved
we use the "local host" address in sevearl places in our networking layer, if local host is not resolved for some reason, still continue and operate but using the loopback interface
2014-04-21 20:55:03 +02:00
Simon Willnauer f26e9e784f Searcher might not be closed if store hande can't be obtained
Today we first get a reference to the IndexSearcher in #acquireSearcher
and then futher down we try to run Store#incRef() which might throw an
exception if the store is already closed. There is a small window
that allows this to happen during InternalEngine#close() when we try
to acquire the searcher at the same time and the engine is the last
resource that holds a reference to the store.

This commit only affects unreleased code since the Store's ref counting
has not yet been released.
2014-04-21 20:45:38 +02:00
Boaz Leskes baea1827d1 [Tests] SimpleRecoveryLocalGatewayTests.testSingleNodeNoFlush could fail if shards were not started
The test starts a single node, indexes into, restarts the node and checks that no data was lost. It only indexed into 2 shards and didn't wait for green meaning that the node could be restarted with non-started primary. In that case the node will not re-assign the primary as it was not started. This commit makes sure that we either wait for primaries to start or index into all shards which has the same net effect.

Also extending some logging in InternalIndexShard.
2014-04-21 11:44:16 +02:00
Boaz Leskes 2580099cf2 [Test] Let SuggestStatsTests.testSimpleStats do more work
The test verifies that stats are measure by checking timeInMillis>0. On fast machines the suggestions are done in < 1 millis time. The tests now index documents (to power suggestions) and does multiple suggestions per iterations to slow things down.
2014-04-19 17:46:52 +02:00
Boaz Leskes 12bbe28649 Fail replica shards locally upon failures
When a replication operation (index/delete/update) fails to be executed properly, we fail the replica and allow master to allocate a new copy of it. At the moment, the node hosting the primary shard is responsible of notifying the master of a failed replica. However, if the replica shard is initializing (`POST_RECOVERY` state), we have a racing condition between the failed shard message and moving the shard into the `STARTED` state. If the latter happen first, master will fail to resolve the fail shard message.

This commit builds on #5800 and fails the engine of the replica shard if a replication operation fails. This protects us against the above as the shard will reject the `STARTED` command from master. It also makes us more resilient to other racing conditions in this area.

Closes #5847
2014-04-18 18:56:08 +02:00
Simon Willnauer b6515e2979 [TEST] Make InternalEngineMergeTests more stable 2014-04-18 18:20:44 +02:00
javanna 442dda2ac8 [TEST] _id is not indexed by default, sort on score,_uid in MultiMatchQueryTests 2014-04-18 15:09:00 +02:00
Martijn van Groningen a808fe9d46 Moved the updateMappingOnMaster logic into a single place.
Closes #5798
2014-04-18 19:27:13 +07:00
javanna d6a676724a [TEST] added sort by "_id" when score is the same to MultiMatchQueryTests#testEquivalence
A merge (and refresh) might rarely happen in the background between the two queries whose output is compared. It might then happen that two docs with same scores get returned by the two queries in a different order due to different lucene document id (which has changed in the meantime). To fix this we need to order by id when the score is the same, so that we can safely compare the output of the two queries (multimatch and dismax).
2014-04-18 12:15:44 +02:00
Martijn van Groningen a73286bcc4 [TEST] Use startNodesAsync in unicast discovery tests. 2014-04-17 11:51:11 +07:00
Simon Willnauer 0948260ada [TEST] make testTimeoutSendExceptionWithDelayedResponse more reliable on slow systems 2014-04-16 22:59:31 +02:00
Simon Willnauer 1755ae7470 Added version constants for 1.1.2 and 1.0.4 2014-04-16 17:21:19 +02:00
Boaz Leskes 0887e68d4b [Test] InternalEngineTests: increased gc deletes interval & turn it off randomly 2014-04-16 15:59:56 +02:00
Simon Willnauer 26adb37f09 [TEST] Ignore bogus system properties.
LuceneTestCase might reset some solr properties that cause
our tests to fail if the run before in the same JVM We just ignore
solr properties.
2014-04-16 15:19:17 +02:00
Simon Willnauer 3530c8be7e [TEST] catch exceptions if TTL already expired when indexing
TTLPercolatorTests indexes docs with small TTLs which can trigger
AlreadyExpiredException exception. This is expected while rare and
we should just catch them.
2014-04-16 15:10:28 +02:00
Simon Willnauer be14968c44 Ensure close is called under lock in the case of an engine failure
Until today we did close the engine without aqcuireing the write lock
since most calls were still holding a read lock. This commit removes
the code that holds on to the readlock when failing the engine which
means we can simply call #close()
2014-04-16 14:50:40 +02:00
Boaz Leskes 099b9c6b06 add debug logs if failed shards can not be resolved. 2014-04-16 14:45:54 +02:00
Martijn van Groningen 840d1b4b8e [TEST] Reduce the amount of docs being indexed. 2014-04-16 15:49:24 +07:00
Martijn van Groningen 98deb5537f Better deal with invalid scroll ids.
Closes #5738
2014-04-16 14:13:29 +07:00
Simon Willnauer 8df5d4c37e [TEST] Fix PercolatorTests#testSimple2
This test requires a mapping since otherwise if there is no mapping
added the percolator query might not be parsed as a query on a numeric
field since the query might arrive on a node before the dynamic mapping
reached that node.

This commit also moves the `indexService.readAllowed()` call up before
the number of percolation queries is check to make sure we fail if reads
are not allowed - there might be a query in-flight which means we need
to check another node rather than return an empty result.
2014-04-15 23:01:35 +02:00
Lee Hinman 65e72a5be5 [TEST] Wait for green, and refresh after indexing in percolator test 2014-04-15 11:19:41 -06:00
Simon Willnauer c5c87c4a48 [TEST] Don't delete data dirs after test - only delete their content.
Closes #5815
2014-04-15 17:03:31 +02:00
Simon Willnauer 320a206352 Switch back to ConcurrentMergeScheduler
Load tests showed that SerialMS has problems to keep up with
the merges under high load. We should switch back to CMS
until we have a better story to balance merge
threads / efforts across shards on a single node.

Closes #5817
2014-04-15 16:42:23 +02:00
Adrien Grand 9920084ba2 [TEST] Wait for shards to be allocated before running testUpdateMappingDynamicallyWhilePercolating.
If the percolate request is executed soon enough, all shards fail and the
mapping is not actually updated.
2014-04-15 16:20:16 +02:00
Martijn van Groningen 202b1e2306 Update clusterstate if mapping service has local changes
If the during percolating a new field was introduced
in the local mapping service, then those changes should
be updated in cluster state of the master as well.

Closes #5776
2014-04-15 13:41:01 +02:00
Simon Willnauer 7c6d745523 Cleanup FileSystemUtils#mkdirs(File)
This methods had some workarounds for bugs that seem to be fixed
in Java 7 [1]. There seem to be other problems on shared file-systems
which are not really supported by lucene anyway or rather not
recommeded. Yet the current solution that interrupts a static thread
reference is too dangrous given all the usage of NIO across
elasticsearch.

[1] http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4742723
2014-04-15 13:22:51 +02:00
Simon Willnauer 8dd5dd409e Remove FileSystemUtils#maxOpenFiles
This method basically forcefully creates as many files as possible
to find out the process limit in a brute-force manner. The number of
possible probles with this approach would exceed the number of lines
left on this commit message.

This commit uses a JMX based alternative to print the process limit.
2014-04-15 13:22:51 +02:00
Shay Banon bc5bdbc5de Remove jsr166y now that we on Java 7, cleanup jsr166e to classes we use 2014-04-15 13:17:28 +02:00
Simon Willnauer 8bede7024f Use TransportBulkAction for internal request from IndicesTTLService
This prevents executing bulks internal autocreate indices logic
and ensures that this internal request never creates an index
automaticall.

This fixes a bug where the TTL purger thread ran after the actual
index it was purging was already closed / deleted and that re-created
that index.

Closes #5766
2014-04-15 12:40:25 +02:00
Igor Motov 3d23a71fa7 Fix snapshot status with empty repository
The snapshot status command with empty repository should return current status of currently running snapshots in all repositories.

Fixes #5790
2014-04-14 19:02:41 -04:00
Igor Motov 2ed8c632be Separate persistent and global metadata serialization settings 2014-04-14 16:25:33 -04:00
Simon Willnauer 0564c883be Remove unused FileSystemUtils#copyFile 2014-04-14 21:48:27 +02:00
Simon Willnauer a215dd3ae8 Prevent fsync from creating 0-byte files
This is related to LUCENE-5570 where fsync creates a 0-byte file
if the file does not exists. This commit adds the patched lucene
version using Java 7 APIs as well as a note to replace this method
with the upcomeing IOUtils#fsync in Lucene 4.8

This commit cleans up FsImmutableBlobContainer#writeBlob to make
use of Java7 Auto-Closing features and ensures that the directory
the blob was written to is fsynced as well if possible.
2014-04-14 21:48:23 +02:00
Adrien Grand e458d4fd93 Improved SearchContext.addReleasable.
For resources that have their life time effectively defined by the search
context they are attached to, it is convenient to use the search context to
schedule the release of such resources.

This commit changes aggregations to use this mechanism and also introduces
a `Lifetime` object that can be used to define how long the object should
live:
 - COLLECTION: if the object only needs to live during collection time and is
   what SearchContext.addReleasable would have chosen before this change
   (used for p/c queries),
 - SEARCH_PHASE for resources that only need to live during the current search
   phase (DFS, QUERY or FETCH),
 - SEARCH_CONTEXT for resources that need to live until the context is
   destroyed.

Aggregators are currently registed with SEARCH_CONTEXT. The reason is that when
using the DFS_QUERY_THEN_FETCH search type, they are allocated during the DFS
phase but only used during the QUERY phase. However we should fix it in order
to only allocate them during the QUERY phase and use SEARCH_PHASE as a life
time.

Close #5703
2014-04-14 17:42:41 +02:00
Adrien Grand e589301806 Make Releasable extend AutoCloseable.
Java7's AutoCloseable allows to manage resources more nicely using
try-with-resources statements. Since the semantics of our Releasable interface
are very close to a Closeable, let's switch to it.

Close #5689
2014-04-14 17:21:42 +02:00
Adrien Grand e688f445ad [TEST] Use indexRandom in ShardSizeTests. 2014-04-14 12:31:34 +02:00
Simon Willnauer 1ce56ff969 Revert "Don't lookup version for auto generated id and create"
This reverts commit dc73498454.
2014-04-14 12:15:02 +02:00