Commit Graph

5784 Commits

Author SHA1 Message Date
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
Clinton Gormley fd9f62b9b7 [DOCS] Added Cold Fusion client to community page 2013-09-13 16:20:38 +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
Britta Weber e3b826f87e add wait for green to prevent test failure 2013-09-13 14:50:51 +02:00
Clinton Gormley a6fffae6df Changed .gitignore to ignore all files in .settings except
for the ones that we want to preserve, to ensure a common
coding style between IDEA and Eclipse
2013-09-13 12:40:10 +02:00
Shay Banon d66d326ba9 mark test base classes as abstract 2013-09-13 12:14:52 +02:00
David Pilato e2400bc40e Fix possible NPE due to #3658 change 2013-09-13 11:49:16 +02:00
David Pilato b27e7d3cc9 Remove RestActions#splitXXX(String) methods
* `RestActions#splitIndices(String)`
* `RestActions#splitTypes(String)`
* `RestActions#splitNodes(String)`

And replace with `Strings.splitStringByCommaToArray(String)`

Closes #3680.
2013-09-13 11:36:43 +02:00
Clinton Gormley 17fb10689c The docs URLs have changed to include en/ 2013-09-13 11:23:37 +02:00
Clinton Gormley 9f59a85c26 Removed .settings from .gitignore - @jpountz intended
for it to be included to ensure consistent code styles
between eclipse and IDEA. Instead just ignore
the org.eclipse.m2e preferences
2013-09-13 09:29:06 +02:00
Igor Motov 714aaa40ea CompletionFieldMapper should use index name instead of full name
Fixes #3669
2013-09-12 17:39:03 -04:00
Simon Willnauer 507b6a6e8c Fix several places where resources are not closed
This commit adds a test that checks that we are closing
all files even if there are random IOExceptions happening. The test
found several places where due to IOExceptions streams were not
closed due to unsufficient exception handling.
2013-09-12 23:24:27 +02:00
Luca Cavanna 439413c626 Introduced common test methods in MatchedQueriesTests (e.g. createIndex, ensureGreen, refresh, assertHitCount) 2013-09-12 21:03:33 +02:00
Luca Cavanna 3a5b325b23 Added specific log level to check which shards were refreshed and which shards we searched on 2013-09-12 19:53:59 +02:00
Clinton Gormley d6ecdecc19 [DOCS] Deprecated the from/to/include_lower/include_upper params
in the range query, range filter and numeric range filter.
Better to use gt/gte/lt/lte as they are explicit.
2013-09-12 15:07:36 +02:00
David Pilato 169cd007b5 Fix typo
Thanks to @ybonnel for finding it ;-)
2013-09-12 11:00:59 +02:00
Martijn van Groningen 8ddb809f98 If all scroll ids should be removed then the `_all` value should be used instead of not specifying any scroll ids. 2013-09-12 10:41:38 +02:00
Martijn van Groningen 1fe72dcf56 Moved to use assertHitCount instead of just checking the total count 2013-09-12 10:25:42 +02:00
Martijn van Groningen d3aacba6c6 Set log level to trace for package action.support.broadcast in the RecoveryPercolatorTests#testSinglePercolator_recovery test. 2013-09-12 10:19:10 +02:00
Simon Willnauer fddb7420ae Add support for Lucene's MockDirectoryWrapper
MockDirectoryWrapper adds asserting logic to the low level directory
implementation that helps to track and catch resource leaks like
unclosed index inputs caused by dangling IndexReader or IndexSearcher
instances. It prevents double writes to files and allows low level
random exceptions to be thrown for testing index consistency etc.

Closes #3654
2013-09-11 22:47:34 +02:00
Simon Willnauer 0e936c99e3 Add -Dtests.integration support to pom.xml 2013-09-11 22:16:43 +02:00
Simon Willnauer c2675bac50 Added 'IntegrationTests' annotation to filter integration tests
Tests now support ignoring integartion tests by passing
'-Dtests.integration=false' to the test runner either via IDE or
maven to only run fast unittests.
2013-09-11 22:12:38 +02:00
Luca Cavanna ff54cba807 fixed typo in javadoc 2013-09-11 21:00:53 +02:00
Andrew Raines 6c9542d967 Fix misspellings. 2013-09-11 13:49:33 -05:00
Andrew Raines 7425b85b0b Collapse test.{unit,integration} into org.elasticsearch. 2013-09-11 12:49:49 -05:00
David Pilato b5c9807ba2 Reverting change in bin/plugin due to d3980ee184f11efcbd2b38421f4946de9198fe20 commit 2013-09-11 16:34:08 +02:00
Shay Banon bbce6e8588 Rare race condition when introducing new fields into a mapping
Dynamic mapping allow to dynamically introduce new fields into an existing mapping. There is a (pretty rare) race condition, where a new field/object being introduced will not be immediately visible for another document that introduces it at the same time.

closes #3667, closes #3544
2013-09-11 07:08:57 -07:00
Luca Cavanna 012797a82c Loggers#getLogger static method to take into account the logger prefix
Improved LoggingListener (which reads and applies @TestLogging annotation) to take into account the logger prefix. We can now use the @TestLogging annotation and specify either the whole package name (e.g. o.e.action.metadata) or only the package name without the logger prefix (action.metadata), the custom log level will be properly applied in both cases
2013-09-11 16:04:08 +02:00
Luca Cavanna daedf853a0 Removed logger prefixes when using @TestLogging annotation 2013-09-11 11:24:07 +02:00
Martijn van Groningen 1d8457394d Added more trace logging.
Enabled trace logging for RecoveryPercolatorTests#testMultiPercolator_recovery test
Cleaned up and removed unnecessary usage of concurrent collections.
2013-09-11 11:20:08 +02:00
Luca Cavanna 0b79ba9493 Rewrote SuggestResponse#toString method
It only prints out json now (as the SearchResponse does)
Added missing startObject & endObject (was causing JsonGenerationException)

Closes #3661
2013-09-10 22:33:51 +02:00
Martijn van Groningen 0efa78710b Added clear scroll api.
The clear scroll api allows clear all resources associated with a `scroll_id` by deleting the `scroll_id` and its associated SearchContext.

Closes #3657
2013-09-10 21:17:34 +02:00
David Pilato fafc4eef98 Plugin Manager: add silent mode.
Now with have proper exit codes for elasticsearch plugin manager (see #3463), we can add a silent mode to plugin manager.

```sh
bin/plugin --install karmi/elasticsearch-paramedic --silent
```

Closes #3628.
2013-09-10 18:31:35 +02:00
Britta Weber a91653cf1a change logging level of testTimeoutSendExceptionWithDelayedResponse to TRACE 2013-09-10 17:19:26 +02:00
Luca Cavanna 4032f1eb44 Configured TRACE logging to RecoveryWhileUnderLoadTests#recoverWhileUnderLoadAllocateBackupsTest
We want to log which shards we are searching on and which shards we are refreshing
2013-09-10 14:28:59 +02:00
Britta Weber 7c20603071 use ElasticsearchAssertions to get info on shard failures 2013-09-10 12:13:37 +02:00
Simon Willnauer 5c00dc5773 Rename IndexShard#searcher() to #acquireSearcher()
Based on recent bugs ( #3652 ) where searchers were acquired multiple times
but never released 'IndexShard#searcher()' has not a more accurate name.

Closes #3653
2013-09-09 21:21:27 +02:00
Simon Willnauer 777d7f47a5 Catch ESRejectedExecutionException on node close
When a node shuts down thread pools might throw
ESRejectedExecutionException and our test framework fails tests if
exceptions are not caught hitting uncaught exception handler.
2013-09-09 21:21:27 +02:00
David Pilato 764aa54f2d Plugin Manager should support -remove group/artifact/version naming
When installing a plugin, we use:

```sh
bin/plugin --install groupid/artifactid/version
```

But when removing the plugin, we only support:

```sh
bin/plugin --remove dirname
```

where `dirname` is the directory name of the plugin under `/plugins` dir.

Closes #3421.
2013-09-09 21:17:16 +02:00
Brad Fritz f3c0e39380 key is "index.store.type", not "index.storage.type" 2013-09-09 13:06:09 -04:00
Simon Willnauer 76cc8c3549 Only pull searcher once during completion stats
The inner call to the completion stats pulled a second searcher
that never got released causing the underlying readers to never
get closed unless the node is shut down. This was triggered
with literally each stats call including the completion stats
even if no completion service was used on the index.

Closes #3652
2013-09-09 17:50:41 +02:00
Lee Hinman 7d52d58747 Add AllocationDecider that takes free disk space into account
This commit adds two main pieces, the first is a ClusterInfoService
that provides a service running on the master nodes that fetches the
total/free bytes for each data node in the cluster as well as the
sizes of all shards in the cluster. This information is gathered by
default every 30 seconds, and can be changed dynamically by setting
the `cluster.info.update.interval` setting. This ClusterInfoService
can hopefully be used in the future to weight nodes for allocation
based on their disk usage, if desired.

The second main piece is the DiskThresholdDecider, which can disallow
a shard from being allocated to a node, or from remaining on the node
depending on configuration parameters. There are three main
configuration parameters for the DiskThresholdDecider:

`cluster.routing.allocation.disk.threshold_enabled` controls whether
the decider is enabled. It defaults to false (disabled). Note that the
decider is also disabled for clusters with only a single data node.

`cluster.routing.allocation.disk.watermark.low` controls the low
watermark for disk usage. It defaults to 0.70, meaning ES will not
allocate new shards to nodes once they have more than 70% disk
used. It can also be set to an absolute byte value (like 500mb) to
prevent ES from allocating shards if less than the configured amount
of space is available.

`cluster.routing.allocation.disk.watermark.high` controls the high
watermark. It defaults to 0.85, meaning ES will attempt to relocate
shards to another node if the node disk usage rises above 85%. It can
also be set to an absolute byte value (similar to the low watermark)
to relocate shards once less than the configured amount of space is
available on the node.

Closes #3480
2013-09-09 09:49:30 -06:00
Luca Cavanna 563111f0f9 Fixed typo: renamed test wamer package to warmer 2013-09-09 14:24:21 +02:00
Luca Cavanna 8ad583b35e Fixed typo: renamed test.listerners package to test.listener 2013-09-09 14:24:21 +02:00