Commit Graph

2565 Commits

Author SHA1 Message Date
Simon Willnauer 1f906804ff Catch RejectedExceutionException in ZenPing et al.
If nodes are shutting down we close thread pools and throw
'EsRejectedExcutionException'. This commit handles these exceptions
gracefully if throw during Ping execution.
2013-09-30 11:10:54 +02:00
Shay Banon 6b6a468327 serialize timestamp on the response 2013-09-30 10:54:30 +02:00
Shay Banon 62a09fd207 additional places not to do field conversions 2013-09-30 10:39:14 +02:00
Simon Willnauer ea3ec926c9 Move Mock Store impls to test package 2013-09-28 22:16:34 +02:00
Simon Willnauer 6c54e030d4 Expose several options from MockDirWrapper via index settings
Index settings can now override default behavior for 'double write'
and 'no delete open files' on MockDirectoryWrapper if tests use these
options in a legit. way. ie. in a restore situation a double write
is a legit operation.
2013-09-28 22:05:22 +02:00
Simon Willnauer 831c3fabc6 cleanup testcase 2013-09-28 20:36:15 +02:00
Boaz Leskes 2f0271062a added a ToXContent implementation to NodeStats 2013-09-27 17:08:34 +02:00
Alexander Reelsen a18f47e62e Returning useful exception when sorting on a completion field
Closes #3747
2013-09-27 16:45:23 +02:00
uboness 4aa315974b introduced NodeSettingsSource in the test infrastructure os tests with scopes TEST & SUITE without an explicit numNodes definitions will fall back on the nodeSettings(int) callback 2013-09-27 16:09:36 +02:00
Boaz Leskes 1d7e20b712 Add indexUUID to mapping-updated and mapping-refresh events and make sure they are applied to an index with same UUID.
This can go wrong if indices with the same name are repeatably created and deleted.

UUIDs can not be null anymore. If UUID is not available `_na_` will be used as a value.

Also - some minor clean up in ShardStateAction where shard started events could be added twice to the to-be-applied list where the second instance will be ignored.

Closes #3783
2013-09-27 14:42:12 +02:00
Shay Banon 40aebfaf57 remove unused class 2013-09-27 10:10:08 +02:00
Boaz Leskes b66f3c6834 Send the update-mapping events before actually indexing into the shard, because the latter may generate exceptions (like when the shard is not yet ready to accept new docs).
Also improved the SimpleDeleteMappingTest, as it make take a while until the update-mapping event is processed.

Closes #3782
2013-09-26 14:37:12 +02:00
Shay Banon 48ca7b874d use the event cluster state to send events back to master
instead of relying on the current cluster state from the cluster service, make sure to rely on the cluster state we get from the change event, this will allow us to move processing of the cluster event around potentially to before the local cluster state has been updated
2013-09-26 14:04:59 +02:00
Bernhard K. Weisshuhn 93a2742c84 do not silently fail on plugin install with source files 2013-09-26 12:24:07 +02:00
Simon Willnauer 63fdbe9b9b Add more debug info to SimpleDeleteMappingTests 2013-09-25 23:56:38 +02:00
Boaz Leskes 1644444a4f Introduced an index UUID which is added to the index's settings upon creation. Used that UUID to verify old and delayed shard started/failed events are not applied to newer indexes with the same name.
Also, exceptions while processing batched events do not stop the rest of the events from being processed.

Closes #3778
2013-09-25 19:26:05 +02:00
Shay Banon 35990f572b fix to compile under 1.6 2013-09-25 18:02:13 +02:00
Simon Willnauer 500469fd28 Improve EngineSearcher tracking
Currently we fail tests is any searcher reference is pending. Yet,
on a slow machine the freeContext calls that are async could still be
in flight so if there are pending searchers we wait for a bit to make
sure we don't fail if a freeContext call is in flight.
The MockEngine now also contains the stack trace of the first close call
if a searcher is closed twice.
2013-09-25 14:18:34 +02:00
Shay Banon 57d6944f0f add assert to make sure we fix NamedAnalyzer when upgrading to Lucene 4.5 2013-09-25 13:38:45 +02:00
Simon Willnauer a958d2e4fd Added test for DateHistogram#factor
DateHistogramFacets can be used on fields that store dates in a numeric
(long) field using different resolutions like seconds instead of
milliseconds. This commit adds a test that checks if the factor is
applied correctly to scale it up to milliseconds.
2013-09-25 09:36:12 +02:00
Shay Banon 3772201845 add awaitfix on search while relocation with 0 replicas 2013-09-24 17:50:24 +02:00
Simon Willnauer df0112358d Acquire ReadLock before reading SegmentInfos in RobinEngine
Before reading segmentinfos we should aquire the read lock to prevent
reading the segment infos on an already closed robin engine.
2013-09-24 15:55:48 +02:00
Shay Banon 5b1f263569 add origin to failure message 2013-09-24 15:52:13 +02:00
Shay Banon 397f442c6d Introduce internal post recovery state
Introduce a new internal, index shard level, post recovery state, where the shard moves to when its done with recovery. The shard will now move to started only once the cluster state with its respective cluster state level state is started.

This change allow to have more fine grained control over when to allow reads on a shard, resolving potential refresh temporal visibility aspects while indexing and issuign a refresh. By only allowing reads on started shards, and making sure we refresh right before we move to started
2013-09-24 15:38:12 +02:00
Boaz Leskes 10de3a7ecb Moved RecoverAfterNodesTests to inherit from AbstractIntegrationTest 2013-09-24 14:32:41 +02:00
Shay Banon 0422f75c8d improve search while relocation
- add verification phase at the end of the test
- add explicit test for 0 replicas and 1 replica
2013-09-24 13:10:41 +02:00
Shay Banon 4370dfed76 Update Operation might hang (rarely) when retrying on invalid shard state
The retry logic when failing does not reset the operation started flag...
closes #3769
2013-09-24 13:01:45 +02:00
Andrew Raines 917a3c3b9d Migrate createIndex(). 2013-09-23 17:04:54 -05:00
Simon Willnauer 26334a7a61 Reenable MockEngineModul as default on TestCluster 2013-09-23 22:17:21 +02:00
Andrew Raines 362c3f7895 One too many... 2013-09-23 15:09:35 -05:00
Andrew Raines 16cde6f10a Remove redundant wipeIndices(). 2013-09-23 15:03:06 -05:00
Simon Willnauer e4af8c720c cut over more tests to AbstractIntegrationTest 2013-09-23 18:18:36 +02:00
Andrew Raines 291cb54c95 Fix misspelling. 2013-09-23 11:06:33 -05:00
Simon Willnauer ac5120e722 cut over more tests to AbstractIntegrationTest 2013-09-23 15:53:42 +02:00
Martijn van Groningen 8eab51047f Cut RecoveryPercolatorTests over to AbstractIntegrationTest
Added node restart capabilities to TestCluster
Trigger retry mechanism (onFailure method) instead of invoking transport service with null DiscoveryNode when no DiscoveryNode can be found for a ShardRouting.
2013-09-23 00:19:33 +02:00
Shay Banon e7e39936b8 add internal origin to delete by query 2013-09-22 23:56:30 +02:00
Simon Willnauer 0f17a4c61f disable 'SearchWhileCreatingIndexTests' for now - fix is already in the pipeline 2013-09-22 22:45:39 +02:00
Simon Willnauer 5a365795ec Added support for dynamic transport client ratio in tests.
Currently tests only run with node clients but eventually we want to
run all tests with randomly choosen node / transport clients. To enable
this during development and on test servers as a transition phase this
commit adds the ability to allow a fraction of the clients used in
tests to be transport clients. By default this is still disabled.
To enable transport clients in tests pass '-Dtests.client.ratio=[0..1]'
where '1.0' will force transport clients and '0.0' completely disables
them. If an empty string is passed the ratio is chosen at random for
each test.
2013-09-22 22:25:30 +02:00
Shay Banon ab6715b292 move the internal source for a refresh to be required 2013-09-22 20:24:05 +02:00
Shay Banon 78af818d72 add internal source to acquire searcher
add a source indicating why the searcher was acquired
2013-09-22 18:29:23 +02:00
Shay Banon 167538ef0d add internal source to refresh
can be used to more easily understand where its coming from
2013-09-22 17:58:40 +02:00
Alexander Reelsen 57f962d620 Add completion field support in Rest nodes stats
Closes #3746
2013-09-22 15:02:05 +02:00
Simon Willnauer 0909055e83 Cleanup Integration Tests 2013-09-22 12:05:58 +02:00
Simon Willnauer 4b5935a708 Small cleanups in TransportClient et.al
Catching Throwable instead of Exception in TransportClient
and TransportClientNodesService and restore interrupted flag
if interrupt exception is caught and ignored
2013-09-22 12:05:57 +02:00
Simon Willnauer 58ea539a26 Add missing TransportHandler for clear_sc (ClearScroll) 2013-09-22 12:05:57 +02:00
Simon Willnauer cadbcfeb24 Call validate in TransportClients before request is send 2013-09-22 12:05:57 +02:00
Simon Willnauer c8192dd1f2 Fail GetIndexTemplate if names it null or empty 2013-09-22 12:05:57 +02:00
Simon Willnauer e1aa91dc81 Add listener nodes to nodes list if 'sniff' is true
TransportClient doesn't add the initial nodes to the nodes list
if it doesn't retrieve any nodes from the listeners which can cause
the transport client to throw a 'NoNodeAvailableException' if the
'sniff' response didn't return any nodes. This situation can occure
if the client tries to get the listener nodes cluster state while that
node is not yet connected to any other nodes.
2013-09-22 12:05:57 +02:00
Martijn van Groningen 7c032f6af6 Fixed serialisation bug for multi percolate request and response classes.
This bug manifests when running with transport client.
2013-09-22 12:01:27 +02:00
Shay Banon 74e8d299d6 fix log to trace 2013-09-22 03:19:08 +02:00
Luca Cavanna b28c82a1e6 Added @TestLogging to all methods to see which shards we refresh and which ones we search on
Increased wait timeout and added multiple iterations there as well, one is not enough. We want to verify whether the problem gets fixed later on.
2013-09-21 20:10:43 +02:00
Andrew Raines 953bbe4291 More AbstractIntegrationTest 2013-09-21 00:10:16 -05:00
Andrew Raines 6a18d05393 Add/fix index selectors.
Closes #3758.
2013-09-20 22:25:33 -05:00
Luca Cavanna 2ca1d79530 Moved SimpleIndexStateTests to AbstractIntegrationTest 2013-09-21 02:11:36 +02:00
Shay Banon c6eebf0515 don't clear gateways in reroute test
- also remove test logging from percolator
2013-09-21 01:55:11 +02:00
Luca Cavanna 52e9e753e6 Set nowInMillis to search context created by the explain api so that "NOW" can be used within queries
Added nowInMillis to ExplainRequest in a backwards compatible manner

Fixes #3626
2013-09-20 21:32:52 +02:00
Luca Cavanna 0d3895533c Set nowInMillis to search context created by the validate query api so that "NOW" can be used within queries
Added nowInMillis to ShardValidateQueryRequest in a backwards compatible manner

Fixes #3629
2013-09-20 21:32:13 +02:00
Luca Cavanna 06bfe0550d Set nowInMillis to search context created by the count api so that "NOW" can be used within queries
Added nowInMillis to ShardCountRequest in a backwards compatible manner

Fixes #3625
2013-09-20 21:31:00 +02:00
iksnalybok be35b44df1 Allow slop = -1 in span queries
Closes #3673
2013-09-20 21:19:31 +02:00
Simon Willnauer d662238221 Use node clients for now until tests stabelize 2013-09-20 20:26:09 +02:00
Martijn van Groningen 7ea21c75db Removed ClusterScope annotation 2013-09-20 19:25:50 +02:00
Martijn van Groningen 246752c1f4 Moved ConcurrentPercolatorTests over to AbstractIntegrationTest 2013-09-20 19:21:53 +02:00
Brusic ab05f929fe Allow the `_boost` field to be indexed and stored.
Closes #3752
2013-09-20 18:58:57 +02:00
Shay Banon a1185a93d0 fix javadoc 2013-09-20 16:56:33 +02:00
Martijn van Groningen bd6723f426 Removed usage AbstractIntegrationTest#updateClusterSettings 2013-09-20 16:36:46 +02:00
Martijn van Groningen 5558e884be Removed AbstractIntegrationTest#updateClusterSettings 2013-09-20 16:36:23 +02:00
Simon Willnauer e97aa9918a Cut over NoMasterNodeTests to AbstractIntegrationTest 2013-09-20 16:04:33 +02:00
Alexander Reelsen 1a34172a6c Changed SimpleBlocksTests and CustomHighlighterSearchTests to use AbstractIntegrationTest 2013-09-20 15:31:37 +02:00
Martijn van Groningen be2acaa629 fixed compile error 2013-09-20 15:30:05 +02:00
Martijn van Groningen 846b833539 - Added TestCluster#getInstances(Class) method. 2013-09-20 15:08:49 +02:00
Martijn van Groningen f6c2d9caf3 - Cut DeletePercolatorTypeTests and TTLPercolatorTests over to the AbstractIntegrationTest. 2013-09-20 15:08:06 +02:00
Shay Banon c3ecd6fd1b REST: Add newline to response when using pretty flag
closes #3748
relates to #3422
2013-09-20 14:55:35 +02:00
Alexander Reelsen 2624c90efb Using AbstractIntegrationTest in SimpleTTLTests and FunctionScorePluginTests 2013-09-20 13:36:50 +02:00
Simon Willnauer 30d7faeba2 Cut over more tests to AbstractIntegrationTest 2013-09-20 13:31:46 +02:00
Shay Banon b092a0dade use the same client and preference when failing 2013-09-19 18:58:07 +02:00
Luca Cavanna 46753122aa Log line set to TRACE
The default log level for the action package is DEBUG, we don't want to print out lines like this by default in our distribution.
2013-09-19 18:29:55 +02:00
Simon Willnauer 575d6b0321 Cleanup test classes and add Scope support for TestCluster
TestCluster can currently only be used in a globally shared scope.
This commit adds the ability to use the TestCluster in 3 different
scopes per test-suite. The scopes are 'Global', 'Suite' and 'Test'
where the cluster is shared across all tests, across all test methods or
not at all respectivly.
Subclasses of AbstractIntegrationTest (formerly AbstractSharedClusterTest)
can add an annotation if they need a different scope than Global (default):

```
  @ClusterScope(scope=Scope.Suite, numNodes=1)
```
This also allows to specify the number of shared nodes in that TestCluster
that are available when a test starts.

The cleanups in this commit include:

 - s/Elasticsearch/ElasticSearch/g on test classes
 - Move test classes in org.elasticsearch.test
2013-09-19 17:48:22 +02:00
Simon Willnauer de3cde3e1e Rename Engine#seacher() into Engine#acquireSearcher()
The name should reflect that the caller is responsible for
releaseing the searcher again.
2013-09-19 16:43:20 +02:00
Simon Willnauer 04deb80634 Add asserting searcher to track searcher references
This assertion module also injects an AssertingIndexSearcher that
checks if our queries are all compliant with the lucene specification
which is improtant for future updates and changes in the upstream project.
2013-09-19 16:21:45 +02:00
Shay Banon bb4f30c76c add explicit refresh post failure to test
log the hits post explicit refresh, and post explicit wait for green
2013-09-19 16:18:04 +02:00
Alexander Reelsen 8ab77651ad Added more information to assertion in completion suggest tests 2013-09-19 15:02:11 +02:00
Martijn van Groningen e68f99254b Make sure the transport response handler is invoked only once.
There was a small window of time where the transport response handler's handException method was invoked twice. As far as I can tell this happened when node disconnect event was processed just after the request was registered and between a "Node not connected" error was thrown. The TransportService#sendRequest method would invoke the transport response handler's handException method regardless if it was already invoked. This resulted that for one request failure, two retries were executed.

The mpercolate api has an assert that tripped when more than the expected shard level responses were returned. This was caused by the issue described above. For the a single shard level request we had multiple responses and this broke the the the total excepted responses. Also the reduce could be started prematurely, which resulted in an incorrect final response (e.g. total count being incorrect). For example: two shards in total, shard 0 gets reduces twice. The second shard 0 response gets in just before shard 1 response gets in. The reduce starts without shard 1 response.
2013-09-19 13:24:48 +02:00
Shay Banon 1581f25e27 Discovery to support a timeout waiting for other nodes to processing new cluster state
The master node processing changes to cluster state, and part of the processing is publishing the cluster state to other nodes. It does not wait for the cluster state to be processed on the other nodes before it moves on to the next cluster state processing job.

This is fine, we support out of order cluster state events using versioning, and nodes can handle those cases. It does lead though to non optimal API semantics. For example, when issuing cluster health, and waiting for green state, the master node will report back once the cluster is green based on its cluster state, but that mentioned "green" state might not have been received by all other nodes yet.

Add a discovery.zen.publish_timeout setting, and default it to 5s. This will give a best effort into making sure all nodes will process a cluster state within a window of time.

closes #3736
2013-09-19 13:09:24 +02:00
Luca Cavanna cf0c360f86 Prevented empty filters from causing NPE
Closes #3724
2013-09-18 20:29:01 +02:00
Simon Willnauer a26375ae25 Check if nodes have been shut down in TestCluster#beforeTest
The test cluster ignored randomly teared down nodes in tests.
This commit also adds some debug logging to the TestCluster#beforeTest
method.
2013-09-18 16:22:27 +02:00
Shay Banon 4eab186ce6 call ensureGreen instead of explicit call 2013-09-18 14:57:08 +02:00
Britta Weber 04c560ce9f GetActionTests: call ensureGreen() to get more meaningful debug output on failure 2013-09-18 14:33:02 +02:00
Britta Weber 995c55b861 call ensureGreen() to get more meaningful debug output on failure 2013-09-18 14:15:56 +02:00
Shay Banon 84242c208e improve failure message when timing out on green/yellow 2013-09-18 13:38:44 +02:00
Luca Cavanna 15cb0fd745 Removed wrong assertion from OpenCloseIndexTests
If a request hasn't been acknowledged, there's no guarantee for any node to hold the up-to-date cluster state (not even the master yet, as the execution is asynchronous)
2013-09-18 13:04:41 +02:00
Shay Banon db8f2be8bc improve logging on before/after shared cluster tests 2013-09-18 12:35:20 +02:00
Shay Banon 6a04c16932 Delete Template: When deleting with * and no templates exists, don't 404
closes #3723
2013-09-18 12:28:24 +02:00
Luca Cavanna 2d52973783 Added acknowledgment timeout test to OpenCloseIndexTests 2013-09-18 11:49:09 +02:00
Martijn van Groningen e84af5c8fd If there is an exception that indicates that the shard isn't available then the exception should bubble up to the TransportShardSingleOperationAction class, so the shard level request can be retried on a different shard. (multi get api) 2013-09-18 10:54:00 +02:00
Martijn van Groningen ae3f54bdb5 Don't wrap the exception in an ElasticSearchException when shard isn't available. 2013-09-18 10:53:34 +02:00
Martijn van Groningen f307336670 If there is an exception that indicates that the shard isn't available then the exception should bubble up to the TransportShardSingleOperationAction class, so the shard level request can be retried on a different shard. (multi term vector api) 2013-09-18 10:52:37 +02:00
Simon Willnauer 80b7377b29 Disable random ram directories to prevent OOM during tests.
We need to find a way to enable this without adding crazy heaps etc.
Maybe only selected tests can run this.
2013-09-18 08:28:41 +02:00
Simon Willnauer 81bd1f9fd2 Randomized SearchScanTests 2013-09-17 23:29:49 +02:00
Simon Willnauer 1499881c36 Simplify NestedFieldComparators for numerics
The average and sum comparators basically share the same code which is
copy-past today. We can simplify this into a base class which reduces
code duplication and prevents copy-paste bugs.
2013-09-17 23:07:36 +02:00
Simon Willnauer cabbf7805b Make TestCluster based integration tests more repoducible
While testing an async system providing reproducible tests that
use randomized components is a hard task we should at least try to
reestablish the enviroment of a failing test as much as possible.
This commit allows to re-establish the shared 'TestCluster' by
resetting the cluster to a predefined shared state before each test.

Before this commit a tests that is executed in isolation was likely
using a entirely different node enviroment as the failing test since
the 'TestCluster' kept intermediate nodes started by other tests around.
2013-09-17 23:07:29 +02:00
Clinton Gormley bf41f56f24 Added sort_mode and sortMode parameters to _geo_distance sort.
Previously it just support the "mode" parameter, which is
inconsistent

Closes #3717
2013-09-17 18:26:30 +02:00
Martijn van Groningen ca8b3ac0ba Don't throw set exception if it is an error based exception, this breaks how we deal with assertions in general. 2013-09-17 17:20:11 +02:00
Shay Banon ddc2b428d6 add 0.90.6 2013-09-17 15:04:48 +02:00
Simon Willnauer d45bf0b71e Print '-Des.x.y' properties in reproduce line 2013-09-17 14:28:51 +02:00
Costin Leau dcc45070bd Merge pull request #3702 from costin/master
add elasticsearch as a service for Windows platforms
2013-09-17 05:16:29 -07:00
Costin Leau 08bf131899 rework script to handle path with spaces
use service id for pid name
disable filtering on *.exe (caused corruption)
rename exe names and add more options to .bat
start/stop operations are now supported (and expected to be called) by service.bat
add more variables from the env to customize default behavior prior to installing the service
add manager option
fixes regarding batch flow
specify service id in description
minor readability improvement
include .exe only in ZIP archive
rename x64 service id to make it work out of the box
add elasticsearch as a service for Windows platforms
based on Apace Commons Daemon
supports both x64 and x86
2013-09-17 15:01:09 +03:00
Shay Banon cf30cb1caa Alias filter not applied when using 'multi-index' syntax with wild card in URL
closes #3677
2013-09-17 13:30:40 +02:00
Luca Cavanna 4013980b11 Serving cluster state version log line set to TRACE instead of DEBUG 2013-09-17 10:41:23 +02:00
Simon Willnauer dd8512ddd1 Autodetect indices when 'indexRandom' is used. 2013-09-17 09:22:25 +02:00
Simon Willnauer c18219e90d Create should use the same index name as the index request in tests 2013-09-17 09:02:49 +02:00
Shay Banon ae0489266e Add `node.mode` with `local` or `network`
Compared to setting node.local to true, would be nicer to support node.mode with values of local or network.

Note, node.local is still supported.

closes #3713
2013-09-17 00:34:10 +02:00
Simon Willnauer a6f14eb919 Beef up 'indexRandom' by running index requests concurrently 2013-09-17 00:06:13 +02:00
Shay Banon 8f7e3c8b53 Better handling of /_all/_search when no indices exist
closes #3710
2013-09-16 23:32:17 +02:00
Shay Banon c8a72d9768 FlushNotAllowedEngineException during optimize
default to wait if a flush is on going when executed as part of optimize request
closes #3631
2013-09-16 22:20:25 +02:00
Simon Willnauer da9aef60f4 Use 'indexRandom' in GeoDistanceTests 2013-09-16 21:57:44 +02:00
Luca Cavanna a1fb661df7 Fixed PluginManagerTests
It caused the deletion of the existing bin/plugin script when run from the IDE
2013-09-16 18:40:47 +02:00
Shay Banon e271177554 Plugins: Automatic detection of site plugins fails to copy over the content to `_site`
closes #3707
2013-09-16 18:12:51 +02:00
Shay Banon fd4ab5c3dc add 0.90.5 2013-09-16 18:12:51 +02:00
Simon Willnauer 5396d8e149 Copy slow in wrapped comparator even if root doc is the first doc in the
segment.

We missed to copy the slot if the root doc is the first doc in the
segment.

Closes #3706
2013-09-16 17:12:06 +02:00
Luca Cavanna a9e0f4d29d RecoveryWhileUnderLoadTests: added output of all shards stats in case of failure
Added wait to see if the problem will eventually get fixed or not in case of failure
2013-09-16 16:22:24 +02:00
Luca Cavanna c8bcdd0780 Replaced count api with search (search_type=count) in RecoveryWhileUnderLoadTests checks
This way we get the logging of all the shards we searched on
2013-09-16 16:22:24 +02:00
Britta Weber 86f147fc0b remove default scale for geo fields 2013-09-16 15:16:40 +02:00
Britta Weber 4938f09d8d allow origin not set, defaults to "now" for date fields, exception for all other types 2013-09-16 15:16:40 +02:00
Britta Weber f12fa0c1c4 allow no query is defined in function score, default is match all 2013-09-16 15:16:40 +02:00
Simon Willnauer 6c3e7d36c0 If cluster health times out don't index lots of documents
The SearchWithRandomExceptionTests aim to catch problems when resources
are not closed due to exceptions etc. Yet in some cases the random seeds
cause the index to never be fully allocated so we basically go into a
ping-pong state where we try to allocate shards back and forth on nodes.
This causes all docs to time out which in-turn causes the tests to run
for a very long time (hours or days).
If we can not allocate the index and get to a yellow state we simply
index only one doc and expected all searches to fail.

This commit also beefs up the assertions in this test to check if
documents are actually present if they are indexed and refresh was
successful.

Closes #3694
2013-09-16 14:12:41 +02:00
Simon Willnauer 85fcefc60d Allow include / exclude of completion stats via REST parameters
Stats can be retrieved on a per-feature / per-component  basis including the fields
they apply to. This commit add support for a 'completion' flag to include statistics
for the complition feature as well as 'completion_fields' to only
include certain fields into the returned statistics.
To disambiguate between 'fielddata' and 'completion' fields this commit
uses 'fields' as the default inclusion filter for stats fields only used
if not dedicated '[completion|fielddata]_fields' paramter is provided.

Relates to #3522
2013-09-16 11:28:32 +02:00
matthewarkin 6356ad2228 Debian init script: Added armhf openjdk6/7
Added java-6-openjdk-armhf and java-7-openjdk-armhf to JDK_DIRS in debian init.d script per elasticsearch/elasticsearch#3659

Closes #3659
2013-09-16 09:56:21 +02:00
Alexander Reelsen e0af9e2c09 Making debian init script bourne shell compatible
Using backticks instead of bash only $() to execute a shell command

Closes #3691
2013-09-16 09:46:43 +02:00
Britta Weber bc65e5c5b6 don't serialize unneeded filter 2013-09-16 09:40:23 +02:00
Shay Banon cd90382964 upgrade to google guava v 15 2013-09-16 09:14:00 +02:00
Britta Weber 3162eb4dcf defining filter is not always needed, we can assume match all if no filter is given 2013-09-16 00:30:03 +02:00
Shay Banon 20745adadd Add dedicated Suggest Thread Pool
Add a dedicated suggest thread pool for the suggest API. With the new completion suggest type, which is purely CPU bounded, it makes more sense to have a dedicated thread pool for suggest compared to having it share the search thread pool and "competing" against other search operations.
closes #3698
2013-09-15 01:54:27 +02:00
Shay Banon 4a97af3cd4 use static TL for common numeric precision values 2013-09-15 01:40:35 +02:00
Shay Banon 89e0b325c2 Briefly delete manifested mapping type on a node without reason
When a dynamic type is introduced during indexing, the node that introduces it sends the fact that its added to the master, to be added to the master node. The master node then adds it to the index metadata and republishes that fact.

In order not to delete the mapping while the new type is introduced on the node that introduced it, we keep a map of seen mappings, and remove a mapping type when we already processed it.

The map is not properly cleared though in all places where an actual index service is being removed on a node.

closes #3697
2013-09-14 22:42:53 +02:00
Britta Weber e58900145b tag with @AwaitsFix because it causes the test suite to crash
see #3694
Also, this might have caused one of the problems described in issue #3674
2013-09-14 11:51:34 +02:00
Shay Banon d6a3fc09f0 better logging
trace log the low level details on recovery
2013-09-13 22:46:04 +02:00
Shay Banon 056a678fa8 use built in flush/refresh helper methods 2013-09-13 22:06:12 +02:00
Shay Banon df3f681ef0 Optimize API: Remove refresh flag
Refresh flag in optimize is problematic, since the shards refresh is allowed to execute on is different compared to the optimize shards. In order to do optimize and then refresh, they should be executed as separate APIs when needed.
closes #3690
2013-09-13 21:44:38 +02:00
Shay Banon 7cc48c8e87 Flush API: remove refresh flag
Refresh flag in flush is problematic, since the shards refresh is allowed to execute on is different compared to the flush shards. In order to do flush and then refresh, they should be executed as separate APIs when needed.
closes #3689
2013-09-13 21:09:45 +02:00
Shay Banon 4298c50119 allow refresh to execute on a relocating shard as well 2013-09-13 20:03:58 +02:00
Simon Willnauer d9a055fe54 Add integration test for regex field data filter 2013-09-13 19:55:50 +02:00
Adrien Grand f03816ff07 Log failures at closing the SearcherManager. 2013-09-13 18:03:28 +02:00
Alexander Reelsen 26f9968b3b Allow packages to disable immediate restart on package upgrade
Both package types, RPM and deb now contain an option to not restart on upgrade.

This option can be configure in /etc/default/elasticsearch for dpkg based systems
and /etc/sysconfig/elasticsearch for rpm based systems.

By default the setting is as before, where a restart is executed on upgrade.

Closes #3685
2013-09-13 17:45:39 +02:00
Shay Banon ba6bc2a4df improve logging
the source of the default mappings should be trace logged
2013-09-13 17:38:57 +02:00
Shay Banon 455d0be982 improve visibility of clusterState and shardsIt
In case of retries, we update the clusterState and shardsIt, make sure they are visible using volatile (even though updates will probably go through a memory barrier, this might explain rare failure we see when retry happens)
2013-09-13 17:35:01 +02:00
Luca Cavanna f7ff272560 Improved test
Introduced ElasticsearchAssertions that check for failures in all response
Added comment to flush requests as we don't check for failures there
Attempt to remove Thread.sleep in testChangeInitialShardsRecovery in favour of awaitBusy block
Added awaitBusy block in testQuorumRecovery waiting for YELLOW. We could have GREEN after the close node but wa want to wait for the YELLOW state.
2013-09-13 16:39:08 +02:00
Luca Cavanna bb0baa20fb Removed wrong assertion that makes recoverWhileUnderLoadWithNodeShutdown fail.
As we are within an awaitBusy block, it doesn't make sense to have an assertion, since it would fail the test instead of waiting till the condition is verified (till timeout expires)
2013-09-13 16:39:08 +02:00
Shay Banon ea00e39ff1 use trace logging on cluster state driven indexing 2013-09-13 16:35:11 +02:00
David Pilato a2444e9494 Remove get index templates deprecated methods
In 0.90.4, we deprecated some code:

* `GetIndexTemplatesRequest#GetIndexTemplatesRequest(String)` moved to `GetIndexTemplatesRequest#GetIndexTemplatesRequest(String...)`
* `GetIndexTemplatesRequest#name(String)` moved to `GetIndexTemplatesRequest#names(String...)`
* `GetIndexTemplatesRequest#name()` moved to `GetIndexTemplatesRequest#names()`

* `GetIndexTemplatesRequestBuilder#GetIndexTemplatesRequestBuilder(IndicesAdminClient, String)` moved to  `GetIndexTemplatesRequestBuilder#GetIndexTemplatesRequestBuilder(IndicesAdminClient, String...)`

* `IndicesAdminClient#prepareGetTemplates(String)` moved to `IndicesAdminClient#prepareGetTemplates(String...)`

* `AbstractIndicesAdminClient#prepareGetTemplates(String)` moved to `AbstractIndicesAdminClient#prepareGetTemplates(String...)`

We can now remove that old methods in 1.0.

**Note**: it breaks the Java API

Relative to #2532.
Closes #3681.
2013-09-13 15:08:59 +02:00
David Pilato ea4988e9dc Support for REST get ALL templates.
/_template shows: No handler found for uri [/_template] and method [GET]

It would make sense to list the templates as they are listed in the /_cluster/state call.

Closes #2532.
2013-09-13 15:08:59 +02:00