Commit Graph

8930 Commits

Author SHA1 Message Date
Tim Brooks e40c597b67
Fix reference to TcpTransport in documentation 2017-10-12 13:27:24 -06:00
Simon Willnauer 047a916169 Allow Uid#decodeId to decode from a byte array slice (#26987)
Today we only allow to decode byte arrays where the data has a 0 offset
and the same length as the array. Allowing to decode stuff from a slice will
make decoding IDs cheaper if the the ID is for instance coming from a term dictionary
or BytesRef.

Relates to #26931
2017-10-12 20:19:14 +02:00
Simon Willnauer 21eb9bdf6a Use separate searchers for "search visibility" vs "move indexing buffer to disk (#26972)
Today, when ES detects it's using too much heap vs the configured indexing
buffer (default 10% of JVM heap) it opens a new searcher to force Lucene to move
the bytes to disk, clear version map, etc.

But this has the unexpected side effect of making newly indexed/deleted
documents visible to future searches, which is not nice for users who are trying
to prevent that, e.g. #3593.

This is also an indirect spinoff from #26802 where we potentially pay a big
price on rebuilding caches etc. when updates / realtime-get is used. We are
refreshing the internal reader for realtime gets which causes for instance
global ords to be rebuild. I think we can gain quite a bit if we'd use a reader
that is only used for GETs and not for searches etc. that way we can also solve
problems of searchers being refreshed unexpectedly aside of replica recovery /
relocation.

Closes #15768
Closes #26912
2017-10-12 17:19:43 +02:00
Colin Goodheart-Smithe e1679bfe5e Create weights lazily in filter and filters aggregation (#26983)
Previous to this change the weights for the filter and filters aggregation were created in the `Filter(s)AggregatorFactory` which meant that they were created regardless of whether the aggregator actually collects any documents. This meant that for filters that are expensive to initialise, requests would not be quick when the query of the request was (or effectively was) a `match_none` query.

This change maintains a single Weight instance for each filter across parent buckets but passes a weight supplier to the aggregator instances which will create the weight on first call and then return that instance for subsequent calls.
2017-10-12 14:56:32 +01:00
Jason Tedor f81ee225ff Fire global checkpoint sync under system context
The global checkpoint sync action should fire under the system context
since it is not a user-facing management action.

Relates #26984
2017-10-12 09:18:58 -04:00
kel 2e36f19051 Add support for parsing inline script (#23824) (#26846)
* Add support for parsing inline script (#23824)

* Fix test
2017-10-11 09:15:37 -07:00
Alexander Kazakov 592ab043dd Change default value to true for transpositions parameter of fuzzy query (#26901) 2017-10-11 15:31:48 +02:00
Yannick Welsch d97b21d1da Adding unreleased 5.6.4 version number to Version.java 2017-10-11 08:40:30 +02:00
Tim Brooks 4a870d8c63 Rename TCPTransportTests to TcpTransportTests (#26954)
Our convention is to use lower case when naming things "Tcp". For
example, `TcpTransport`. This commit renames the outlier
(TcpTransportTests) to use lower case.
2017-10-10 20:15:14 -06:00
Nhat b63f718a0b Fix NPE for /_cat/indices when no primary shard (#26953)
When a node which contains the primary shard is unavailable, the primary
stats (and the total stats) of an `IndexStats` will be empty for a short
moment (while the primary shard is being relocated). However, we assume
that these stats are always non-empty when handling `_cat/indices` in
RestIndicesAction. This commit checks the content of these stats before
accessing.

Closes #26942
2017-10-10 17:04:55 -04:00
Jason Tedor 4c06b8f1d2 Check for closed connection while opening
While opening a connection to a node, a channel can subsequently
close. If this happens, a future callback whose purpose is to close all
other channels and disconnect from the node will fire. However, this
future will not be ready to close all the channels because the
connection will not be exposed to the future callback yet. Since this
callback is run once, we will never try to disconnect from this node
again and we will be left with a closed channel. This commit adds a
check that all channels are open before exposing the channel and throws
a general connection exception. In this case, the usual connection retry
logic will take over.

Relates #26932
2017-10-10 13:34:51 -04:00
Tanguy Leroux 6658ff0fd6 Don't detect source's XContentType in DocumentParser.parseDocument() (#26880)
DocumentParser.parseDocument() auto detects the XContentType of the
document to parse, but this information is already provided by SourceToParse.
2017-10-10 15:31:56 +02:00
hanbj 3ab27d16ad Fix thread context handling of headers overriding (#26068)
Previously collisions in headers between old and new contexts could be silently ignored, allowing the original context's headers to "win". This commit fixes the headers to require they are disjoint.
2017-10-09 14:41:09 -07:00
Boaz Leskes 84742690cd SearchWhileCreatingIndexIT: remove usage of _only_nodes
the only nodes preference was used as a replacement of `_primary` which was removed. Sadly, it's not the same as we also check that it makes sense - i.e., that the given node has a shard copy. Since the test uses indices with >1 shards, the primaries may be spread to multiple nodes. Using one (like it currently does) will fail for some primaries. Using all will probably end up hitting all nodes.

This commit removed the `_only_nodes` usage in favor a simple search

Relates to #26791
2017-10-09 19:37:19 +02:00
Martijn van Groningen 96823b0480
update Lucene version for 6.0-RC2 version 2017-10-09 15:27:06 +02:00
kel 1d4f70210f Calculate and cache result when advanceExact is called (#26920)
Cache final result instead of result of advanceExact.
Fix SortedNumericDoubleValues does not test MEDIAN mode
Replace deprecated random string generation method
2017-10-09 14:02:38 +02:00
Simon Willnauer cdd7c1e6c2 Return List instead of an array from settings (#26903)
Today we return a `String[]` that requires copying values for every
access. Yet, we already store the setting as a list so we can also directly
return the unmodifiable list directly. This makes list / array access in settings
a much cheaper operation especially if lists are large.
2017-10-09 09:52:08 +02:00
Nhat bf4c3642b2 remove _primary and _replica shard preferences (#26791)
The shard preference _primary, _replica and its variants were useful
for the asynchronous replication. However, with the current impl, they
are no longer useful and should be removed.

Closes #26335
2017-10-08 11:03:06 -04:00
kel 100e3c9a8a Remove UnsortedNumericDoubleValues (#26817)
Closes #24086
2017-10-06 16:31:50 +02:00
Thomas Kappler 16431a6601 Fix IndexOutOfBoundsException in histograms for NaN doubles (#26787) (#26856) 2017-10-06 16:27:01 +02:00
Jim Ferenczi e8f72353d8 Fix search_after with geo distance sorting (#26891)
Support for search_after and geo distance sorting is broken when the optimized LatLonDocValuesField.distanceSort is used.
This commit fixes the parsing of the search_after value for this case.
2017-10-06 11:34:33 +02:00
Jason Tedor 470e5e7cfc Add additional low-level logging handler ()
* Add additional low-level logging handler

We have the trace handler which is useful for recording sent messages
but there are times where it would be useful to have more low-level
logging about the events occurring on a channel. This commit adds a
logging handler that can be enabled by setting a certain log level
(org.elasticsearch.transport.netty4.ESLoggingHandler) to trace that
provides trace logging on low-level channel events and includes some
information about the request/response read/write events on the channel
as well.

* Remove imports

* License header

* Remove redundant

* Add test

* More assertions
2017-10-05 12:10:58 -04:00
Simon Willnauer 8583727590 [TEST] add test to ensure legacy list syntax in yml works fine 2017-10-05 14:41:51 +02:00
Simon Willnauer 41925e1171 Bump BWC version for settings serialization to 6.1.0 2017-10-05 14:07:05 +02:00
Md. Abdulla-Al-Sun a40c474e10
Added Bengali Analyzer to Elasticsearch with respect to the lucene update(PR#238) 2017-10-05 13:25:05 +02:00
kel a978ddf37b Fix toString() in SnapshotStatus (#26852)
Closes #26851
2017-10-05 12:57:46 +02:00
Jim Ferenczi 24359c1a75 #26870 change bwc version for fuzzy_transpositions to 6.1 after backport 2017-10-05 11:28:59 +02:00
Martijn van Groningen b863eaff4d
update lucene version after upgrading Lucene deps in 6.x branch too 2017-10-05 09:49:30 +02:00
Simon Willnauer 00dfdf50cf Represent lists as actual lists inside Settings (#26878)
Today we represent each value of a list setting with it's own dedicated key
that ends with the index of the value in the list. Aside of the obvious
weirdness this has several issues especially if lists are massive since it
causes massive runtime penalties when validating settings. Like a list of 100k
words will literally cause a create index call to timeout and in-turn massive
slowdown on all subsequent validations runs.

With this change we use a simple string list to represent the list. This change
also forbids to add a settings that ends with a .0 which was internally used to
detect a list setting.  Once this has been rolled out for an entire major
version all the internal .0 handling can be removed since all settings will be
converted.

Relates to #26723
2017-10-05 09:27:08 +02:00
Martijn van Groningen dca787ed8a
upgrade to Lucene 7.1.0 snapshot version 2017-10-05 09:06:56 +02:00
Alexander Kazakov 9c95e91471 Expose `fuzzy_transpositions` parameter in fuzzy queries (#26870)
Add fuzzy_transpositions parameter to multi_match and query_string queries.
Add fuzzy_transpositions, fuzzy_prefix_length and fuzzy_max_expansions
parameters to simple_query_string query.
2017-10-05 09:01:09 +02:00
Jason Tedor c5a0e77fc6 Remove unused local transport constant
Local transport was removed previously but a stale constant was left
behind. This commit removes this unused constant.
2017-10-04 22:26:29 -04:00
Luca Cavanna 9b9cb81c41 Fix serialization errors when cross cluster search goes to a single shard (#26881)
The single shard optimization that we have in our search api changes the type of response returned by the query transport action name based on the shard search request. if the request goes to one shard, we will do query and fetch at the same time, hence the response will be different. The proxying layer used in cross cluster search was not aware of this distinction, which causes serialization issues every time a cross cluster search request goes to a single shard and goes through a gateway node which has to forward the shard request to a data node. The coordinating node would then expect a QueryFetchSearchResult while the gateway would return a QuerySearchResult.

Closes #26833
2017-10-04 22:39:14 +02:00
Tim Brooks ca35fcabd0 Do not set SO_LINGER to 0 when not shutting down (#26871)
This is a follow up to #26764. That commit set SO_LINGER to 0 in order
to fix a scenario where we were running out of resources during CI. We
are primarily interested in setting this to 0 when stopping the
tranport. Allowing TIMED_WAIT is standard for other failure scenarios
during normal operation.

Unfortunately this commit set SO_LINGER to 0 every time we close
NodeChannels. NodeChannels can be closed in case of an exception or
other failures (such as parsing a response). We want to only disable
linger when actually shutting down.
2017-10-04 10:27:26 -06:00
Simon Willnauer d1533e2397 Remove Settings#getAsMap() (#26845)
Since `#getAsMap` exposes internal representation we are trying to remove it
step by step. This commit is cleaning up some xcontent writing as well as
usage in tests
2017-10-04 01:21:38 -06:00
David Roberts 2bdeee8840 Fix test bug from #26166 2017-10-03 15:55:37 +01:00
David Roberts ea7be2d527 Adjust transport compatibility logic following backport of #26166 2017-10-03 14:16:31 +01:00
David Roberts a292740b9e Add cgroup memory usage/limit to OS stats on Linux (#26166)
This change adds cgroup memory usage/limit to the OS stats section of
the node stats on Linux.  This information is useful because in Docker
containers the standard node stats report the host memory limit, not
taking account of extra restrictions that may have been applied to the
container.

The original idea was to store these values as Long, truncating any values
outside the range of long.  However, this meant that in the relatively common
case of no limit being applied, users would not see the same value in the OS
stats as they see by querying Linux directly.  So instead the values are stored
as String.  This change places a burden on consumers of the strings to
convert the strings to numbers and decide what to do about extremely large
values, but there will be very few consumers and they would need to have a
policy for dealing with "no limit" in any case.
2017-10-03 12:08:36 +01:00
Simon Willnauer 7b8d036ab5 Replace group map settings with affix setting (#26819)
We use group settings historically instead of using a prefix setting which is more restrictive and type safe. The majority of the usecases needs to access a key, value map based on the _leave node_ of the setting ie. the setting `index.tag.*` might be used to tag an index with `index.tag.test=42` and `index.tag.staging=12` which then would be turned into a `{"test": 42, "staging": 12}` map. The group settings would always use `Settings#getAsMap` which is loosing type information and uses internal representation of the settings. Using prefix settings allows now to access such a method type-safe and natively.
2017-09-30 14:27:21 +02:00
David Turner 8fe9a20982 Forbid negative values for index.unassigned.node_left.delayed_timeout (#26828)
Change delayed_timeout to be a positiveTimeSetting, and add note that this is a breaking change
2017-09-29 14:44:43 +01:00
David Turner 1715fd7036 Nitpicking typos in comments (#26831) 2017-09-29 11:37:05 +01:00
Boaz Leskes eabd0d687e MetaData Builder doesn't properly prevent an alias with the same name as an index (#26804)
Elasticsearch doesn't allow having an index alias named with the same name as an existing index. We currently have logic that tries to prevents that in the `MetaData.Builder#build()` method. Sadly that logic is flawed. Depending on iteration order, we may allow the above to happen (if we encounter the alias before the index).

This commit fixes the above and improves the error message while at it.

Note that we have a lot of protections in place before we end up relying on the metadata builder (validating this when we process APIs). I takes quite an abuse of the cluster to get that far.
2017-09-29 11:06:58 +02:00
Tal Levy ce8533e251 Add version 6.0.0-rc2 2017-09-28 11:07:35 -07:00
Jim Ferenczi aade2f6d63 Change ParentFieldSubFetchPhase to create doc values iterator once per segment (#26815) 2017-09-28 16:24:05 +02:00
Jim Ferenczi 0acf74420c Change VersionFetchSubPhase to create doc values iterator once per segment (#26809) 2017-09-28 13:57:10 +02:00
Jim Ferenczi f9f8856d89 Change ScriptFieldsFetchSubPhase to create search scripts once per segment (#26808)
Closes #26775
2017-09-28 12:23:53 +02:00
James Baiera 81d181394f Adding unreleased 5.6.3 version number to Version.java (#26794) 2017-09-26 17:49:22 -04:00
Armin Braun af06231d4c #26701 Close TcpTransport on RST in some Spots to Prevent Leaking TIME_WAIT Sockets (#26764)
#26701 Added option to RST instead of FIN to TcpTransport#closeChannels
2017-09-26 19:58:11 +00:00
olcbean 6952f7b560 Validate top-level keys for create index request (#23755) (#23869)
This commit ensures create index requests do not ignore unknown keys passed to the request.

closes #23755
2017-09-26 09:49:20 -07:00
Alexander Kazakov 52887b1437 Throw exception if setting during dynamic settings update isn't recognized (#26569)
Closes #25607
2017-09-26 13:07:01 +02:00