Commit Graph

11344 Commits

Author SHA1 Message Date
Christoph Büscher 285941f0d3 Removed unused import 2015-04-01 12:02:21 +02:00
Christoph Büscher fc04967eda Core: Remove potential NPE while resolving concrete indices from MetaData
Prevents a current edge case resolving concrete aliases or index names in cluster MetaData
that could potentialy lead to NullPointerException when the IndicesOptions don't allow
wildcard expansion and the method is called with aliasesOrIndices argument null or emtpy list.
This change adds a check for that and introduces randomized test that catches this.

Closes #10342
Closes #10339
2015-04-01 10:59:09 +02:00
Lucas Chi 7d08940c78 [DOCS] Update readme with direct link to the upgrade section 2015-04-01 10:40:48 +02:00
Martijn van Groningen 1c162ed34a inner hits: Fix bug where parse error is thrown if a inner filter is used in a nested filter/query.
Closes #10308
2015-03-31 22:44:39 +02:00
Boaz Leskes 54bfe53d51 Merge pull request #10349 from DavidWittman/typo-recovery-after-time
Fix typos for gateway.recover_after_time
2015-03-31 22:03:04 +02:00
David Wittman 3acf4ccb33 Fix typos for gateway.recover_after_time
There were a few references to the setting
`gateway.recovery_after_time`, which should instead be
`gateway.recover_after_time`.
2015-03-31 14:00:08 -05:00
Adrien Grand 9c1c335d02 Search contexts should not automatically be closed when scrolling.
Related to #9296
2015-03-31 20:10:09 +02:00
Britta Weber 567a50c29b [function_score] apply min_score to sub query score if no function provided
For optimization pruposes a function score query with an empty function
will just result in the original sub query. However, sometimes one might
want to use function_score query to actually filter out docs within for example
bool clauses by using the min_score functionallity.
Therefore the sub query should only be used without wrapping inside
a function_score query if min_score was also not set.

closes #10253
closes #10326
2015-03-31 16:16:53 +02:00
Britta Weber 17dffe222b [store] make sure shard active request works even if shard is still in post recovery
When deleting a shard th node that deletes th shard first checks if all shard copies are
started on other nodes. A message is sent to each node tand each node checks locally for
STARTED or RELOCATED.
However, it might happen that the shard is still in state POST_RECOVERY, like this:

shard is relocating from node1 to node2
1. relocated shard on node2 goes in POST_RECOVERY and node2 sends shard started to master
2. master updates routing table and sends new cluster state to node1 and node2
3. node1 processes the cluster state and asks node2 if it has the active shard
  before node2 processes the new cluster state (which would cause it to set the shard to started)
4. node2 sends back it does not have the shard started and so node1 does not delete it

This can be avoided by waiting until cluster state that sets the shard to started is actually processed.

closes #10018
2015-03-31 15:42:07 +02:00
Adrien Grand 8d204846df Remove leftover println. 2015-03-31 15:00:18 +02:00
Simon Willnauer 78d86bcf41 [STATE] Refactor state format to use incremental state IDs
Today there is a chance that the state version for shard, index or cluster
state goes backwards or is reset on a full restart etc. depending on
several factors not related to the state. To prevent any collisions
with already existing state files and to maintain write-once properties
this change introductes an incremental state ID instead of using the plain
state version. This also fixes a bug when the previous legacy state had a
greater version than the current state which causes an exception on node
startup or if left-over files are present.

Closes #10316
2015-03-31 14:17:07 +02:00
javanna ff6b605778 [TEST] fix SearchScrollTests, scroll doesn't support searchType count 2015-03-31 14:05:33 +02:00
javanna 83fb0a10e5 Scripting: remove support for script.disable_dynamic setting
Now that fine-grained script settings are supported (#10116) we can remove support for the script.disable_dynamic setting.

Same result as `script.disable_dynamic: false` can be obtained as follows:

```
script.inline: on
script.indexed: on
```
An exception is thrown at startup when the old setting is set, so we make sure we tell users they have to change it rather than ignoring the setting.

Closes #10286
2015-03-31 13:24:52 +02:00
Adrien Grand 7a595d7911 IndicesQueryCacheTests: Fix test bug.
The query cache is disabled on dfs_query_then_fetch so we need to enforce
query_then_fetch instead of relying on the randomized search type set by the
test framework.
2015-03-31 12:28:02 +02:00
Adrien Grand 0a6be2c111 Merge pull request #9296 from jpountz/enhancement/remove_count_search_type
Search: Merge `search_type=count` and `size=0`.

Close #9226
2015-03-31 11:36:38 +02:00
Adrien Grand a608db122d Search: Remove the `count` search type.
This commit brings the benefits of the `count` search type to search requests
that have a `size` of 0:
 - a single round-trip to shards (no fetch phase)
 - ability to use the query cache

Since `count` now provides no benefits over `query_then_fetch`, it has been
deprecated.

Close #7630
2015-03-31 11:31:49 +02:00
Adrien Grand 171e415a47 Tests: Assert that we do not leak SearchContexts.
Even if there is a background thread that periodically closes search contexts
that seem unused (every minute by default), it is important to close search
contexts as soon as possible in order to not keep unnecessary open files or
to prevent segments from being deleted.

This check would help ensure that refactorings of the SearchContext management
like #9296 are correct.
2015-03-31 11:31:49 +02:00
Patrick Peschlow be93884538 Update scripting.asciidoc
change description to better fit the flag name
2015-03-31 09:26:40 +02:00
Patrick Peschlow a9af488bb3 Update prefix-filter.asciidoc
text said phrase instead of prefix, probably due to copy-paste
2015-03-31 09:25:15 +02:00
Igor Motov 96f4c06f46 Automatically add "index." prefix to the settings are changed on restore if the prefix is missing
Closes #10133
2015-03-30 17:39:11 -04:00
Michael McCandless b00b2b9baa fix test concurrency bug 2015-03-30 17:39:41 -04:00
Lee Hinman 1cb169afb4 Add ability to launch bootstrapped ES using maven
This adds the exec-maven-plugin that allows a developer to run:

```
mvn exec:exec
```

To launch the `Bootstrap` process similar to the way that a Java IDE
would. All the logs go to logs/elasticsearch.log (or wherever
configured)
2015-03-30 11:07:21 -06:00
jaymode a2addaf320 Netty: add getter for channel in NettyTransportChannel
Adds a getter for the actual netty channel in NettyTransportChannel. The
channel can be used by plugins that need access into netty when processing
requests.
2015-03-30 12:41:57 -04:00
jaymode 77418ecdbd [TEST] move FakeRestRequest to org.elasticsearch.test.rest
FakeRestRequest is used by a few tests and can also be leveraged by
tests outside of elasticsearch. Moving the package will mean the class
gets exported as part of the test jar.
2015-03-30 12:01:44 -04:00
Michael McCandless 87aa39a0d2 Core: deletions (alone) should also force a refresh when version map is using too much RAM
We already force a refresh in index/create ops, to clear version map
when it's using too much RAM, but we were failing to do this for
deletes, so an app that does tons of deletes with no indexing, and has
set refresh_interval to -1, would have version map using unbounded
RAM.

Closes #10312
2015-03-30 10:25:55 -04:00
Boaz Leskes 1200d8e647 Recovery: RecoveryState.File.toXContent reports file length as recovered bytes
Closes #10310
2015-03-30 16:12:37 +02:00
Boaz Leskes fd3b01d810 Internal: don't try to send a mapping refresh if there is no master
After processing mapping updates from the master, we compare the resulting binary representation of them and compare it the one cluster state has. If different, we send a refresh mapping request to master, asking it to reparse the mapping and serialize them again. This mechanism is used to update the mapping after a format change caused by a version upgrade.

The very same process can also be triggered when an old master leaves the cluster, triggering a local cluster state update. If that update contains old mapping format, the local node will again signal the need to refresh, but this time there is no master to accept the request. Instead of failing (which we now do because of #10283, we should just skip the notification and wait for the next elected master to publish a new mapping (triggering another refresh if needed).

Closes #10311
2015-03-30 15:24:00 +02:00
Adrien Grand bd79f40152 Merge pull request #9595 from jpountz/test/context_closed
Tests: Assert that we do not leak SearchContexts.

Close #9595
2015-03-30 14:16:58 +02:00
olivier bourgain 00a9db73ae [DOCS] Fix multi percolate response sample in percolate.asciidoc 2015-03-30 11:32:41 +02:00
Adrien Grand a1505e7164 Tests: Assert that we do not leak SearchContexts.
Even if there is a background thread that periodically closes search contexts
that seem unused (every minute by default), it is important to close search
contexts as soon as possible in order to not keep unnecessary open files or
to prevent segments from being deleted.

This check would help ensure that refactorings of the SearchContext management
like #9296 are correct.
2015-03-30 10:39:08 +02:00
Adrien Grand 80fe8d1f72 Merge pull request #10307 from obourgain/fix_parsing_multipercolate
Fix wrong use of currentFieldName outside of a parsing loop.

Close #10307
2015-03-30 10:08:03 +02:00
olivier bourgain 7a5e3c1b1d fix wrong use of currentFieldName outside of a parsing loop 2015-03-29 18:35:21 +02:00
javanna 38ec5084a5 [TEST] resolved compiler warnings in ShapeBuilderTests and GeoPointParsingTests 2015-03-29 11:49:36 +02:00
Sebastian Monte 9a29705c49 Fix errors reported by error-prone
I compiled elasticsearch with error-prone
(https://github.com/google/error-prone). This commit fixes the 13
errors reported by the tool.
2015-03-29 11:43:56 +02:00
javanna 0beda40069 [DOCS] added table with supported scripting languages to scripting docs 2015-03-29 11:28:50 +02:00
Martijn van Groningen 6d1a1b328b Make sure that the parent option on the update request only is delgated to upsert index request.
Closes #4538
2015-03-28 08:53:11 +01:00
Martijn van Groningen 75713f4190 Reverted commit: 20f7be3 2015-03-28 08:53:11 +01:00
Martijn van Groningen d78159fee1 Added lost comment 2015-03-28 08:52:39 +01:00
Martijn van Groningen 16d8f3ce81 aggs: Fix 2 bug in `children` agg
1) multiple nested children aggs result in a NPE
2) fixed a counting bug where the same readers where post collected twice

Closes #10158
2015-03-28 08:43:40 +01:00
Martijn van Groningen 3df3259a74 inner_hits: Fix nested stored field support.
This also fixes a NPE when the nested part has been filtered out of the _source, because of _source filtering.

Closes #9766
2015-03-28 08:02:30 +01:00
Britta Weber ccf5482956 [TEST] muste test and add issue number 2015-03-27 17:35:38 +01:00
Shay Banon 6181d8ecde Fail shard when index service/mappings fails to instantiate
When the index service (which holds shards) fails to be created as a result of a shard being allocated on a node, we should fail the relevant shard, otherwise, it will remain stuck.
Same goes when there is a failure to process updated mappings form the master.

Note, both failures typically happen when the node is misconfigured (i.e. missing plugins, ...), since they get created and processed on the master node before being published.
closes #10283
2015-03-27 16:58:24 +01:00
javanna 71bd40517d [TEST] remove GlobalScopeClusterTests
We removed the global ClusterScope a while ago, its related test can be removed too.
2015-03-27 15:04:42 +01:00
Tanguy Leroux c19b7a2f61 Fix thread leak in Hunspell service
An unchecked exception might be thrown when instantiating the HunspellService, leading to thread leaks in tests.

Closes #9849
2015-03-27 09:50:11 +01:00
Ryan Ernst 5b0512fcc3 Fix BigLongArray.fill to account for an empty range 2015-03-27 00:43:40 -07:00
Clinton Gormley 743758ce64 Updated version in docs to use 1.5.0 2015-03-27 08:58:13 +02:00
Ryan Ernst e0334dcb9e Core: Enable doc values by default, when appropriate
Doc values significantly reduced heap usage, which results in faster
GCs. This change makes the default for doc values dynamic: any
field that is indexed but not analyzed now has doc values. This only
affects fields on indexes created with 2.0+.

closes #8312
closes #10209
2015-03-26 22:42:35 -07:00
Britta Weber 3f459f69a7 [TEST] wait for mapping, cluster state might not be up to date yet 2015-03-27 00:51:19 +01:00
Britta Weber edb6319cea [mappings] update dynamic fields in mapping on master even if parsing fails for the rest of doc
The local DocumentMapper is updated while parsing and dynamic fields are added before
parsing has finished. If parsing fails after a dynamic field has been added already
then the field was not added to the cluster state but was present in the local mapper of this
node. New documents with the same field would not necessarily cause an update either and
after restarting the node the mapping for these fields were lost. Instead the new fields
should always be updated.

closes #9851
closes #9874
2015-03-26 21:06:00 +01:00
javanna 425ea5bca6 [DOCS] removed coming tags from scripting docs 2015-03-26 20:22:20 +01:00