Commit Graph

30037 Commits

Author SHA1 Message Date
Jack Conradson df1c696e1d
Remove Painless Type From Locals, Variables, Params, and ScriptInfo (#28471) 2018-02-01 12:46:20 -08:00
markharwood 998461c737
Test fix - reenable BWC tests and lower version checks now that PR 28440 for allowPartialSearchResults flag backported to 6.x (#28482)
Support for allowPartialSearchResults is now in 6.3 so changing master BWC checks accordingly
2018-02-01 19:20:21 +00:00
Nhat Nguyen 1970e01782
Add lower bound for translog flush threshold (#28382)
If the translog flush threshold is too small (eg. smaller than the
translog header), we may repeatedly flush even there is no uncommitted
operation because the shouldFlush condition can still be true after
flushing. This is currently avoided by adding an extra guard against the
uncommitted operations. However, this extra guard makes the shouldFlush
complicated. This commit replaces that extra guard by a lower bound for
translog flush threshold. We keep the lower bound small for convenience
in testing.

Relates #28350
Relates #23606
2018-02-01 13:51:53 -05:00
Tanguy Leroux bb97c00556
[Docs] Docs tests should wait for async execution to complete (#28481)
This commit splits the async execution documentation into 2 parts, one
for the async method itself and one for the action listener. This allows
to add more doc and to use CountDownLatches in doc tests to wait for
asynchronous operations to be completed before moving to the next test.

It also renames few files.

Related to #28457
2018-02-01 17:56:13 +01:00
Luca Cavanna d860971572
REST high-level client: add support for split and shrink index API (#28425)
Relates to #27205
2018-02-01 16:37:01 +01:00
Colin Goodheart-Smithe d37c59d9dd
Fixes Eclipse build after secure-sm project was added (#28480) 2018-02-01 15:33:26 +00:00
Tanguy Leroux ec187caeae
[Test] Fix CRUDDocumentationIT (#28457)
Similarly to other documentation tests in the high level client, the
asynchronous operation like update, index or delete can make the test
fail if it sneak in between the middle of another operation.

This commit moves the async doc tests to be the last ones executed and
adds assert busy loops to ensure that the asynchronous operations are
correctly terminated.

closes #28446
2018-02-01 16:30:17 +01:00
Martijn van Groningen 61806802fb
Add persistent tasks
Persistent tasks are build on top of node tasks and provide functionality to restart a task to run on a different coordination node in case the coordinating node is no longer available.
It is up to a persistent task implementation to keep track of status, so that in case the task is restarted, the task can continue were it left off before it was restarted.
2018-02-01 15:26:17 +01:00
Alan Woodward 9500513ba1
Move leftover aliases test from core/ to server/ (#28463) 2018-02-01 11:40:29 +00:00
olcbean 344db6c0b1 Java high-level REST client : minor fixes (#28467)
Corrected method name and a parameter name
2018-02-01 11:50:43 +01:00
Martijn van Groningen ecb1d07d00
percolator: remove deprecated map_unmapped_fields_as_string setting 2018-02-01 11:11:22 +01:00
Colin Goodheart-Smithe 65157e9428
[TEST] Replaces flaky breaker IT test with unit test (#28418)
This change remove the `CircuitBreakerIT. testParentChecking` test method which fails intermittently in unexpected ways with a `MemoryCircuitBreakerTests. testBorrowingSiblingBreakerMemory` unit test method which can test the borrowing functionality more directly

Closes #28223
2018-02-01 08:32:46 +00:00
Jim Ferenczi dd40b984c4
Add a shallow copy method to aggregation builders (#28430)
This change adds a shallow copy method for aggregation builders. This method returns a copy of the builder replacing the factoriesBuilder and metaDada
This method is used when the builder is rewritten (AggregationBuilder#rewrite) in order to make sure that we create a new instance of the parent builder when sub aggregations are rewritten.

Relates #27782
2018-02-01 09:22:32 +01:00
Jim Ferenczi c7d5a54b42
Fix AIOOB on indexed geo_shape query (#28458)
This change fixes a possible AIOOB during the parsing of the document that contains the indexed shape.
This change ensures that the parsing does not continue when the field that contains the shape has been found.

Closes #28456
2018-02-01 09:01:48 +01:00
Martijn van Groningen 9bada306dc
Improved percolator candidate query tests. 2018-02-01 07:43:03 +01:00
Jason Tedor 33009e8f7c
Bump Gradle to version 4.5
This commit bumps Gradle from version 4.3 to version 4.5.

Relates #28472
2018-01-31 23:18:28 -05:00
Jack Conradson e281d57d82
Remove Painless Type From Painless Method/Field (#28466) 2018-01-31 16:27:52 -08:00
Jason Tedor f792606f1c Re-disable BWC tests after inadvertent re-enabling
These tests were disabled to facilitate backport of a PR which is not
yet complete. These tests were accidentally reenabled after a merge
conflict was resolved in the wrong direction. This commit addresses this
issue.
2018-01-31 19:14:31 -05:00
Jason Tedor 2570dc5997 Remove leftover securesm files
These files were leftover after integrating securesm into
libs/secure-sm. This commit removes this leftover directory.
2018-01-31 18:49:22 -05:00
Jason Tedor 1b3d529bef Introduce secure security manager to project
This commit migrates SecureSM, our secure security manager
implementation, from its own repository to being a sub-project of
Elasticsearch.
2018-01-31 18:23:28 -05:00
Jason Tedor e6bd34e22c Tighten which classes can exit
Today a SecureSM security manager allows defining a list of packages
that can exit the VM. However, today there are no restrictions on
defining a package inside another JAR. This commit strengthens the
ability to prevent exit by allowing construction of SecureSM to be done
with a list of regular expressions (instead of a list of prefix names)
that classes will be tested against. With this, a security manager can
be installed that permits only exiting from an exact list of classes.

Relates #5
2018-01-31 18:14:52 -05:00
Jason Tedor 09057f24b5 Allow whitelist of packages that can exit
Today, SecureSM has a mechanism that enables a hardcoded list of test
packages to exit if the SecureSM instance is constructed with a boolean
flag indicating that these packages will be permitted to exit. This
commit replaces this mechanism by allowing the SecureSM instance to be
constructed with a whitelist of packages that can exit.

Relates #4
2018-01-31 18:14:52 -05:00
Jason Tedor 083f60e1da Add sanity interruption assertion
This commit adds an assertion to the TestSecureSM#testNoModifySibling
test that sanity checks that the second child was actually interrupted
and therefore actually attempted to interrupt the first child.
2018-01-31 18:14:52 -05:00
Nhat Nguyen 5e0be61774
Add logging to index commit deletion policy (#28448)
This would help us to figure out which index commit that an engine 
started with or used in peer-recovery.

Relates #28405
2018-01-31 11:09:49 -05:00
markharwood 77d2dd203e
Search - add allow_partial_search_results flag with default setting false (#28440)
Adds allow_partial_search_results flag to search requests with default setting = true.
When false, will error if search either timeouts, has partial errors or has missing shards rather
than returning partial search results. A cluster-level setting provides a default for search requests with no flag.

Closes #27435
2018-01-31 15:51:29 +00:00
David Turner 4c154b70d3
Fix rounding of time values near to overlapping days (#28151)
Sometimes, in some places, the clocks are set back across midnight, leading to
overlapping days. This was not handled as expected, and this change fixes this.

Additionally, in this situation it is not true that rounding a time down to the
nearest day is a monotonic operation, as asserted in these tests. This change 
suppresses those assertions in those rare cases.

Fixes #27966.
2018-01-31 15:10:47 +00:00
kel 5819e57baa Replace Bits with new abstract class to respresent documents that have a value (#24088) (#28334) 2018-01-31 15:42:11 +01:00
Adrien Grand 3f5716b9b8
Clarify that the `null_value` option doesn't modify the `_source` document. (#28374)
Closes #15959
2018-01-31 15:04:11 +01:00
Adrien Grand 89b4485511
Document how copy-to can help speed up queries by querying fewer fields. (#28373) 2018-01-31 15:03:54 +01:00
Adrien Grand 9163c9b8d1
Clarify the defaults for `ignore_above`. (#28372)
Closes #27992
2018-01-31 15:03:20 +01:00
Adrien Grand f7c4740a76
Document that highlighting `terms` queries is best-effort. (#28371)
The `terms` query is really designed for filtering and highlighting it might
cause performance issues if it wraps many terms, so I am documenting
highlighting these queries as a best-effort only.

Closes #28099
2018-01-31 15:03:08 +01:00
Martijn van Groningen 592eedbf49
Make persistent tasks work.
Made persistent tasks executors pluggable.
2018-01-31 12:28:06 +01:00
Martijn van Groningen 07e727c769
Removed ClientHelper dependency from PersistentTasksService. 2018-01-31 12:28:06 +01:00
David Roberts cc16f9d9c9
Added AllocatedPersistentTask#waitForPersistentTaskStatus(...) that delegates to PersistentTasksService#waitForPersistentTaskStatus(...)
This allows persistent tasks executor implementations to not have an instance of PersistentTasksService.
2018-01-31 12:28:06 +01:00
Igor Motov 41071e4711
Add adding ability to associate an ID with tasks.
Persistent tasks portion of elastic/elasticsearch#23250
2018-01-31 12:28:06 +01:00
Jay Modi 8521b2d11e
Remove InternalClient and InternalSecurityClient (#3054)
This change removes the InternalClient and the InternalSecurityClient. These are replaced with
usage of the ThreadContext and a transient value, `action.origin`, to indicate which component the
request came from. The security code has been updated to look for this value and ensure the
request is executed as the proper user. This work comes from #2808 where @s1monw suggested
that we do this.

While working on this, I came across index template registries and rather than updating them to use
the new method, I replaced the ML one with the template upgrade framework so that we could
remove this template registry. The watcher template registry is still needed as the template must be
updated for rolling upgrades to work (see #2950).
2018-01-31 12:28:05 +01:00
Martijn van Groningen 4dd69951f3
Make the persistent task status available to PersistentTasksExecutor.nodeOperation(...) method 2018-01-31 12:28:05 +01:00
Colin Goodheart-Smithe 1c489ee867
Refactor/to x content fragments2 (#2329)
* Moves more classes over to ToXContentObject/Fragment

* Removes ToXContentToBytes

* Removes ToXContent from Enums

* review comment fix

* slight change to use XContantHelper
2018-01-31 12:28:05 +01:00
David Roberts 7313ad5b29
Make AllocatedPersistentTask members volatile (#2297)
These members are default initialized on contruction and then set by the
init() method.  It's possible that another thread accessing the object
after init() is called could still see the null/0 values, depending on how
the compiler optimizes the code.
2018-01-31 12:28:05 +01:00
Colin Goodheart-Smithe b0de3c38d6
Moves more classes over to ToXContentObject/Fragment (#2283) 2018-01-31 12:28:04 +01:00
Luca Cavanna 65ce2276eb
Adapt to upstream changes made to AbstractStreamableXContentTestCase (#2117) 2018-01-31 12:28:04 +01:00
Yannick Welsch b5f281386a
Move tribe to a module (#2088)
Companion PR to elastic/elasticsearch#25778
2018-01-31 12:28:04 +01:00
Igor Motov ffdb05e48e
Persistent Tasks: remove unused isCurrentStatus method (#2076)
Removes a method that is no longer used in production code.

Relates to #957
2018-01-31 12:28:04 +01:00
David Kyle 0d50f9c6a9
Call initialising constructor of BaseTasksRequest (#1771) 2018-01-31 12:28:04 +01:00
Chris Earle 1cef531165
Always Accumulate Transport Exceptions (#1619)
This is the x-pack side of the removal of `accumulateExceptions()` for both `TransportNodesAction` and `TransportTasksAction`.

There are occasional, random failures that occur during API calls that are silently ignored from the caller's perspective, which also leads to weird API responses that have no response and also no errors, which is obviously untrue.
2018-01-31 12:28:03 +01:00
Hendrik Muhs 614aef2527
Pass down the provided timeout. 2018-01-31 12:28:03 +01:00
Simon Willnauer 292e383d2c
Fix static / version based BWC tests (#1456)
With the leniency in Version.java we missed to really setup BWC
testing for static indices. This change brings back the testing and adds
missing bwc indices.

Relates to elastic/elasticsearch#24732
2018-01-31 12:28:03 +01:00
Yannick Welsch e69317b24b
Don't call ClusterService.state() in a ClusterStateUpdateTask
The current state is readily available as a parameter
2018-01-31 12:28:02 +01:00
Yannick Welsch 44ea5d6b3e
Separate publishing from applying cluster states
Companion commit to elastic/elasticsearch#24236
2018-01-31 12:28:02 +01:00
Igor Motov a08e2d9e5e
Persistent tasks: require allocation id on task completion (#1107)
Persistent tasks should verify that completion notification is done for correct version of the task, otherwise a delayed notification from an old node can accidentally close a newly reassigned task.
2018-01-31 12:28:01 +01:00