Commit Graph

4685 Commits

Author SHA1 Message Date
Ali Beyad 763a659830 Fixes reading of CORS pre-flight headers and methods
CORS headers and methods config parameters must be read as arrays.  This
commit fixes the issue.  It affects http.cors.allow-methods and
http.cors.allow-headers.

Fixes #17483
2016-04-07 15:32:47 -04:00
Lee Hinman 82c2b1e48e Merge remote-tracking branch 'dakrone/allocation-explain-show-delay' 2016-04-07 12:56:28 -06:00
Lee Hinman 199c7256c8 Make passed in settings final and use Settings instead of strings 2016-04-07 12:55:25 -06:00
Lee Hinman 38d6ae1e20 Merge commit '8e01b093d0307a67a09bcb238452078becb62707' into dakrone/disk-info-ignore-shadow-size 2016-04-07 11:35:51 -06:00
Igor Motov 81c59cae18 Add _cat/tasks
Adds new _cat endpoint that lists all tasks
2016-04-07 09:28:21 -06:00
Jason Tedor 6a0e2d1f2d Remove leftover forbidden suppression in ZD 2016-04-07 11:22:29 -04:00
Adrien Grand c33300c543 Make MappedFieldType responsible for providing a parser/formatter. #17546
Aggregations need to perform instanceof calls on MappedFieldType instances in
order to know how they should be parsed or formatted. Instead, we should let
the field types provide a formatter/parser that can can be used.
2016-04-07 16:57:50 +02:00
jaymode f9d1e8a5f3 Root rest api delegates to a transport action
This change makes the root (/) rest api delegate to a transport action to get the
data for the response. This aligns this rest api with all of the other apis, which
delegate to one or more actions.

In doing this, unit tests were added to provide coverage of the RestMainAction
and the associated classes.
2016-04-07 10:03:49 -04:00
Adrien Grand e1bfe23c22 ExtendedStatsAggregator should also pass sigma to emtpy aggs. #17388
Because sigma is also used at reduce time, it should be passed to empty aggs.
Otherwise it causes bugs when an empty aggregation is used to perform reduction
is it would assume a sigma of zero.

Closes #17362
2016-04-07 09:34:11 +02:00
Jason Tedor 0a69985153 Merge pull request #17038 from jasontedor/enable_acked
Prepare for enabling acked indexing
2016-04-06 18:13:28 -04:00
Nik Everett 4841c5a3d3 Cut CustomQueryParserIT to registerQuery
This is the last place inside of ES other than SearchModule.
2016-04-06 16:38:56 -04:00
Jimmy Jones f157dae053 Disallow unquoted field names, fix testcases using unquoted JSON 2016-04-06 14:37:15 -06:00
Martijn van Groningen 63261f14d4 test: better fix for: 78d2311c5f 2016-04-06 22:23:00 +02:00
Martijn van Groningen ec4ebf31b0 Revert "test: don't do fuzzy on bool field"
This reverts commit 78d2311c5f.
2016-04-06 22:18:57 +02:00
Martijn van Groningen 5ff68d173d Removed unneeded refresh during post recovery.
and removed an obsolete exception, `_percolator` type is now `.percolator` since version 1.0
2016-04-06 22:06:14 +02:00
Adrien Grand 57059f1410 Fail if an object is added after a field with the same name. #17568
Today we fail if you try to add a field and an object from another type already
has the same name. However, we do NOT fail if you insert the field first and the
object afterwards. This leads to bad bugs since mappings are not necessarily
parsed in the same order at recovery time, so a mapping update could succeed and
then you would fail to reopen the index.
2016-04-06 20:16:11 +02:00
Jason Tedor 95feb40bef Remove superfluous validation of incoming states
This commit removes a superfluous check when validing incoming cluster
states. The check in question prevents out-of-order cluster states from
the same master from entering the queue. However, such out-of-order
cluster states will be cleaned from the queue when a commit message for
that cluster state arrives or a commit message for any higher-versioned
cluster state arrives.
2016-04-06 13:53:21 -04:00
Michael McCandless 8a9b5ccbc4 Merge pull request #17569 from mikemccand/imc_version_conflict_recovery
NullPointerException from IndexingMemoryController when a version conflict happens during recovery
2016-04-06 13:47:00 -04:00
Mike McCandless dea3678ef9 handle null Engine.Operation.getTranslogLocation in IndexingMemoryController 2016-04-06 13:34:01 -04:00
Nik Everett 16c12afabe Rework ScoreFunctionBuilder registration to remove PROTOTYPEs
This removes PROTOTYPEs from ScoreFunctionsBuilders. To do so we rework
registration so it doesn't need PROTOTYPEs and lines up with the recent
changes to query registration.
2016-04-06 13:04:11 -04:00
Nik Everett 1afc9b7e56 Cut multi_match query to registerQuery 2016-04-06 12:30:05 -04:00
Nik Everett f61c29e67b Move more queries to registerQuery 2016-04-06 11:51:06 -04:00
Nik Everett 03ce5e19eb 4 more queries 2016-04-06 11:15:23 -04:00
Nik Everett 2b6866d26b Fix references to the removed parsers
Mostly stuff is just in the builder now.
2016-04-06 11:15:22 -04:00
Nik Everett c68a58b67e Move the bottom third of queries to registerQuery
Mostly this is just moving fromXContent, making it public, and moving
the ParseFields used in parsing and making them private.
2016-04-06 11:15:22 -04:00
Colin Goodheart-Smithe c5ce78ed44 Aggregations: Fixes NPE when no window is specified in moving average request
This PR fixes a bug where a NPE was thrown when parsing a moving average pipeline aggregation request which did not specify a window size.

Closes #17516
2016-04-06 15:56:26 +01:00
Martijn van Groningen 78d2311c5f test: don't do fuzzy on bool field 2016-04-06 16:49:26 +02:00
Christoph Büscher bdc70df319 Merge pull request #17547: Add shuffling xContent to aggregation tests
This adds shuffling of xContent similar to #17521 to the aggregation and pipeline aggregation base test.
The additional shuffling uncovered that some aggregation builders internally store some properties in a 
way that made the equals() testing fail when the xContent is shuffled.
For TopHitsAggregatorBuilder, the internal scriptFields parameter was changed to a set because the order 
they appear in the xContent should not matter. For FiltersAggregatorBuilder, the internal list of KeyedFilters 
is sorted by key now. As a side effect, the keys in the aggregation response are now not always in the same 
order as the filters in the query, but sorted by key as well (unless they are anonymous).
2016-04-06 14:09:36 +02:00
James Bertouch 3651854bf6 Enhanced lat/long error handling
NumberFormatExceptions caused by non-double lat/long values are now
handled when the ignore_malformed flag is set to true.

Closes #16833
2016-04-06 07:14:01 -04:00
Christoph Büscher f409d0b763 Make defensive copies of filters list internally 2016-04-06 11:40:08 +02:00
Igor Motov f599ac5d5a Expose whether a task is cancellable in the _tasks list API
Closes #17369
2016-04-05 19:16:08 -06:00
Jason Tedor e76038e076 Exploit DiscoveryNode immutability in toString
DiscoveryNode is immutable yet we rebuild DiscoveryNode#toString on
every invocation. Most importantly, this just leads to unnecessary
allocations. This is most germane to ZenDiscovery and the processing of
cluster states where DiscoveryNode#toString is invoked when submitting
update tasks and processing cluster state updates.

Closes #17543
2016-04-05 19:17:04 -04:00
Christoph Büscher cbcbe75cf0 Adressing comments 2016-04-06 00:05:26 +02:00
Jason Tedor 66cc2029cd Refactor old state version check to ZenDiscovery 2016-04-05 17:31:36 -04:00
Jason Tedor c2ed5a1c9e Reorder pending queue clean checks 2016-04-05 15:59:54 -04:00
Jason Tedor 3abf8177e8 Add comment about older cluster states 2016-04-05 15:56:16 -04:00
Christoph Büscher b01e3f0d3b Add shuffling xContent to aggregation tests 2016-04-05 19:33:52 +02:00
Jason Tedor 7cdd647d7b Clarify cluster state local node validation 2016-04-05 13:04:34 -04:00
Colin Goodheart-Smithe 65a5366cba Aggregations: Fixes Filter and FiltersAggregation to work with empty query
This fix ensures the filter and filters aggregation will not throw a NPE when `{}` is passed in as a filter. Instead `{}` is interpreted as a MatchAllDocsQuery.

Closes #17518
2016-04-05 17:20:29 +01:00
Jason Tedor cffc315dca Reject old cluster states and keep the queue clean
This commit adds a guard preventing old cluster states from entering
into the pending queue when we are following a master, and cleans old
cluster states from the pending queue when processing a commit.
2016-04-05 11:03:29 -04:00
Luca Cavanna 67ccfc354e Switch to using ParseField to parse query names
* [TEST] check registered queries one by one in SearchModuleTests

* Switch to using ParseField to parse query names

If we have a deprecated query name, at the moment we don't have a way to log any deprecation warning nor fail when we are in strict mode. With this change we use ParseField, which will take care of the camel casing that we currently do manually (so that one day we can remove it more easily). This also means, that each query will have a unique preferred name, and all the other names are deprecated.

Terms query "in" synonym is now formally deprecated, as well as fuzzy_match, match_fuzzy, match_phrase and match_phrase_prefix for match query, mlt for more_like_this and geo_bbox for geo_bounding_box. All these will be removed in 6.0.

Every QueryParser holds now a ParseField constant called QUERY_NAME_FIELD that holds the name for it. The first name is the preferred one, all the others are deprecated. The first name is taken from the NAME constant already present in each query builder object, so that we somehow keep the serialization constant separated from ParseField. This change also allowed us to remove the names method from the QueryParser interface.
2016-04-05 15:38:53 +02:00
Colin Goodheart-Smithe 84eacadd51 Splits `phrase` and phrase_prefix` in match query into `MatchPhraseQueryBuilder` and `MatchPhrasePrefixQueryBuilder`
The `phrase` and `phrase_prefix` options in the `MatchQueryBuilder` have been deprecated in favour of using the new `MatchPhraseQueryBuilder` and `MatchPhrasePrefixQueryBuilder`. This is not a breaking change since `MatchQueryBuilder` still supports `phrase` and `phrase_prefix` but this option will be removed from the `MatchQueryBuilder` in the future (probably in 6.0)

Relates to https://github.com/elastic/elasticsearch/pull/17458#discussion_r58351998
2016-04-05 12:55:03 +01:00
Jim Ferenczi 6c8d9acc75 Merge pull request #17530 from jimferenczi/bwc_2.3.1
Replace problematic bwc indices for 2.3.1 with newly generated one.
2016-04-05 11:19:43 +02:00
Christoph Büscher 7254eac840 Add more fromXContent() testing with shuffled field order 2016-04-05 10:07:51 +02:00
Jim Ferenczi 0225376a49 Replace problematic bwc indices for 2.3.1 with newly generated one.
Restore the test OldIndexBackwardsCompatibilityIT.testOldIndexes which now works fine with 2.3.1 bwc indices.
2016-04-05 09:50:34 +02:00
Lee Hinman 05e2358ffb Fail hot_threads in a better way if unsupported by JDK
Currently if thread cpu time is not supported (for instance, on
operating systems such as FreeBSD), an `IllegalStateException` is thrown
in `HotThreads#innerDetect()` that causes the API to return a useless
response.

This changes the check to be earlier, substituting a message for the
hot_threads output (in case some nodes *do* support it).

Additionally, if an exception is thrown during the hot_threads
generation it is now logged and the best effort output is returned.
2016-04-04 15:36:21 -06:00
Zachary Tong 0a472cb359 [TEST] Temporarily silence failing bwc test
More details at #17514
2016-04-04 16:17:24 -04:00
Lee Hinman 78e6ff6e5e Show configured and remaining delay for an unassigned shard.
When a shard is delayed, we now show output like:

```json
{
  "shard" : {
    "index" : "i",
    "index_uuid" : "QzoKda9aQCG_hCaZQ18GEg",
    "id" : 3,
    "primary" : false
  },
  "assigned" : false,
  "unassigned_info" : {
    "reason" : "NODE_LEFT",
    "at" : "2016-04-04T16:44:47.520Z",
    "details" : "node_left[HyRLmMLxR5m_f58RKURApQ]"
  },
  "allocation_delay" : "59.9s",
  "allocation_delay_ms" : 59910,
  "remaining_delay" : "38.9s",
  "remaining_delay_ms" : 38991,
  "nodes" : {
    "jKiyQcWFTkyp3htyyjxoCw" : {
      "node_name" : "Landslide",
      "node_attributes" : { },
      "final_decision" : "YES",
      "weight" : 1.0,
      "decisions" : [ ]
    },
    "9bzF0SgoQh-G0F0sRW_qew" : {
      "node_name" : "Caretaker",
      "node_attributes" : { },
      "final_decision" : "NO",
      "weight" : 2.0,
      "decisions" : [ {
        "decider" : "same_shard",
        "decision" : "NO",
        "explanation" : "the shard cannot be allocated on the same node id [9bzF0SgoQh-G0F0sRW_qew] on which it already exists"
      } ]
    }
  }
}
```

Where the new addition is this section:

```
  "allocation_delay" : "59.9s",
  "allocation_delay_ms" : 59910,
  "remaining_delay" : "38.9s",
  "remaining_delay_ms" : 38991,
```

Which shows the configured delay as well as the remaining delay until
the shard can be considered "assignable". This data is only shown if the
shard is unassigned.

Relates to #17372
2016-04-04 11:37:29 -06:00
Nik Everett 90f300bb71 Remove PROTOTYPE from some enums in query builders 2016-04-04 13:19:36 -04:00
Clinton Gormley b7fb34fed2 Bumped current version to 2.3.2-SNAPSHOT and added bwc indices for 2.3.1 2016-04-04 17:45:27 +02:00