Commit Graph

4336 Commits

Author SHA1 Message Date
Boaz Leskes 533c967a2d Revert "Removed index level metadata election #17233"
This reverts commit 1264ee79b6.
2016-03-22 14:35:42 +01:00
Christoph Büscher 14f45c1784 Merge pull request #17146 from cbuescher/sort-add-build
For the refactoring of SortBuilders related to #10217, each SortBuilder needs to get a build()
method that produces a SortField according to the SortBuilder parameters on the shard.
2016-03-22 13:46:50 +01:00
Simon Willnauer 75d5b83367 Improve error message if resource files have illegal encoding
This commit fixes string formatting issues in the error handling and
provides a bettter error message if malformed input is detected.
This commit also adds tests for both situations.

Relates to #17212
2016-03-22 13:29:07 +01:00
Christoph Büscher 697174dcb0 Make sure to use nestedScope levels when building nested filters 2016-03-22 13:28:40 +01:00
Christoph Büscher 25da6b2f2e Merge branch 'master' into sort-add-build 2016-03-22 12:20:56 +01:00
Christoph Büscher ff021c60d9 Merge pull request #17238 from cbuescher/simplify-nestedInnerQueryParseSupport
Remove unused methods and fields in NestedInnerQueryParseSupport
2016-03-22 12:16:44 +01:00
Boaz Leskes b07a8185a7 Wait for metadata to stabilize before checking for it after opening indices in testMetaWrittenWhenIndexIsClosedAndMetaUpdated 2016-03-22 11:36:42 +01:00
Christoph Büscher 20417262e2 Remove unused methods and fields in NestedInnerQueryParseSupport 2016-03-22 11:32:24 +01:00
Simon Willnauer 33521fc27c Detach IndexShard from node services
this is the last step to remove node level service from IndexShard.
This means that tests can now more easily create an IndexShard instance
without starting a node and removes the dependency between IndexShard and Client/ScriptService
2016-03-22 11:02:04 +01:00
Martijn van Groningen 8f22a01bbd ingest: Give the `foreach` processor access to the rest of the document.
Closes #17147
2016-03-22 10:32:13 +01:00
Boaz Leskes 1264ee79b6 Removed index level metadata election #17233
When a master is elected, it reaches out to all master nodes for their cluster state, selecting the one with the highest version. At the moment, we do another round to select the index metadata with the highest version as well. This is not needed - the election of a cluster state is enough - we should just use whatever indices are in it.

Closes #17233
2016-03-22 10:28:01 +01:00
Simon Willnauer a0c68c281c Improve error message if setting is not found
We can do better than just throwing an error when we don't find a
setting. It's actually trivial to leverage lucenes slow LD StringDistance
to find possible candiates for a setting to detect missspellings and suggest
a possible setting.
This commit adds error messages like:

 * `unknown setting [index.numbe_of_replica] did you mean [index.number_of_replicas]?`

rather than just reporting the setting as unknown
2016-03-21 23:13:24 +01:00
Simon Willnauer 8127a06b2e Recover broken IndexMetaData as closed
Today if something is wrong with the IndexMetaData we detect it very
late and most of the time if that happens we already allocated the index
and get endless loops and full log files on data-nodes. This change tries
to verify IndexService creattion during initial state recovery on the master
and if the recovery fails the index is imported as `closed` and won't be allocated
at all.

Closes #17187
2016-03-21 22:50:58 +01:00
Simon Willnauer 7f16a1d9a7 Improve upgrade experience of node level index settings
In 5.0 we don't allow index settings to be specified on the node level ie.
in yaml files or via commandline argument. This can cause problems during
upgrade if this was used extensively. For instance if analyzers where
specified on a node level this might cause the index to be closed when
imported (see #17187). In such a case all indices relying on this
must be updated via `PUT /${index}/_settings`. Yet, this API has slightly
different semantics since it overrides existing settings. To make this less
painful this change adds a `preserve_existing` parameter on that API to ensure
we have the same semantics as if the setting was applied on the node level.

This change also adds a better error message and a change to the migration guide
to ensure upgrades are smooth if index settings are specified on the node level.

If a index setting is detected this change fails the node startup and prints a message
like this:
```
*************************************************************************************
Found index level settings on node level configuration.

Since elasticsearch 5.x index level settings can NOT be set on the nodes
configuration like the elasticsearch.yaml, in system properties or command line
arguments.In order to upgrade all indices the settings must be updated via the
/${index}/_settings API. Unless all settings are dynamic all indices must be closed
in order to apply the upgradeIndices created in the future should use index templates
to set default values.

Please ensure all required values are updated on all indices by executing:

curl -XPUT 'http://localhost:9200/_all/_settings?preserve_existing=true' -d '{
  "index.number_of_shards" : "1",
  "index.query.default_field" : "main_field",
  "index.translog.durability" : "async",
  "index.ttl.disable_purge" : "true"
}'
*************************************************************************************
```
2016-03-21 20:12:18 +01:00
Areek Zillur bd44f37580 Merge pull request #17177 from areek/enhancement/change_shard_state_format
Always write shard state in SMILE format
2016-03-21 14:32:47 -04:00
Alexander Reelsen bf98a4455b PluginManager: Add xpack as official plugin
In order to be able to install `xpack` as a plugin and unless this works
for cross product packs, this adds xpack as an official plugin.
2016-03-21 18:51:17 +01:00
Boaz Leskes 2d1152ebac Remove ClusterService interface, in favor of it's only production instance #17183
We current have a ClusterService interface, implemented by InternalClusterService and a couple of test classes. Since the decoupling of the transport service and the cluster service, one can construct a ClusterService fairly easily, so we don't need this extra indirection.

Closes #17183
2016-03-21 13:55:10 +01:00
Colin Goodheart-Smithe 4335997017 Aggregations: Fixes the defaults for `keyed` in the percentiles aggregations
During the aggregation refactoring the default value for `keyed` in the `percentiles` and `percentile_ranks` aggregation was inadvertently changed from `true` to `false`. This change reverts the defaults to the old (correct) value
2016-03-21 11:46:55 +00:00
Martijn van Groningen e3b7e5d75a percolator: Replace percolate api with the new percolator query
Also replaced the PercolatorQueryRegistry with the new PercolatorQueryCache.

The PercolatorFieldMapper stores the rewritten form of each percolator query's xcontext
in a binary doc values field. This make sure that the query rewrite happens only during
indexing (some queries for example fetch shapes, terms in remote indices) and
the speed up the loading of the queries in the percolator query cache.

Because the percolator now works inside the search infrastructure a number of features
(sorting fields, pagination, fetch features) are available out of the box.

The following feature requests are automatically implemented via this refactoring:

Closes #10741
Closes #7297
Closes #13176
Closes #13978
Closes #11264
Closes #10741
Closes #4317
2016-03-21 12:21:50 +01:00
Boaz Leskes 032678f0c3 Remove unused refreshScheduledFuture in IndexShard
It has been replaced by the logic in IndexService
2016-03-20 21:22:56 +01:00
Boaz Leskes ef4293a993 Disable more usage of PosixPermission on Windows in InstallPluginCommand
Releates to #17201
2016-03-19 12:02:42 +01:00
Boaz Leskes ee95c0a384 Don't use PosixPermission on Windows, when creating temp plugin folders 2016-03-19 11:35:05 +01:00
Ryan Ernst f71f0d6010 Revert "Build: Switch to maven-publish plugin"
This reverts commit a90a2b34fc.
2016-03-18 17:22:25 -07:00
Jason Tedor 96c6ac2d3f Merge pull request #17176 from jasontedor/its-not-easy-being-green
Vagrant tests should be green
2016-03-18 15:28:37 -04:00
Christoph Büscher 4c3d889de4 Adding tests for median sort mode to GeoDistanceSortBuilderIT
Also adding checks for median SortMode on non-numeric field types
to FieldSortBuilder, removing some unused code and switching
GeoDistanceSortBuilder to using ParseField.
2016-03-18 15:57:55 +01:00
Simon Willnauer 99321f068f Revert "Revert "Merge pull request #17182 from s1monw/issues/17090""
This reverts commit b693a520ee.
2016-03-18 11:24:55 +01:00
Simon Willnauer b693a520ee Revert "Merge pull request #17182 from s1monw/issues/17090"
This reverts commit 0fe47f8136, reversing
changes made to 3b17ddcd46.
2016-03-18 10:37:44 +01:00
Simon Willnauer 0fe47f8136 Merge pull request #17182 from s1monw/issues/17090
Provide better error message when an incompatible node connects to a node

We should give a better exception message when an incompatible node connects
and we receive a messeage. This commit adds a clear excpetion based on the
protocol version received instead of throwing cryptic messages about not fully reaed
buffer etc.

Relates to #17090
2016-03-18 10:17:05 +01:00
Martijn van Groningen 3b17ddcd46 Removed old 1.x parent/child logic that should have been removed.
`0` really means, don't match any child docs.
2016-03-18 10:07:27 +01:00
Martijn van Groningen 1dd2be81c3 nested / parent child: Removed `total` score mode in favour of `sum` score mode.
Closes #17083
2016-03-18 10:07:26 +01:00
Simon Willnauer 7898522514 Provide better error message when an incompatible node connects to a node
We should give a better exception message when an incompatible node connects
and we receive a messeage. This commit adds a clear excpetion based on the
protocol version received instead of throwing cryptic messages about not fully reaed
buffer etc.

Relates to #17090
2016-03-18 09:51:00 +01:00
Ryan Ernst 69ff402b62 Still create the archive name for core as elasticsearch 2016-03-17 13:35:16 -07:00
Areek Zillur 771a34d47d change shard state format to smile 2016-03-17 16:29:58 -04:00
Jason Tedor 9f73152940 Fix plugins permissions 2016-03-17 15:35:54 -04:00
Jason Tedor dacb96ba61 Fix plugin installation logging 2016-03-17 15:35:54 -04:00
Jason Tedor ebdacb1297 Fix list of modules and official plugins 2016-03-17 15:35:54 -04:00
Ryan Ernst 6af4c43c4f Merge pull request #17128 from rjernst/maven_publish
Build: Switch to maven-publish plugin
2016-03-17 11:53:50 -07:00
Christoph Büscher d9de129995 Adressing review comments 2016-03-17 18:57:45 +01:00
Zachary Tong 1010e1e543 [TEST] Make test less fragile by sorting only on _uid
The previous method sorted first by _score, then _uid.  In certain situations, this allowed
floating point errors to slightly alter the sort order, causing test failure.

We only sort on _uid now, which should be deterministic and allow comparison of ten
documents.  Not quite as useful, but less fragile and we still check to make sure num hits
and max score are identical.

Closes #17164
2016-03-17 13:51:52 -04:00
Boaz Leskes 6ae738a2eb Debug log on testMergesHappening 2016-03-17 17:22:47 +01:00
Martijn van Groningen 7589ed7fbd Merge pull request #17167 from martijnvg/parent_id_query_take_child_type_into_account
parent_id query should take the child type into account too
2016-03-17 17:01:36 +01:00
Martijn van Groningen 68282dd9e9 parent/child: `parent_id` query should take the child type into account too.
If this query doesn't take the child type into account then it can match other
child document types pointing to the same parent type and that have the same id too.
2016-03-17 14:58:57 +01:00
Simon Willnauer e91a141233 Prevent index level setting from being configured on a node level
Today we allow to set all kinds of index level settings on the node level which
is error prone and difficult to get right in a consistent manner.
For instance if some analyzers are setup in a yaml config file some nodes might
not have these analyzers and then index creation fails.

Nevertheless, this change allows some selected settings to be specified on a node level
for instance:
 * `index.codec` which is used in a hot/cold node architecture and it's value is really per node or per index
 * `index.store.fs.fs_lock` which is also dependent on the filesystem a node uses

All other index level setting must be specified on the index level. For existing clusters the index must be closed
and all settings must be updated via the API on each of the indices.

Closes #16799
2016-03-17 14:42:18 +01:00
Tanguy Leroux 6441852618 Fix OOM in AbstractXContentParser
This commit fixes an OOM error that happens when the XContentParser.readList() method is asked to parse a single value instead of an array. It fixes the UpdateRequest parsing as well as remove some leniency in the readList() method so that it expect to be in an array before parsing values.

closes #15338
2016-03-17 14:37:33 +01:00
Colin Goodheart-Smithe d17fd335e4 fix range query rewrite so it rewrites correctly when shard min value == shard max value 2016-03-17 10:24:11 +00:00
Colin Goodheart-Smithe 30cdc11d75 Enable the indices request cache by default
Now we have 16870 we can enable the request cache by default. The caching can still be disabled on a per request basis and can still be disabled in the settings, only the default value has changed. For now this is done regardless of whether the shard is active or inactive.

Closes #17134
2016-03-17 09:06:32 +00:00
Colin Goodheart-Smithe 0f6b8dd848 Adds a rewrite phase to queries on the shard level
This change adds a rewrite phase to the queries on the shard before they are assessed for caching or executed. This allows the opportunity to rewrite queries as faster running simpler queries based on attributes known to only the shard itself. The first query to implement this is the RangeQueryBuilder which will rewrite to a MatchAllQueryBuilder if the range of terms on the shard is a subset of the query and rewrites to a MatchNoneQueryBuilder if the range of terms on the shard is completely outside the query.
2016-03-17 08:26:38 +00:00
Areek Zillur da24bfe542 simplify handling top-level suggest results 2016-03-17 00:34:19 -04:00
Areek Zillur 22e12ab7c3 cleanup request parsing in RestSearchAction 2016-03-16 19:03:30 -04:00
Areek Zillur 44b3dc95a0 remove irrelvant tests 2016-03-16 18:48:02 -04:00