Commit Graph

12353 Commits

Author SHA1 Message Date
Simon Willnauer 05db5dc2c8 create parent pom project from its original location 2015-06-05 13:12:05 +02:00
Simon Willnauer 15a6244834 create core module 2015-06-05 13:12:03 +02:00
Simon Willnauer 7ccc193a66 Merge pull request #11488 from rmuir/pr/migration_script
[maven] reorganize the codebase
2015-06-05 13:11:08 +02:00
Simon Willnauer 63b6bcab70 Add repository migration step to preserve history 2015-06-05 12:37:21 +02:00
Adrien Grand b6842720be Merge pull request #8131 from jpountz/enhancement/top-level-meta-fields
Rest: Add all meta fields to the top level json document.
2015-06-05 09:15:13 +02:00
Adrien Grand 7c698146f5 Rest: Add all meta fields to the top level json document.
Some of our meta fields (such as _id, _version, ...) are returned as top-level
properties of the json document, while other properties (_timestamp, _routing,
...) are returned under `fields`. This commit makes all meta fields returned
as top-level properties.

So eg. `GET test/test/1?fields=_timestamp,foo` would now return

```json
{
   "_index": "test",
   "_type": "test",
   "_id": "1",
   "_version": 1,
   "_timestamp": 10000000,
   "found": true,
   "fields": {
     "foo": [ "bar" ]
   }
}
```

while it used to return

```json
{
   "_index": "test",
   "_type": "test",
   "_id": "1",
   "_version": 1,
   "found": true,
   "fields": {
     "_timestamp": 10000000,
     "foo": [ "bar" ]
   }
}
```
2015-06-04 23:42:17 +02:00
Robert Muir c6ce4221bc Merge branch 'master' into pr/migration_script 2015-06-04 16:38:06 -04:00
Robert Muir f5d7e61508 Defer mapper-attachments for now 2015-06-04 16:31:07 -04:00
Boaz Leskes 5f4c6b04c8 Internal: allows ActionListener to be called on the network thread
To protect  ourselves against running blocking operations on a network thread we have added an assertion that triggers that verifies that the thread calling a BaseFuture.get() is not a networking one. While this assert is good, it wrongly triggers when the get() is called in order to pass it's result to  a listener of AbstractListenableActionFuture who is marked to run on the same thread as the callee. At that point, we know that the operation has been completed and the get() call will not block.

To solve this, we change the assertion to ignore a get with a timeout of 0 and use that AbstractListenableActionFuture

Relates to #10402
Closes #10573

feedback
2015-06-04 22:29:17 +02:00
Boaz Leskes ea41ee9243 Recovery: restart recovery upon mapping changes during translog replay
In rare occasion, the translog replay phase of recovery may require mapping changes on the target shard. This can happen where indexing on the primary introduces new mappings while the recovery is in phase1. If the source node processes the new mapping from the master, allowing the indexing to proceed, before the target node does and the recovery moves to the phase 2 (translog replay) before as well, the translog operations arriving on the target node may miss the mapping changes. To protect agains this we now throw and catch an exception, so we can properly wait and retry when the next cluster state arrives.

Closes #11281
Closes #11363
2015-06-04 22:24:43 +02:00
Boaz Leskes 129d8ec29a ClusterHealth shouldn't fail with "unexpected failure" if master steps down while waiting for events
In order to wait for events of a certain priority to pass, TransportClusterHealthAction submits a cluster state update task. If the current master steps down while this task is in the queue, the task will fail causing the ClusterHealth to report an unexpected error.

We often use this request to ensure cluster stability in tests after disruption. However, depends on the nature of the failure it may happen (if we're unfortunate) that two master election rounds are needed. The above issues causes the get health request to fail after the first one. Instead we should try to wait for a new master to be elected (or the local node to be re-elected).

Closes #11493
2015-06-04 22:10:09 +02:00
Robert Muir 6ab3141021 java9 got a little dumber than java7 and java8 2015-06-04 15:59:31 -04:00
Simon Willnauer 6a90c64202 Minimize the usage of guava classes in interfaces, return types, arguments
Using these classes in interfaces forces downstream users to use shaded APIs.
We should minimize the usage of shaded APIs and keep them internal.
2015-06-04 21:22:16 +02:00
Michael McCandless 6dd6ce2f8f Merge pull request #11437 from mikemccand/require_units
Core: time-duration and byte-sized settings now require explicit units.

On upgrade, if there are any cluster or index settings that are missing units, a warning is logged and the default unit is applied.

Closes #7616 
Closes #10888
2015-06-04 14:03:23 -04:00
Michael McCandless e1197dfea9 Merge branch 'master' into require_units
Conflicts:
	src/main/java/org/elasticsearch/action/bulk/BulkRequest.java
	src/main/java/org/elasticsearch/cluster/metadata/MetaDataIndexUpgradeService.java
	src/main/java/org/elasticsearch/node/internal/InternalSettingsPreparer.java
	src/test/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreTests.java
2015-06-04 13:59:10 -04:00
Clinton Gormley a138f627be Docs: removed the unused query_dsl/index.asciidoc 2015-06-04 19:31:28 +02:00
Lee Hinman 65f43970da Default to binding to loopback address
Binds to the address returned by `InetAddress.getLoopbackAddress()`.

Closes #11300
2015-06-04 10:25:49 -06:00
Zachary Tong 2dfcefb02c Merge pull request #11465 from polyfractal/bugfix/movavg_double_predict
Aggregations: Fix bug where moving_avg prediction keys are appended to previous prediction
2015-06-04 11:22:04 -04:00
Zachary Tong d435fae067 Fix bug where predictions append to the previous prediction
Fixes #11454
2015-06-04 11:20:29 -04:00
Boaz Leskes 708320446e Doc: Minor typo fix in query_filter_context.asciidoc 2015-06-04 15:42:55 +02:00
Colin Goodheart-Smithe 39a20c3b5b Aggregations: Allow aggregation_binary to build and parse
Previously AggregationBuilder would wrap binary_aggregations in an aggregations object which would break parsing. This has been fixed so that for normally specified aggregations there are wrapped in an `aggregations` object, for binary aggregation which have the same XContentType as the builder it will use an `aggregations` field name and use the aggregationsBinary as the value (this will render the same as normal aggregations), and for binary aggregation with a different ContentType from the builder we use an `aggregations_binary` field name and add the aggregationsBinary as a binary value.

Additionally the logic in AggregationParsers needed to be changed as it previously did not parse `aggregations_binary` fields in sub-aggregations. A check has been added for the `aggregations_binary` field name and the binaryValue of this field is used to create a new parser and create the correct AggregatorFactories.

Close #11457
2015-06-04 12:52:14 +01:00
Clinton Gormley f85a17ff1a Docs: Fixed heading level for in query DSL docs 2015-06-04 13:16:32 +02:00
Simon Willnauer a522ddb4ac [TEST] Add more logging to allocation decision 2015-06-04 12:30:16 +02:00
Michael McCandless dae9750a83 regen back compat indices 2015-06-04 03:21:59 -04:00
Robert Muir f604182f8c Fix branch nuking 2015-06-04 01:02:02 -04:00
Robert Muir 1ff31ecf43 Don't bring in language plugins 2015-06-04 00:50:31 -04:00
Robert Muir 028cdde248 Use cp -R everywhere 2015-06-04 00:49:04 -04:00
Robert Muir 06a9df7cb8 Make migration script picky 2015-06-04 00:47:58 -04:00
Robert Muir 129d2b024e Remove plugins/ from gitignore 2015-06-04 00:45:33 -04:00
Clinton Gormley 171687d207 Docs: Reorganised the Query DSL docs into families and explaing query vs filter context 2015-06-04 01:59:37 +02:00
Michael McCandless 2c4d59584f only add units to a snapshot that was created before 2.0 2015-06-03 19:41:57 -04:00
Michael McCandless 3724756a1a cutover to getClass().getSimpleName() for settings names 2015-06-03 19:21:38 -04:00
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
Michael McCandless 0247846e89 remove/downgrade nocommits 2015-06-02 16:54:15 -04:00
Michael McCandless 9bee35c391 make logged warning more stern 2015-06-02 16:24:19 -04:00
Michael McCandless e3494d78a7 add more byte-sized tests; make byte-size parsing code similar to time value parsing 2015-06-02 16:22:00 -04:00