Commit Graph

12301 Commits

Author SHA1 Message Date
Boaz Leskes 26d71fe00e Reduce shard inactivity timeout to 5m
To better distribute the memory allocating to indexing, the IndexingMemoryController periodically checks the different shard for their last indexing activity. If no activity has happened for a while, the controller marks the shards as in active and allocated it's memory buffer budget (but a small minimal budget) to other active shards. The recently added synced flush feature (#11179, #11336) uses this inactivity trigger to attempt as a trigger to attempt adding a sync id marker (which will speed up future recoveries).

We wait for 30m before declaring a shard inactive. However, these days the operation just requires a refresh and is light. We can be stricter (and 5m) increase the chance a synced flush will be triggered.

Closes #11479
2015-06-04 00:23:14 +02:00
Igor Motov 90cbf80fc4 Tests: remove race condition in the masterShutdownDuringSnapshotTest 2015-06-03 10:05:46 -10:00
Igor Motov f0e6addc53 Snapshot/Restore: sync up snapshot shard status on a master restart
When a snapshot operation on a particular shard finishes, the data node where this shard resides sends an update shard status request to the master node to indicate that the operation on the shard is done. When the master node receives the command it queues cluster state update task and acknowledges the receipt of the command to the data node.

The update snapshot shard status tasks have relatively low priority, so during cluster instability they tend to get stuck at the end of the queue. If the master node gets restarted before processing these tasks the information about the shards can be lost and the new master assumes that they are still in process while the data node thinks that these shards are already done.

 This commit add a retry mechanism that checks compares cluster state of a newly elected master and the current state of snapshot shards and updates the cluster state on the master again if needed.

Closes #11314
2015-06-03 09:02:04 -10:00
Simon Willnauer d621b160e9 Use the smallest version rather than the default version
The minimum version comparison was always using the default version
sicne the comparison was flipped.

Closes #11474
2015-06-03 20:56:28 +02:00
Simon Willnauer 7264fd4eb8 Fix possible BWC break after upgrading from pre 1.0.0
This is happening because of #4074 when we required that the top-level "query" is present to delete-by-query requests, but prior to that we required that it is not present. So the translog has a DBQ without "query" and when we try to parse it we hit this exception.

This commit adds special handling for pre 1.0.0 indices if we hit parse exception, we
try to reparse without a top-level query object to be BWC compatible for these indices.

Closes #10262

Conflicts:
	src/main/java/org/elasticsearch/index/shard/IndexShard.java
	src/test/java/org/elasticsearch/index/shard/IndexShardTests.java
2015-06-03 20:35:31 +02:00
Simon Willnauer aa248990bb Merge pull request #11468 from s1monw/cleanup_delete_by_query
Cleanup DeleteByQuery code from IndexShard
2015-06-03 20:05:33 +02:00
Alexander Reelsen b3779a03fc Test: Fix search query tests to use correct date, mark one test as awaitsfix 2015-06-03 19:01:29 +02:00
Alexander Reelsen 01e8eaf181 Date Parsing: Add parsing for epoch and epoch in milliseconds
This commit changes the date handling. First and foremost Elasticsearch
does not try to convert every date to a unix timestamp first and then
uses the configured date. This now allows for dates like `2015121212` to
be parsed correctly.

Instead it is now explicit by adding a `epoch_second` and `epoch_millis`
date format. This also means, that the default date format now is
`epoch_millis||dateOptionalTime` to remain backwards compatible.

Closes #5328
Relates #10971
2015-06-03 18:07:47 +02:00
Simon Willnauer 0f207bf4fb Cleanup DeleteByQuery code from IndexShard 2015-06-03 12:56:25 +02:00
Lee Hinman 5fd96d9371 [DOCS] Document the `index.shared_filesystem.recover_on_any_node` setting
Relates to #10960
Closes #11047
2015-06-03 12:35:25 +02:00
Tanguy Leroux a805cef045 Bulk: allow null values in action/metadata line parameters
Closes #11458
2015-06-03 12:20:41 +02:00
Ryan Ernst a3f51544d5 Merge pull request #11422 from rjernst/pr/fieldtype-mapper-split
Mappings: Refactor core index/query time properties into FieldType
2015-06-03 12:10:55 +02:00
Ryan Ernst 6598d82ae8 fix bad merge for parent field mapper, and change most field types to be
pkg-private and final
2015-06-03 12:10:23 +02:00
Ryan Ernst b625ddd17f Merge branch 'master' into pr/fieldtype-mapper-split 2015-06-03 11:37:41 +02:00
Igor Motov 59d9f7e157 Improve snapshot creation and deletion performance on repositories with large number of snapshots
Each shard repository consists of snapshot file for each snapshot - this file contains a map between original physical file that is snapshotted and its representation in repository. This data includes original filename, checksum and length. When a new snapshot is created, elasticsearch needs to read all these snapshot files to figure which file are already present in the repository and which files still have to be copied there. This change adds a new index file that contains all this information combined into a single file. So, if a repository has 1000 snapshots with 1000 shards elasticsearch will only need to read 1000 blobs (one per shard) instead of 1,000,000 to delete a snapshot. This change should also improve snapshot creation speed on repositories with large number of snapshot and high latency.

Fixes #8958
2015-06-02 12:22:21 -10:00
Lee Hinman c381a64c66 Add missing `shard` object in trace logging statement 2015-06-02 14:10:14 -06:00
Timur 6812ed0bb6 Docs: fix typo
Closes #112220
2015-06-02 19:42:45 +02:00
Shay Banon 740fe483bb Fail shard if search execution uncovers corruption
If, as part of the search execution, a corruption is uncovered, we should fail the shard
relates to #11419
2015-06-02 09:59:39 -07:00
Igor Motov 0b57f4611c Tests: Increase block timeout for snapshot to complete in batchingShardUpdateTaskTest
For a large number of shards in the test 10 seconds doesn't seem to be enough on some CI hardware.
2015-06-02 05:33:58 -10:00
jaymode f6191d05de add ability to prompt for selected settings on startup
Some settings may be considered sensitive, such as passwords, and storing them
in the configuration file on disk is not good from a security perspective. This change
allows settings to have a special value, `${prompt::text}` or `${prompt::secret}`, to
indicate that  elasticsearch should prompt the user for the actual value on startup.
This only works when started in the foreground. In cases where elasticsearch is started
as a service or in the background, an exception will be thrown.

Closes #10838
2015-06-02 09:38:07 -04:00
Lee Hinman a4e0ecc172 [TEST] Fix incorrect message in DiskThresholdDeciderTests 2015-06-01 15:45:26 -06:00
Lee Hinman bc179a735b Merge branch 'pr/11313' 2015-06-01 15:44:38 -06:00
jaymode d437135321 always normalize root paths during resolution of paths
Currently, when trying to determine if a location is within one of the configured repository
paths, we compare the root path against a normalized path but the root path is never
normalized so the check may incorrectly fail. This change normalizes the root path and
compares it to the other normalized path.

Relates to #11426
2015-06-01 15:10:42 -04:00
Kis Marcell 4261ee33c2 Issue #10588 Display low disk watermark to be consistent with
documentaiton

Change log entries, add convenience methods, unit tests

Correct allocation decision messages to display used space

Missed a word

Correct displayed threshold value
2015-06-01 20:58:46 +02:00
Britta Weber 4e206cd02d fix log message. exception first, parameters later 2015-06-01 16:38:48 +02:00
Colin Goodheart-Smithe ee08ab6c5c [TEST] fix failing script REST tests 2015-06-01 12:17:13 +01:00
Britta Weber d453699643 Merge pull request #11434 from brwe/open-search-contexts
search: release search contexts after failed dfs or query phase for d…
2015-06-01 13:15:51 +02:00
Robert Muir ec8ab8a109 Merge pull request #11433 from rmuir/cleanup_mlockall
Better error messages when mlockall fails
2015-05-31 21:16:10 -04:00
Martijn van Groningen 2c2f2fe16a Merge pull request #11436 from martijnvg/parent-child/bug/_parent_field_validation
parent/child: Fix `_parent.type` validation.
2015-05-31 13:30:26 +02:00
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
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
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