4740 Commits

Author SHA1 Message Date
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 
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 
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
Lee Hinman
8e01b093d0 When considering the size of shadow replica indices, set size to 0
Otherwise, when trying to calculate the amount of disk usage *after* the
shard has been allocated, it has incorrectly subtracted the shadow
replica size.

Resolves 
2016-04-04 08:28:03 -06:00
Luca Cavanna
f75086fcee ParseField#getAllNamesIncludedDeprecated to not return duplicate names 2016-04-04 15:08:43 +02:00
Jason Tedor
e201f5c8b0 Fix missing parenthesis in commit timeout message 2016-04-02 14:16:32 -04:00
Jason Tedor
c7c8b1d825 Merge branch 'master' into enable_acked
* master: (156 commits)
  Make JNA calls optional
  Added RPM metadata
  Remove PROTOTYPE from MLT.Item
  Remove PROTOTYPE from VersionType
  Fix mistake in TopHits change
  Remove PROTOTYPEs from highlighting
  Clean up some log messages
  Command line arguments with comma must be quoted on windows
  Cluster Health should run on applied states, even if waitFor=0 
  ingest: make concrete processor impl final, like all other processor concrete impls.
  Improve some test method comments.
  Document task id's as string in the rest spec
  Replace FieldStatsProvider with a method on MappedFieldType. 
  cleanup test
  Remove MathUtils. 
  Addressing review comments
  fix javadocs
  Make TranslogConfig immutable and pass TranslogGeneration as a ctor arg to Translog
  [reindex] Don't get rejected
  Remove redundant commit - #openTranslog() already commits in that case
  ...
2016-04-02 13:56:00 -04:00
Jason Tedor
8b970d970d Clarify closing of timeout listeners 2016-04-02 13:41:23 -04:00
Jason Tedor
1f12beea9a Reword received superseded cluster state message 2016-04-02 13:32:29 -04:00
Jason Tedor
e85535724e Make JNA calls optional
The introduction of max number of processes and max size virtual memory
checks inadvertently made JNA non-optional on OS X and Linux. This
commit wraps these calls in a check to see if JNA is available so that
JNA remains optional.

Closes 
2016-04-02 12:08:05 -04:00
Nik Everett
0539def016 Remove PROTOTYPE from MLT.Item
Relates to 
2016-04-01 22:01:20 -04:00
Nik Everett
ca54b408a3 Remove PROTOTYPE from VersionType 2016-04-01 21:48:51 -04:00
Nik Everett
b7afd80b3f Fix mistake in TopHits change 2016-04-01 21:35:35 -04:00
Nik Everett
d919031469 Remove PROTOTYPEs from highlighting 2016-04-01 21:35:34 -04:00
Christoph Büscher
9d68a515b8 Merge pull request from cbuescher/add-xcontent-randomization
Add randomization of XContentBuilder output to query tests
2016-04-01 15:02:01 +02:00
Tanguy Leroux
662c34b888 Clean up some log messages 2016-04-01 14:44:50 +02:00
Boaz Leskes
283eff13aa Merge pull request from s1monw/make_translog_config_immutable
Make TranslogConfig immutable and pass TranslogGeneration as a ctor arg to Translog

This mutable state is confusing and is easily missed. By default this is null and
wipes all translog. This commit makes the TranslogGeneration mandatory on the Translog
constructor and removes the mutalbe state.
2016-04-01 12:18:28 +02:00
Boaz Leskes
0b12cab07a Cluster Health should run on applied states, even if waitFor=0
We already protect against making decisions based on an inflight cluster state if someone asks for a waitFor rule (like wait for green). We should do the same for normal health checks as well (unless timeout is set to 0) as it be trappy to debug failures when health says the cluster is in a certain state, but that state wasn't applied yet.

Closes 
2016-04-01 11:14:17 +02:00
Martijn van Groningen
9ebc0c8f47 ingest: make concrete processor impl final, like all other processor concrete impls. 2016-04-01 11:05:16 +02:00
Christoph Büscher
7a1b06ce0b Improve some test method comments. 2016-04-01 11:04:56 +02:00
Adrien Grand
4c4bbb3e45 Replace FieldStatsProvider with a method on MappedFieldType.
FieldStatsProvider had to perform instanceof calls to properly handle dates or
ip addresses. By moving the logic to MappedFieldType, each field type can check
whether all values are within bounds its way.

Note that this commit only keeps rewriting support for dates, which are the only
field for which the rewriting mechanism is likely to help (because of time-based
indices).
2016-04-01 10:28:58 +02:00
Martijn van Groningen
11fdd2608f cleanup test 2016-04-01 09:45:28 +02:00
Adrien Grand
8afc0f1748 Remove MathUtils.
It has a single method: mod, which can be replaced with Math.floorMod since
we always coll it with a positive divisor.
2016-04-01 08:31:31 +02:00
Christoph Büscher
1a697a1ae6 Addressing review comments 2016-03-31 21:46:17 +02:00
Simon Willnauer
7f8235b004 fix javadocs 2016-03-31 21:33:01 +02:00
Simon Willnauer
23ea59b06f Make TranslogConfig immutable and pass TranslogGeneration as a ctor arg to Translog
This mutable state is confusing and is easily missed. By default this is null and
wipes all translog. This commit makes the TranslogGeneration mandatory on the Translog
constructor and removes the mutalbe state.
2016-03-31 21:24:48 +02:00
Simon Willnauer
baa2d51e59 Merge pull request from s1monw/recovery_mem_buffer_access
Move translog recover outside of the engine

We changed the way we manage engine memory buffers to an
open model where each shard can essentially has infinite memory.
The indexing memory controller is responsible for moving memory to disk
when it's needed. Yet, this doesn't work today when we recover from store/translog
since the engine is not fully initialized such that IMC has no access to the engine,
neither to it's memory buffer nor can it move data to disk.

The biggest issue here is that translog recovery happends inside the Engine constructor
which is problematic by itself since it might take minutes and uses a not yet fully
initialzied engine to perform write operations on.

This change detaches the translog recovery and makes it the responsibility of the caller
to run it once the engine is fully constructed or skip it if not necessary.
2016-03-31 21:03:00 +02:00
Simon Willnauer
6fb588156c Remove redundant commit - #openTranslog() already commits in that case 2016-03-31 20:46:28 +02:00
Nik Everett
75a9899813 Start to rework query registration
Changes QueryParser into a @FunctionalInterface and provides a way to
register queries using that. Cuts match and function_score queries over
to that registration method as a proof of concept.

Once all queries have been cut over we can remove their PROTOTYPES.
2016-03-31 13:43:07 -04:00
Christoph Büscher
bbb6d91147 Add randomization of XContentBuilder output to query tests
Currently our testing of parsing query builders is limited to the
default order of the parameters that each builders toXContent()
method produces. To better test real queries where the order of
parameters can be different, this change adds a helper
method to ESTestCase that takes a XContentBuilder and randomly
shuffles the order of the fields inside an object. This is
used in AbstractQueryTestCase, but it can be used in other similar
places in the future.
2016-03-31 18:17:39 +02:00
Nik Everett
c7780e6e0a Use ObjectParser in highlighting 2016-03-31 10:34:26 -04:00
Martijn Laarman
7de2377d38 Merge pull request from Mpdreamz/fix/remove-deprecated-get-alias-api
Remove deprecated indices.get_aliases
2016-03-31 15:57:03 +02:00
Simon Willnauer
ea055d2ac9 add a comment why and when we can ignore skipTranslogRecovery in IndexShard 2016-03-31 15:54:21 +02:00
Simon Willnauer
4657796b24 fix test 2016-03-31 15:15:39 +02:00
Nik Everett
30a1862339 Remove PROTOTYPE from BulkItemResponse.Failure
Closes 
2016-03-31 09:10:36 -04:00
Nik Everett
f8a67a2622 Remove PROTOTYPEs from ingest 2016-03-31 09:09:35 -04:00
Simon Willnauer
f7cbc384f7 add tests to ensure translog ID is baked into commit on all open modes 2016-03-31 15:09:11 +02:00
Martijn Laarman
dfe2c0ff0a Remove deprecated indices.get_aliases
This has been deprecated since the first release of Elasticsearch 1.0
2016-03-31 14:46:53 +02:00
Christoph Büscher
2843194635 Merge pull request from cbuescher/remove-RescoreParseElement
Remove RescoreParseElement after refactoring to RescoreBuilder.
2016-03-31 14:38:56 +02:00
Christoph Büscher
06184ee006 Remove RescoreParseElement
The refactoring of RescoreBuilder and QueryRescoreBuilder moved parsing
previously in RescoreParseElement into the builders. This removes the
left over parse element.
2016-03-31 14:37:21 +02:00
Simon Willnauer
0a277227c3 add back opem mode randomization 2016-03-31 13:06:23 +02:00
Simon Willnauer
a356f74d4d Add test for IMC to ensure we also move buffers to disk during translog recovery 2016-03-31 12:58:00 +02:00
Simon Willnauer
d006200c77 Make EngineConfig less mutable and ensure we prevent flushes during translog recovery phase. 2016-03-31 12:00:51 +02:00
Luca Cavanna
6b00b4b8dc Merge pull request from javanna/enhancement/discovery_node_one_getter
Remove duplicate getters from DiscoveryNode and DiscoveryNodes
2016-03-31 11:45:41 +02:00
Christoph Büscher
c850b960fb Remove unused 'reverse' parse field from ScoreSortBuilder 2016-03-31 11:18:46 +02:00
javanna
32b6e529f4 Merge branch 'master' into enhancement/discovery_node_one_getter 2016-03-31 10:49:26 +02:00
Martijn van Groningen
ccb009e45f percolator: Add scoring support to the percolator query
Percolator query documents are scored based on how well they match with the document being percolated.

Closes 
2016-03-31 10:08:43 +02:00
Martijn van Groningen
7600dc9943 percolator: Add support to extract terms from several types of span queries 2016-03-31 09:54:29 +02:00