Commit Graph

162 Commits

Author SHA1 Message Date
Simon Willnauer c57951780e Simplify ShardRouting abstraction
This commit folds ShardRouting, ImmutableShardRouting and MutableShardRouting
into ShardRouting. All mutators are package private anyway today so it's just
unnecessary abstraction.
ShardRoutings are now frozen once they are added to the IndexRoutingTable
to prevent modifications outside of the allocation code.
2015-06-24 14:35:57 +02:00
Adrien Grand aaa9ee35ea Add tests to XContentParser.list(). 2015-06-24 12:03:15 +02:00
Jörg Prante 411a719a86 add list parse methods to XContentParser 2015-06-24 11:41:22 +02:00
Adrien Grand 04968d72a1 Remove XContentParser.map[Ordered]AndClose().
It is a bit weird to have an API to read a map then close the parser.
2015-06-24 11:10:30 +02:00
Adrien Grand 121a699261 Merge pull request #11816 from jpountz/enhancement/return_metadata
Always return metadata in get/search APIs.
2015-06-24 10:32:53 +02:00
Adrien Grand e4d475c700 Always return metadata in get/search APIs.
This commit makes the get and search APIs always return `_parent`, `_routing`,
`_timestamp` and `_ttl` in addition to `_id` and `_type`. This way, consumers
always have all required information in order to reindex a document.
2015-06-24 10:22:14 +02:00
Adrien Grand 29ec4e015d Merge pull request #11843 from dpursehouse/immutable-settings-update
Replace references to ImmutableSettings with Settings
2015-06-24 08:33:20 +02:00
Adrien Grand ea175492b0 Merge pull request #11833 from jpountz/fix/smaller_filter_cache
Give the filter cache a smaller maximum number of cached filters.
2015-06-24 08:23:26 +02:00
David Pursehouse b49e66c3a1 Replace references to ImmutableSettings with Settings
ImmutableSettings was merged into Settings in commit 4873070.

Change-Id: I06bd0150381d131593920c2328c46beacf49661f
2015-06-24 14:54:53 +09:00
Igor Motov f379a13fb4 Extract all shard-level snapshot operation into dedicated SnapshotShardsService
Currently the SnapshotsService is concerned with both maintaining the global snapshot lifecycle on the master node as well as responsible for keeping track of individual shards on the data nodes. This refactoring separates two areas of concerns by moving all shard-level operations into a separate SnapshotShardsService.

Closes #11756
2015-06-23 18:01:32 -04:00
Adrien Grand f29bf63fa8 Give the filter cache a smaller maximum number of cached filters.
Currently the filter cache is configured to have a maximum size in bytes of 10%
of the JVM memory, and a maximum number of cached filters (across all segments
of all shard on the same node) of 100000. I would like to change the latter to
a more reasonable value of 1000.

Given that we track the most 256 most recently used filters per index and only
cache those that have been seen 5 times or more, a single index cannot have more
than 50 hot filters, so a maximum number of cached filters of 1000 per node
should be more than necessary.
2015-06-23 17:44:07 +02:00
Shay Banon 435ce7f251 Remove scheduled routing
Today, we have scheduled reroute that kicks every 10 seconds and checks if a
reroute is needed. We use it when adding nodes, since we don't reroute right
away once its added, and give it a time window to add additional nodes.

We do have recover after nodes setting and such in order to wait for enough
nodes to be added, and also, it really depends at what part of the 10s window
you end up, sometimes, it might not be effective at all. In general, its historic
from the times before we had recover after nodes and such.

This change removes the 10s scheduling, simplifies RoutingService, and adds
explicit reroute when a node is added to the system. It also adds unit tests
to RoutingService.

closes #11776
2015-06-23 17:21:09 +02:00
Simon Willnauer 49bbc42ac8 Encapsualte common code in methods
This commit groups duplicated code in methods to make the actual decision
easier to read. There is no change in functionality in this change.
2015-06-23 15:48:52 +02:00
Martijn van Groningen fe330b868a percolator: Fail nicely if `nested` query with `inner_hits` is used in a percolator query.
Closes #11672
2015-06-23 15:03:31 +02:00
Colin Goodheart-Smithe f26311e88b Aggregations: Rename `series_arithmetic` agg to `bucket_script` 2015-06-23 14:00:17 +01:00
Simon Willnauer 79f3e78ce2 Log warn message if leftover shard is detected 2015-06-23 14:36:57 +02:00
Tanguy Leroux 95caa73518 [Packaging] Fix missing dependencies for RPM/DEB packages
Since elasticsearch doesn't shade artifacts anymore (see #11522), the dependencies list for RPM/DEB must be updated. Now we package all maven libs by default except the generated -shaded/-tests/-test-cours JARs and slf4j-api (marked as optionnal).
2015-06-23 13:16:16 +02:00
Shay Banon 15d799361b Set randomized node/index settings in the right place
Don't set node settings in the index template, and try and set less index settings in the node settings
closes #11767
2015-06-23 13:11:17 +02:00
Clinton Gormley 4c48f51500 Deleted slf4j.* from licenses/
Although it is in the target/lib/ directory, slf4j is not included in the
ZIP/tar files
2015-06-23 12:50:31 +02:00
Simon Willnauer e97d3d8a49 Fix typo 2015-06-23 11:00:39 +02:00
javanna b78211ddaa Java api: make BoostableQueryBuilder public again
FunctionScoreQueryBuilder is outside of the index.query package, missed that in my previous commit.
2015-06-23 10:01:39 +02:00
javanna 99dee81d76 Java api: make BoostableQueryBuilder package private 2015-06-23 09:32:24 +02:00
javanna 90a7b4868e Java api: add missing boost support to TermsQueryBuilder
Relates to #11744
Closes #11810
2015-06-23 09:26:10 +02:00
javanna e7702468a2 Java api: add missing boost support to GeoShapeQueryBuilder
Relates to #11744
Relates to #11810
2015-06-23 09:25:53 +02:00
Boaz Leskes 1df2d3015e Add OS name to _nodes and _cluster/nodes
we currently don't expose this.

This adds the following to the OS section of `_nodes`:

```
"os": {
     "name": "Mac OS X",
     ...
 }
 ```

 and the following to the OS section of `_cluster/stats`:

 ```
      "os": {
         ...
          "names": [
             {
                "name": "Mac OS X",
                "count": 1
             }
          ],
          ...
       },
 ```

Closes #11807
2015-06-22 20:36:29 +02:00
Ryan Ernst 12e7cbe92b Mappings: Lockdown _timestamp
This is a follow up to #8143 and #6730 for _timestamp. It removes
support for `path`, as well as any field type settings, and
enables docvalues for _timestamp, for 2.0.  Users who need to
adjust these settings can use a date field.
2015-06-22 10:21:03 -07:00
Zachary Tong 5d94febcb1 Aggregations: Moving average forecasts should not include current datapoint.
- Fixes tests, and removes a few special snowflake, fragile tests.
- Removes concrete implementation of predict() and moves it into
  each model so that the logic is clearer.  Because there is some
  shared checks/assertions, those remain in predict() and the main
  prediction happens in doPredict()
2015-06-22 11:13:35 -04:00
Alexander Reelsen eb23530e06 Internal: Readd accidental removed functionality in InternalClusterService
The commit about adding cluster health response features also removed
accidentally some functionality, that resulted in wrong instanceof checks
in InternalClusterService and thus in test failures because the cluster
state task that was added via an anonymous was missing the cast.

This commit readds the abstract class with slight renaming.

Commit id was: 88f8d58c8b
2015-06-22 16:34:02 +02:00
Simon Willnauer 1f3670733a Load percolator queries before shard is marked POST_RECOVERY
If we mark the shard as being in POST_RECOVERY before the percolator
is fully set up we might expose it to the user as fully searchable before
all queries are loaded. This can lead to wrong results especially in tests
when a shard is concurrently marked as STARTED.

This commit also removes unneded abstractions on IndexShard where readoperations
should be allowed when the purose is a write.
2015-06-22 16:23:27 +02:00
Shay Banon 55c55677a3 Remove reroute with no reassign
Its not used in our codebase anymore, so no need for it
closes #11804
2015-06-22 15:53:56 +02:00
Alexander Reelsen 88f8d58c8b Cluster Health: Add max wait time for pending task and active shard percentage
In order to get a quick overview using by simply checking the cluster state
and its corresponding cat API, the following two attributes have been added
to the cluster health response:

* task max waiting time, the time value of the first task of the
  queue and how long it has been waiting
* active shards percent: The percentage of the number of shards that are in
  initializing state

This makes the cluster health API handy to check, when a fully restarted
cluster is back up and running.

Closes #10805
2015-06-22 15:04:47 +02:00
Colin Goodheart-Smithe 772d0cc6e7 Build: Make rest-spec-api a project so eclipse build works
The change makes rest-spec-api a project in the same way as we build dev-tools. it packages the tests and api in a bundle using the maven-remote-resources-plugin and uses the same plugin in the plugins and core pom to unpack the rest-api-spec into the target directory and references the rest tests there in the test resources.

The main stimulus for this change is that for those using Eclipse the current build does not work. After running `mvn eclipse:eclipse` the Eclipse IDE errors because the rest-api-spec is outside of the project scope, meaning that every time the command is run (required whenever any dependencies change), the class path of all the projects has to be manually fixed.
2015-06-22 11:41:44 +01:00
Simon Willnauer ec6946e979 [TEST] Enable testcase since #11482 is merged 2015-06-22 12:19:03 +02:00
Alexander Reelsen 38ddc8159c Dates: Allow for negative unix timestamps
This fixes an issue to allow for negative unix timestamps.
An own printer for epochs instead of just having a parser has been added.
Added docs that only 10/13 length unix timestamps are supported
Added docs in upgrade documentation

Fixes #11478
2015-06-22 11:56:31 +02:00
Simon Willnauer 895a7dd03c [TEST] assume assertions are enabled 2015-06-22 11:25:02 +02:00
Simon Willnauer af4b7ee000 Merge pull request #11795 from s1monw/abstract_runnable_ping
Use abstract runnable in scheduled ping
2015-06-22 10:27:19 +02:00
Simon Willnauer c7285d9d19 [TEST] Remove sleeps and latch timeouts from ClusterServiceTests
Tests relying on sleeps and latch timeouts are prone to weird timing issues
and hard to read / understand error messages. This commit moves towards a more
deterministic error model and replaces empty fails with real exceptions.
2015-06-22 09:51:51 +02:00
Simon Willnauer a45c05d907 Use abstract runnable in scheduled ping 2015-06-22 09:40:06 +02:00
Simon Willnauer 2e762f078d fix typo 2015-06-21 13:50:04 +02:00
Ryan Ernst 4c869cdf61 quite noisy test failure, related to #11769 2015-06-19 22:30:55 -07:00
Igor Motov 576b825d1c Improve logging of repository verification exceptions.
Some repository verification exceptions are currently only returned to the users but not logged on the nodes where the exceptions occurred, which makes troubleshooting difficult.

Closes #11760
2015-06-19 22:09:03 -04:00
Ryan Ernst aa4369f55b fix parent field mapper to copy customFieldDataSettings on merge 2015-06-19 16:48:34 -07:00
Ryan Ernst 0a5e763697 Removed hardcoded seed from test 2015-06-19 16:08:51 -07:00
Ryan Ernst de2dea04fb Rename MappedFieldType.validateCompatible to checkCompatibility 2015-06-19 15:59:30 -07:00
Ryan Ernst fa8a300f71 Merge pull request #11783 from rjernst/refactor/field-type-merge
Move merge simulation of fieldtype settings to fieldtype method
2015-06-19 15:45:01 -07:00
Ryan Ernst a71b128738 Address PR comments and fix customFieldDataSettings to still be copied
on merge
2015-06-19 15:41:36 -07:00
Ryan Ernst 434b1c94b3 Mappings: Move merge simulation of fieldtype settings to fieldtype method.
For #8871, we need to be able to check field types are compatible,
without comparing FieldMappers.  This change moves the simulation
checks (which generate merge conflicts) for any properties of
MappedFieldTypes into a new method, validateCompatible.

This also simplifies the merge code which merges settings
between the old and new fieldtypes. Previously, each subclass
of FieldMapper would have to set its own fieldtype settings.
However, now that we have .clone(), which perfectly copies
all properties (with subclasses accounted for), we can now
do a simple clone when merging.

Finally, this fixes a subtle bug in merging, in which if
merging has conflicts, and we were not simulating, we would
still update the field type, even though it was not compatible!

NOTE: there is one test failure I am trying to track down with
timestamp merging. Otherwise, all tests pass.
2015-06-19 13:42:16 -07:00
Areek Zillur a8c2886b3f Internal: Mark store as corrupted instead of deleting state file on engine failure
Currently, we delete the shard _state file on engine failure.
This behaviour does not persist the engine failure reason for later inspection.

This commit marks the shard store as corrupted instead of deleting
the _state file to ensure the store index can not be opened after and
the engine failure is persisted.
2015-06-19 14:46:26 -04:00
Alex Ksikes e26b1763e0 CommonTermsQuery fix for ignored coordination factor
CommonTermsQueryParser does not check for disable_coords, only for
disable_coord. Yet the builder only outputs disable_coords, leading to
disabling the coordination factor to be ignored in the Java API.

Closes #11730
Closes #11780
2015-06-19 10:15:37 -05:00
Ryan Ernst 04c3095f5e Merge pull request #11770 from rjernst/fix/null_value_merge
Hide more fieldType access and cleanup null_value merging
2015-06-19 08:15:33 -07:00