Commit Graph

43105 Commits

Author SHA1 Message Date
Dimitris Athanasiou b8dba16376
[ML] Ensure total hits are tracked (#36374)
This is in preparation of the anticipated change
that will disable accurate total hits tracking in
searches.
2018-12-07 18:01:37 +00:00
Jack Conradson 2df4bd1f81
[Painless] Generate Bridge Methods (#36097)
We use MethodHandles.asType to cast argument types into the appropriate parameter types for 
method calls when the target of the call is a def type at runtime. Currently, certain implicit casts 
using the def type are asymmetric. It is possible to cast Integer -> float as an argument to parameter, but not from int -> Float (boxed to primitive with upcasting is okay, but primitive to 
boxed with upcasting is not).

This PR introduces a solution to the issue by generating bridge methods for all whitelisted methods 
that have at least a single boxed type as an argument. The bridge method will conduct appropriate 
casts and then call the original method. This adds a bit of overhead for correctness. It should not be
used often as Painless avoids boxed types as much as possible.

Note that a large portion of this change is adding methods to do the appropriate def to boxed type 
casts and a few mechanical changes as well. The most important method for review is 
generateBridgeMethod in PainlessLookupBuilder.
2018-12-07 09:32:27 -08:00
David Turner 9d417984bd
[Zen2] Add warning if cluster fails to form fast enough (#35993)
* Add warning if cluster fails to form fast enough

Today if a leader is not discovered or elected then nodes are essentially
silent at INFO and above, and log copiously at DEBUG and below. A short delay
when electing a leader is not unusual, for instance if other nodes have not yet
started, but a persistent failure to elect a leader is a problem worthy of log
messages in the default configuration.

With this change, while there is no leader each node outputs a WARN-level log
message every 10 seconds (by default) indicating as such, describing the
current discovery state and the current quorum(s).

* Add note about whether the discovered nodes form a quorum or not

* Introduce separate ClusterFormationFailureHelper

... and back out the unnecessary changes elsewhere

* It can be volatile
2018-12-07 17:23:20 +00:00
Nhat Nguyen f2df0a5be4
Remove LocalCheckpointTracker#resetCheckpoint (#34667)
In #34474, we added a new assertion to ensure that the
LocalCheckpointTracker is always consistent with Lucene index. However,
we reset LocalCheckpoinTracker in testDedupByPrimaryTerm cause this
assertion to be violated.

This commit removes resetCheckpoint from LocalCheckpointTracker and
rewrites testDedupByPrimaryTerm without resetting the local checkpoint.

Relates #34474
2018-12-07 12:22:20 -05:00
Nhat Nguyen cec788deea HLRC/TEST: Fix document IT for delete template API
Relates #36320
2018-12-07 12:14:42 -05:00
Nhat Nguyen 32a7d7abd5
HLRC: Add delete template API (#36320)
Relates #27205
2018-12-07 10:46:03 -05:00
Simon Willnauer 844ff80778 Harden FrozenEngineTests#testCircuitBreakerAccounting
This test tries to compare the CB stats from an InternalEngine
and a FrozenEngine but is subject to segement merges that might finish
and get committed after we read the breaker stats. This can cause
occational test failures.

Closes #36207
2018-12-07 15:38:16 +01:00
Jim Ferenczi a53e8653f2
Add support for inlined user dictionary in Nori (#36123)
Add support for inlined user dictionary in Nori

This change adds a new option called `user_dictionary_rules` to the
Nori a tokenizer`. It can be used to set additional tokenization rules
to the Korean tokenizer directly in the settings (instead of using a file).

Closes #35842
2018-12-07 15:26:08 +01:00
Michael Basnight ca09936cdf
HLRC: Get Deprecation Info API (#36279)
This commit adds the Get Deprecation Info API and associated
documentation.

Relates #29827
2018-12-07 08:22:21 -06:00
David Turner c32e4fb83f
[Zen2] Best-effort cluster formation if unconfigured (#36215)
In real deployments it is important that clusters are properly configured to
avoid accidentally forming multiple independent clusters at cluster
bootstrapping time. However we also expect to be able to unpack Elasticsearch
and start up one or more nodes without any up-front configuration, and have
them do their best to find each other and form a cluster after a few seconds.

This change adds a delayed automatic bootstrapping process to nodes that start
up with no relevant settings set to support the desired out-of-the-box
experience without compromising safety in properly-configured deployments.
2018-12-07 12:47:09 +00:00
Christoph Büscher 879397df70
Remove deprecated methods in SimpleQueryStringBuilder (#36341)
The `useAllFields`methods have already been deprecated in 6.0 and are save to remove in 7.0.
2018-12-07 11:15:16 +01:00
Christoph Büscher 562479b5a5
Remove deprecated methods in MoreLikeThisQueryBuilder (#36340)
The ids method is deprecated since 6.0 (at least) and only used in a few tests
internally, so we can safely remove it.
2018-12-07 11:14:41 +01:00
David Roberts 60289e7331 Mute SourceOnlySnapshotIT testSnapshotAndRestore
Due to https://github.com/elastic/elasticsearch/issues/36330
2018-12-07 09:49:55 +00:00
Dimitris Athanasiou 0dd73ef7da
[ML] Move consuming and closing results stream to result processor (#36314)
The results iterator is consuming and closing the results stream
once it is done. It seems this should not be the responsibility
of the results iterator. It stops the iterator from being reusable
for different processes where closing the stream is not desirable.
This commit is moving the consuming and closing of the results stream
into the autodetect result processor.
2018-12-07 09:33:51 +00:00
Adrien Grand 266b9bc796
Inner hits fail to propagate doc-value format. (#36310)
If you pass a doc-value format to inner hits, it gets ignored.
2018-12-07 09:57:12 +01:00
Alexander Reelsen 6a987415f8
Scripting: Properly support no-offset date formatting (#36316)
The conversion of timezones in JodaCompatibleZonedDateTime from joda to
java time requires the use of the DateUtils class to cater for corner
cases.

Closes #36306
2018-12-07 09:40:58 +01:00
Alexander Reelsen 7693d538ca
Docs: Mention that fields with dots do not work (#36295)
The dot is used as a splitting character internally for looking up
values in the array compare condition, thus the user should use the
script condition in such cases.
2018-12-07 09:38:12 +01:00
Tanguy Leroux 9691d0508c
Remove unused class DelegatingActionListener (#36257) 2018-12-07 09:20:24 +01:00
Armin Braun e6d190613f
[ZEN2] Use Zen2 in REST Tests (#36300) 2018-12-07 09:15:11 +01:00
Nhat Nguyen 968b0b1992
Add soft-deletes upgrade tests (#36286)
This change adds a rolling-upgrade and full-cluster-restart test with
soft-deletes enabled.
2018-12-07 03:01:04 -05:00
Nhat Nguyen 10feb75eb7
Upgrade to Lucene-8.0.0-snapshot-aaa64d70159 (#36335)
Includes:

LUCENE-8594: DV update are broken for updates on new field
LUCENE-8590: Optimize DocValues update datastructures
LUCENE-8593: Specialize single value numeric DV updates

Relates #36286
2018-12-06 20:33:25 -05:00
Tim Brooks 373c67dd7a
Add DirectByteBuffer strategy for transport-nio (#36289)
This is related to #27260. In Elasticsearch all of the messages that we
serialize to write to the network are composed of heap bytes. When you
read or write to a nio socket in java, the heap memory you passed down
must be copied to/from direct memory. The JVM internally does some
buffering of the direct memory, however it is essentially unbounded.

This commit introduces a simple mechanism of buffering and copying the
memory in transport-nio. Each network event loop is given a 64kb
DirectByteBuffer. When we go to read we use this buffer and copy the
data after the read. Additionally, when we go to write, we copy the data
to the direct memory before calling write. 64KB is chosen as this is the
default receive buffer size we use for transport-netty4
(NETTY_RECEIVE_PREDICTOR_SIZE).

Since we only have one buffer per thread, we could afford larger.
However, if we the buffer is large and not all of the data is flushed in
a write call, we will do excess copies. This is something we can
explore in the future.
2018-12-06 18:09:07 -07:00
Jason Tedor fc85c37efc
Fix typo in migration node for one shard per index 2018-12-06 19:20:10 -05:00
Jason Tedor e8fe624570
Add migration note on the number of shards
This commit adds a migration note regarding the default number of shards
changing from five to one.

Relates #30539
2018-12-06 19:15:45 -05:00
Nhat Nguyen a7edf1ed1f
TEST: Ensure a manual flush always occur (#36188)
The test testLookupSeqNoByIdInLucene fails because it expects if any
change should be visible after a flush. However, that flush might be
ignored if the waitIfOngoing parameter is false (the default value), and
there is an ongoing flush triggered after merge is running.

Closes #35823
2018-12-06 18:37:54 -05:00
Jack Conradson 0b7b78b874 Mute test CCRIT testIndexFollowing (#36339) 2018-12-06 14:49:43 -08:00
Ryan Ernst 37b3fc383f
Build: Use explicit deps on test tasks for check (#36325)
This commit moves back to use explicit dependsOn for test tasks on
check. Not all tasks extending RandomizedTestingTask should be run by
check directly.
2018-12-06 14:13:49 -08:00
Jason Tedor ed45acf221
Fix name of Docker binaries
This commit fixes an oops when pushing a change to add the building of
the Docker images. A change that was made for testing was accidentally
left behind. This commit addresses that.
2018-12-06 17:10:48 -05:00
Jason Tedor 11dd412ec6
Introduce Docker images build (#36246)
This commit introduces the building of the Docker images as bonafide
packaging formats alongside our existing archive and packaging
distributions. This build is migrated from a dedicated repository, and
converted to Gradle in the process.
2018-12-06 17:06:13 -05:00
Benjamin Trent 3e04a90e99
[ML] Adding audits when deprecation warnings occur with datafeed start (#36233)
* [ML] Adding audits when deprecation warnings occur with datafeed start

* adjusting parameters for log format call
2018-12-06 15:58:37 -06:00
Jason Tedor d1184cfb68
Add docs on replicating APM Server or Beats indices (#36333)
This commit adds a brief note to the documentation on how to manage the
index templates that are used to create APM Server and Beats indices.
2018-12-06 16:07:40 -05:00
Tal Levy e944764be3
[ILM] [DOCS] add general info about steps (#36081)
it is important for users to understand that phases
are compiled into Steps that are exposed via the
Explain Lifecycle API.
2018-12-06 10:41:55 -08:00
Julie Tibshirani 3f3cde41d3
Deprecate types in termvector and mtermvector requests. (#36182)
* Add deprecation warnings to `Rest*TermVectorsAction`, plus tests in `Rest*TermVectorsActionTests`.
* Deprecate relevant methods on the Java HLRC requests/ responses.
* Update documentation (for both the REST API and Java HLRC).
* For each REST yml test, create one version without types, and another legacy version that retains types (called *_with_types.yml).
2018-12-06 10:23:15 -08:00
Lisa Cawley fb697c7442
[DOCS] Add missing anchors (#36288) 2018-12-06 10:14:37 -08:00
Jason Tedor d4d3a3e467
Remove license state listeners on closables (#36308)
We have a few places where we register license state listeners on
transient components (i.e., resources that can be open and closed during
the lifecycle of the server). In one case (the opt-out query cache) we
were never removing the registered listener, effectively a terrible
memory leak. In another case, we were not un-registered the listener
that we registered, since we were not referencing the same instance of
Runnable. This commit does two things:
  - introduces a marker interface LicenseStateListener so that it is
    easier to identify these listeners in the codebase and avoid classes
    that need to register a license state listener from having to
    implement Runnable which carries a different semantic meaning than
    we want here
  - fixes the two places where we are currently leaking license state
    listeners
2018-12-06 12:52:04 -05:00
Benjamin Trent adc8355c5d
Adding additional tests for agg parsing in datafeedconfig (#36261)
* Adding additional tests for agg parsing in datafeedconfig

* Fixing bug, adding yml test
2018-12-06 11:19:34 -06:00
Armin Braun 96ee6e0d2a
TEST: Reenable RemoveCorruptedShardDataCommandIT.testCorruptIndex
* Merging the zen2 branch has made it impossible to reproduce the test failure here, likely as a result of the state now being written atomically
* Closes #36189
2018-12-06 17:55:40 +01:00
Christoph Büscher 65e15f07fb Add comments about need for explicit cast
Some IDEs (specifically Eclipse 4.8.0) needs some explicit casting for type
inference. This was added in a recent change but we should also have comments so
we remember why this needs to be there (at least for now).
2018-12-06 17:40:59 +01:00
David Turner ed1c5a0241
Introduce `zen2` discovery type (#36298)
With this change it is now possible to start a node running Zen2.
2018-12-06 16:20:08 +00:00
Andrey Ershov f0340d6d32
[Zen2] Storage layer WriteStateException propagation (#36052)
Currently, we only log that WriteStateException has occurred, in
GatewayMetaState.

This PR goal is to re-throw WriteStateException to upper layers.
If dirty flag is set to false, we wrap WriteStateException in
UncheckedIOException, we prefer unchecked exception not to add
explicit throws in the multitude of layers.
If dirty flag is set to true - the world is broken. And we need to
halt the JVM. Instead of explicit halting in GatewayMetaState, we
prefer to throw IOError, which will be subsequently handled by
ElasticsearchUncaughtExceptionHandler and JVM will be halted.

This PR also adds tests for WriteStateException.
2018-12-06 17:02:02 +01:00
Adrien Grand b08cffad48
Fix line length offenders in the o.e.search package. (#36223)
Relates #34884
2018-12-06 16:31:12 +01:00
Tanguy Leroux 6186ccf83e
[Tests] Fix third party tests with Gradle 5.0 (#36302)
* [Tests] Fix third party tests with Gradle 5.0

* apply feedback
2018-12-06 16:05:05 +01:00
Christoph Büscher f5fa1f4746
Help Eclipse with type inference for functions (#36301)
The Eclipse IDE java compiler seems to need some special hints about what types
some functions used in the tests return. Correcting this for some test that were
newly merged to master.
2018-12-06 16:04:25 +01:00
Alexander Reelsen 97259f0efc
Docs: Add password keystore setting for email account passwords (#33409)
Always refer to secure settings when setting up email account passwords
2018-12-06 14:35:53 +01:00
Armin Braun 98e66c6afe
SNAPSHOT: Increase Timeout to Stabilize Test (#36294)
* 30s is pretty close here, most runs take 25s of the timeout making the test unstable
* closes #36283
2018-12-06 13:43:28 +01:00
Ioannis Kakavas 77e6ef7b20
Fix get certificates HLRC API (#36198)
- GetSslCertificatesRequest need not implement toXContentObject
- getRequest() returns a new Request object
- Add tests for GetSslCertificatesResponse
- Adjust docs to the new format
2018-12-06 12:44:51 +02:00
Yannick Welsch ee05ef1312 Merge branch 'zen2' 2018-12-06 08:31:46 +01:00
David Turner 38ab15c6fb Avoid shutting down the only master (#36272)
Today the InternalTestClusterTests sometimes set up a cluster with a single
master, start some other ndoes, shut the original master down, and then reset
the cluster. This doesn't really work, because the original master may be
stale. This change avoids shutting down the only master in this situation.
2018-12-06 08:27:38 +01:00
Alpar Torok 9ae5ee2497 Fix typo in comment 2018-12-06 09:14:50 +02:00
Jim Ferenczi 3ac64c1ec2 Fix total hits serialization of the search response (#36290)
This change removes the custom serialization of the total hits
and reuses the shard's serialization of Lucene#read/writeTopDocs
in the client code. This also removes the incorrect assertion that
trips randomly in bwc tests.

Closes #36284
2018-12-05 22:02:22 -08:00