Commit Graph

13632 Commits

Author SHA1 Message Date
Martijn van Groningen 2fe7cde8d1 parent/child: Fix `_parent.type` validation.
A `_parent` field can only point to a type that doesn't exist yet.
The validation that checks this relied on have all mappings in the
MapperService. The issue is that this check is performed on the
elected master node and it may not have the IndexService at all
to perform this check. In that case it creates a temporary IndexService and
MapperService to perform mapping validation, but only the mappings
that are part of the put index call are created, not the already existing mappings.
Because of that the `_parent` field validation can't be performed.

By changing the validation to rely on the cluster state's IndexMetaData instead
we can get around the issue with the IndexService/MapperService on the elected
master node. The IndexMetaData always holds the MappingMetaData instances
for all types.
2015-05-31 13:20:49 +02:00
Britta Weber ff119f3dff send request to release search context in finally block to be on the save side 2015-05-31 12:48:56 +02:00
Britta Weber 7a082cea4f remove check for failure, might rarely not fail at all 2015-05-31 12:45:19 +02:00
Adrien Grand a70fd88d62 Tests: Disable random wrapping of index readers in IndexCacheableQueryTests until LUCENE-6500 is fixed. 2015-05-31 11:08:06 +02:00
Michael McCandless 3997ed012b fix test bugs 2015-05-30 18:09:44 -04:00
Michael McCandless 54a2ab9c03 add undocumented kill switch, to disable requiring units on byte size and time settings 2015-05-30 17:36:58 -04:00
Michael McCandless 062dbee955 also upgrade cluster state, on loading initially (MetaDataService.loadGlobalState) and on restore (RestoreService) 2015-05-30 17:28:27 -04:00
Simon Willnauer 1a6613b337 [TEST] Draw a new path if the random file name contains an illegal character 2015-05-30 22:40:38 +02:00
Robert Muir 56d269e075 Give specific instructions on Linux 2015-05-30 12:23:14 -04:00
Britta Weber b5ad1c257e search: release search contexts after failed dfs or query phase for dfs queries
When the dfs phase runs a SearchContext is created on each node that has a shard
for this query. When the query phase (or query and fetch phase) failed that SearchContext
was released only if the query was actually executed on the node. If for example
the query was rejected because the thread pool queue was full then the search context
was not released.
This commit adds a dedicated call for releasing the SearchContext in this case.

In addition, we must set the docIdsToLoad to null in case the fetch phase failed, otherwise
search contexts might not be released in releaseIrrelevantSearchContexts.

closes #11400
2015-05-30 17:52:51 +02:00
Robert Muir a95528e247 Don't ever print RLIM_INFINITY in a confusing way 2015-05-30 11:49:44 -04:00
Robert Muir b7163c4a71 Don't try to getrlimit unless we are sure we will get the right one 2015-05-30 11:33:19 -04:00
Robert Muir 1e5e36d48d Do the root check first, so resource limits arent confusing if you are root. 2015-05-30 11:20:20 -04:00
Robert Muir 74bb715689 code cleanups 2015-05-30 11:19:14 -04:00
Robert Muir 1020b321ce Add more debugging/error messages when mlockall fails 2015-05-30 11:17:16 -04:00
Martijn van Groningen d99b5dfdb4 test: use ElasticsearchTestCase#settings(Version) to test bwc behaviour instead of setting the version directly. 2015-05-30 11:50:25 +02:00
Simon Willnauer 5cc991d4e6 Remove leftover class, not needed anymore 2015-05-30 10:40:06 +02:00
Michael McCandless 68d6427944 add missing units to index settings if index was created before 2.0 2015-05-30 04:39:03 -04:00
Igor Motov 26aeeda310 Snapshot/Restore: Add support for applying setting filters when displaying repository settings
Currently all settings that were specified during repository creation are displayed. This commit enables  plugins such as cloud-aws to filter out sensitive settings from the repository.

Closes #11265
2015-05-29 13:32:44 -10:00
Shay Banon b9b13cd130 Reduce cluster update reroutes with async fetch
When using async fetch, we can end up with cluster updates and reroutes based on teh number of shards. While not disastrous we can optimize it, since a single reroute is enough to apply to all the async fetch results that arrived during that time.
2015-05-29 13:50:27 -07:00
Martijn van Groningen 359d9ac0d0 docs: added missing ids 2015-05-29 22:45:01 +02:00
Martijn van Groningen 1cfb6a79f1 Parent/child: refactored _parent field mapper and parent/child queries
* Cut the `has_child` and `has_parent` queries over to use Lucene's query time global ordinal join. The main benefit of this change is that parent/child queries can now efficiently execute if parent/child queries are wrapped in a bigger boolean query. If the rest of the query only hit a few documents both has_child and has_parent queries don't need to evaluate all parent or child documents any more.
* Cut the `_parent` field over to use doc values. This significantly reduces the on heap memory footprint of parent/child, because the parent id values are never loaded into memory.

Breaking changes:
* The `type` option on the `_parent` field can only point to a parent type that doesn't exist yet, so this means that an existing type/mapping can't become a parent type any longer.
* The `has_child` and `has_parent` queries can no longer be use in alias filters.

All these changes, improvements and breaks in compatibility only apply for indices created with ES version 2.0 or higher. For indices creates with ES <= 2.0 the older implementation is used.

It is highly recommended to re-index all your indices with parent and child documents to benefit from all the improvements that come with this refactoring. The easiest way to achieve this is by using the scan and bulk apis using a simple script.

Closes #6107
Closes #8134
2015-05-29 21:44:17 +02:00
Clinton Gormley bd381b86ca Release notes: Add HTML header with UTF-8 encoding 2015-05-29 21:02:38 +02:00
Colin Goodheart-Smithe a9ee78dd08 [TEST] muted ElasticsearchRestTestCase
This is because commit 35a58d874e causes the following REST tests to fail and reverting the commit causes conflicts:

update/15_script/Script
script/10_basic/Indexed script
2015-05-29 18:52:29 +01:00
Areek Zillur fb8cd53582 This commit removes the ability to use `filter` for PhraseSuggester collate.
Only `query` can be used for collation.

Internally, a collate query is executed as an exists query. So specifying a
filter does not have any benefits.
2015-05-29 12:26:08 -04:00
Colin Goodheart-Smithe 35a58d874e Scripting: Unify script and template requests across codebase
This change unifies the way scripts and templates are specified for all instances in the codebase. It builds on the Script class added previously and adds request building and parsing support as well as the ability to transfer script objects between nodes. It also adds a Template class which aims to provide the same functionality for template APIs

Closes #11091
2015-05-29 16:52:04 +01:00
Adrien Grand 0f3206e60c Merge pull request #11279 from jpountz/fix/simplify_compression
Internal: tighten up our compression framework.
2015-05-29 17:23:07 +02:00
Ryan Ernst 1f2c42fd0b Mappings: Refactor core index/query time properties into FieldType
Mappers are currently used at both index and query time for deciding
how to "use" a field.  For #8871, we need the index wide view of
mappings to have a unified set of settings for each field of a given
name within the index.

This change moves all the current settings (and methods defining
query time behavior) into subclasses of FieldType. In a future
PR, this will allow storing the field type at the index level,
instead of mappers (which can still have settings that differ
per document type).

The change is quite large (I'm sorry). I could not see a way to
migrate to this in a more piecemeal way. I did leave out cutting
over callers of the query methods to using the field type, as
that can be done in a follow up.
2015-05-29 17:07:04 +02:00
Adrien Grand b6a3952036 Internal: Use DEFLATE instead of LZF for compression.
LZF only stays for backward-compatibility reasons and can only read, not write.
DEFLATE is configured to use level=3, which is a nice trade-off between speed
and compression ratio and is the same as we use for Lucene's high compression
codec.
2015-05-29 17:01:45 +02:00
Christoph Büscher 29fbcd225b Merge pull request #11382 from cbuescher/fix/10825
Fix typed parameters in IndexRequestBuilder and CreateIndexRequestBuilder
2015-05-29 14:56:55 +02:00
Christoph Büscher c7ca64cc08 Fix typed parameters in IndexRequestBuilder and CreateIndexRequestBuilder
IndexRequestBuilder#setSource as well as CreateIndexRequestBuilder#setSettings and
CreateIndexRequestBuilder#setSouce() will not work with Map<String, String> argument
although the API looks like it should. This PR fixes the problem introducing correct
wildcard parameters and adds tests.

Closes #10825
2015-05-29 14:42:58 +02:00
Simon Willnauer 5a9694783b Consolidate shard level modules without logic into IndexShardModule
We have a lot of module classes that don't contain any actual logic,
only declarative bind actions. These classes are unnecessary and can
be consolidated into the already existings IndexShardModule
2015-05-29 14:16:34 +02:00
Britta Weber d23449ee85 [test] fix name in synced flush test 2015-05-29 13:48:37 +02:00
Spyros Kapnissis 784a26321b Query DSL: throw an exception if array passed to `term` query.
Closes #11246
Closes #11384
2015-05-29 13:40:15 +02:00
Simon Willnauer a7779d8e1d Merge pull request #11412 from s1monw/close_lock
Close lock even if we fail to obtain
2015-05-29 13:37:54 +02:00
Clinton Gormley 18c8394fbd REST spec: Renamed indices.flush.synced to indices.flush_synced 2015-05-29 12:30:43 +02:00
Adrien Grand 08ee4a87b3 Internal: tighten up our compression framework.
We have a compression framework that we use internally, mainly to compress some
xcontent bytes. However it is quite lenient: for instance it relies on the
assumption that detection of the compression format can only be called on either
some compressed xcontent bytes or some raw xcontent bytes, but nothing checks
this. By the way, we are misusing it in BinaryFieldMapper so that if someone
indexes a binary field which happens to have the same header as a LZF stream,
then at read time, we will try to decompress it.

It also simplifies the API by removing block compression (only streaming) and
some code duplication caused by some methods accepting a byte[] and other
methods a BytesReference.
2015-05-29 12:13:18 +02:00
Simon Willnauer c3c79290c6 Close lock even if we fail to obtain 2015-05-29 11:59:27 +02:00
Britta Weber a031232c48 [doc] remove reference to seal, was removed in #11336 2015-05-29 11:40:34 +02:00
Boaz Leskes 521f804c7d Mapping: add an assertion to verify consistent serialization
We recently run into two issues where mapping weren't serialized in a consistent manner (#10302 and #10318). We rely on this consistency to do a byte level checl that mappings we get from the master are indentical to the one we have locally. Mistakes here can cause endless refresh mapping loops.

This commit adds an assert that verifies this upon every update from the master.
2015-05-29 11:37:00 +02:00
Simon Willnauer e98b68a665 Prevent changing the number of replicas on a closed index
Setting the number of replicas on a closed index can leave the index
in an unopenable state since we might not be able to recover a quorum.
This commit simply prevents updating this setting on a closed index.

Closes #9566
2015-05-29 11:15:37 +02:00
Michael McCandless 6723c72716 make units required for byte size values 2015-05-29 05:04:24 -04:00
Simon Willnauer 5cd6ced7ee Close ShardFilterCache after Store is closed
The ShardFilterCache relies on the fact that it's
closed once the last reader on the shard is closed.
This is only guaranteed once the Store and all its
references are closed. This commit moves the closing
into the internal callback mechanism we use for deleting
shard data etc. to close the cache once we have all
searchers released.
2015-05-29 10:58:34 +02:00
Britta Weber 87a0c76e9c Merge remote-tracking branch 'boaz/index_seal_to_flush_sync' 2015-05-29 10:31:03 +02:00
Adrien Grand 6f002ffca8 Merge pull request #11381 from jpountz/fix/remove_unused_code
Internal: remove unused code.
2015-05-29 10:11:36 +02:00
Adrien Grand 1bf2a44044 Merge pull request #11308 from jpountz/fix/term_vs_terms_query
Search: Do not specialize TermQuery vs. TermsQuery.
2015-05-29 09:45:09 +02:00
Alexander Reelsen 5600757f3e Serialization: Remove old version checks
As the 2.x release does not need to be backwards compatible in terms of
serialization, we can remove a fair share of the serialization checks.
2015-05-29 08:28:45 +02:00
Igor Motov c695f35bca Tests: make REST upgrade test more reliable
Make sure that all shards are started to avoid flush conflicts.
2015-05-28 12:37:52 -10:00
Igor Motov 503f844a05 Tests: make randomRepoPath work with bwc tests 2015-05-28 12:37:51 -10:00
Lee Hinman 65132d5533 Merge remote-tracking branch 'dakrone/si-reading-fallback' 2015-05-28 16:31:44 -06:00