Commit Graph

38721 Commits

Author SHA1 Message Date
Nhat Nguyen 8e2f2be249
Track Lucene operations in engine explicitly (#29357)
Today we reply on `IndexWriter#hasDeletions` to check if an index
contains "update" operations. However, this check considers both deletes
and updates. This commit replaces that check by tracking and checking
Lucene operations explicitly. This would provide us stronger assertions.
2018-04-03 16:45:53 -04:00
Chris Earle 70e0012ec4 [TEST][Monitoring] Remove Unneeded Assert (elastic/x-pack-elasticsearch#4284)
This removes the `assert` that has been causing some very unexpected test
failures due to unexpected threading issues.

Some of the code changed and became async, so it is no longer guaranteed
that the same thread calls `doFlush` and `doClose`. We could similarly
make the field `volatile`, but since this `assert` is not really helping
anything it's easier to remove it.

Original commit: elastic/x-pack-elasticsearch@ba39de605f
2018-04-03 15:28:48 -04:00
Jason Tedor ca48a22ca7 Remove license key leniency (elastic/x-pack-elasticsearch#4277)
If the license key specified by the system property license.key does not
exist, Gradle does not care. Gradle should care, so this commit makes it
care.

Original commit: elastic/x-pack-elasticsearch@afc0a1443c
2018-04-03 13:45:07 -04:00
Uwe Schindler 7c6d5cbf1f Build: Fix Java9 MR build (#29312)
Correctly setup classpath/dependencies and fix checkstyle task that was partly broken because delayed setup of Java9 sourcesets. This also cleans packaging of META-INF. It also prepares forbiddenapis 2.6 upgrade

relates #29292
2018-04-03 10:22:12 -07:00
Dimitris Athanasiou 3d8c438403 [ML][DOCS] Correct path for get-stats for all jobs/datafeeds (elastic/x-pack-elasticsearch#4280)
Original commit: elastic/x-pack-elasticsearch@dfb7166f95
2018-04-03 18:00:34 +01:00
Johnny Marnell 4db6fc9a08 Reindex: Fix error in delete-by-query rest spec (#29318) 2018-04-03 11:22:04 -04:00
Adrien Grand 569d0c0e89
Improve similarity integration. (#29187)
This improves the way similarities are plugged in in order to:
 - reject the classic similarity on 7.x indices and emit a deprecation
   warning otherwise
 - reject unkwown parameters on 7.x indices and emit a deprecation
   warning otherwise

Even though this breaks the plugin API, I'd like to backport to 7.x so
that users can get deprecation warnings when they are doing something
that will become unsupported in the future.

Closes #23208
Closes #29035
2018-04-03 16:45:25 +02:00
Adrien Grand 8cdd950056
Fix some query extraction bugs. (#29283)
While playing with the percolator I found two bugs:
 - Sometimes we set a min_should_match that is greater than the number of
   extractions. While this doesn't cause direct trouble, it does when the query
   is nested into a boolean query and the boolean query tries to compute the
   min_should_match for the entire query based on its own min_should_match and
   those of the sub queries. So I changed the code to throw an exception when
   min_should_match is greater than the number of extractions.
 - Boolean queries claim matches are verified when in fact they shouldn't. This
   is due to the fact that boolean queries assume that they are verified if all
   sub clauses are verified but things are more complex than that, eg.
   conjunctions that are nested in a disjunction or disjunctions that are nested
   in a conjunction can generally not be verified without running the query.
2018-04-03 16:44:26 +02:00
Christoph Büscher dc1c16964a [Docs] Correct experimental note formatting 2018-04-03 16:16:21 +02:00
Lee Hinman db8ed36436
Move Nullable into core (#29341)
This moves the `Nullable` annotation into the elasticsearch-core project, so it
may be used without relying entirely on the server jar. This will allow us to
decouple more pieces to make them smaller.

In addition, there were two different `Nullable` annotations, these have all
been moved to the ES version rather than the inject version.
2018-04-03 07:57:21 -06:00
Lee Hinman 637301beca Adjust to Nullable moving into core (elastic/x-pack-elasticsearch#4275)
This is the x-pack side of https://github.com/elastic/elasticsearch/pull/29341

Original commit: elastic/x-pack-elasticsearch@08b6220009
2018-04-03 07:56:21 -06:00
Ragnar Nevries 5adfe2d8e3 [Docs] Update getting-started.asciidoc (#29294)
Description after first use of search API with body does not refer to verb POST.
2018-04-03 14:57:42 +02:00
Adrien Grand befa66ae35 Elasticsearch 6.3.0 is now on Lucene 7.3. 2018-04-03 14:21:16 +02:00
Yannick Welsch 3be98edc69
[DOCS] Refer back to index API for full-document updates in _update API section (#28677)
This clarifies how full-document updates are performed in ES.
2018-04-03 13:53:15 +02:00
rzmf 080cefec73 Fix missing comma in ingest-node.asciidoc (#29343) 2018-04-03 11:33:44 +01:00
Yannick Welsch d4538df893
Improve exception handling on TransportMasterNodeAction (#29314)
We have seen exceptions bubble up to the uncaught exception handler. Checking the blocks can
lead for example to IndexNotFoundException when the indices are resolved. In order to make
TransportMasterNodeAction more resilient against such expected exceptions, this code change
wraps the execution of doStart() into a try catch and informs the listener in case of failures.
2018-04-03 11:57:58 +02:00
Yannick Welsch 2dc546ccec
Don't break allocation if resize source index is missing (#29311)
DiskThresholdDecider currently assumes that the source index of a resize operation (e.g. shrink)
is available, and throws an IndexNotFoundException otherwise, thereby breaking any kind of shard
allocation. This can be quite harmful if the source index is deleted during a shrink, or if the source
index is unavailable during state recovery.

While this behavior has been partly fixed in 6.1 and above (due to #26931), it relies on the order in
which AllocationDeciders are executed (i.e. that ResizeAllocationDecider returns NO, ensuring that
DiskThresholdDecider does not run, something that for example does not hold for the allocation
explain API).

This change adds a more complete fix, and also solves the situation for 5.6.
2018-04-03 11:51:06 +02:00
Tanguy Leroux 989e465964
Use fixture to test repository-s3 plugin (#29296)
This commit adds a new fixture that emulates a S3 service in order to
improve the existing integration tests. This is very similar to what has
 been made for Google Cloud Storage in #28788, and such tests would 
have helped a lot to catch bugs like #22534.

The AmazonS3Fixture is brittle and only implements the very necessary
stuff for the S3 repository to work, but at least it works and can be
adapted for specific tests needs.
2018-04-03 11:30:43 +02:00
Christoph Büscher 2b07f63bd5
Fix NDCG for empty search results (#29267)
Fixes and edge case where DiscountedCumulativeGain can return NaN as
result of the quality metric calculation. This can happen when the
search result set is empty and normalization is used. We should return 0
in this case. Also adding related unit tests to the other two metrics.
2018-04-03 11:15:44 +02:00
rationull 0028563aac Pass through script params in scripted metric agg (#29154)
* Pass script level params into scripted metric aggs (#28819)

Now params that are passed at the script level and at the aggregation level
are merged and can both be used in the aggregation scripts. If there are
any conflicts, aggregation level params will win. This may be followed
by another change detecting that case and throwing an exception to
disallow such conflicts.

* Disallow duplicate parameter names between scripted agg and script (#28819)

If a scripted metric aggregation has aggregation params and script params
which have the same name, throw an IllegalArgumentException when merging
the parameter lists.
2018-04-03 09:57:49 +01:00
Adrien Grand f8602b1c7e Fix Eclipse build.
Relates #29300
2018-04-03 09:55:04 +02:00
Adrien Grand b7996d70a6 Update shas after Lucene upgrade.
Original commit: elastic/x-pack-elasticsearch@ddc6095933
2018-04-03 09:32:56 +02:00
Adrien Grand 3bdfc8f3fb
Upgrade to lucene-7.3.0-snapshot-98a6b3d. (#29298)
Most notable changes include:
 - this release doesn't have the 7.2.1 version constant so I had to create one
 - spatial4j and jts were upgraded
2018-04-03 09:27:14 +02:00
Jack Conradson 782e41a67e
Painless: Remove extraneous INLINE constant. (#29340) 2018-04-02 21:34:01 -07:00
Tim Brooks 383cadaee7 Fix SSL renegoation test (elastic/x-pack-elasticsearch#4273)
This commit fixes an issue in the security nio transport tests where
renegotiation was not actually being tested. We were not waiting on the
handshake complete latches. This commit fixes this issue.

Original commit: elastic/x-pack-elasticsearch@47bebc5c13
2018-04-02 21:35:35 -04:00
Jason Tedor 1df43a09b7
Remove HTTP max content length leniency (#29337)
I am not sure why we have this leniency for HTTP max content length, it
has been there since the beginning
(5ac51ee93f) with no explanation of its
source. That said, our philosophy today is different than the philosophy
of the past where Elasticsearch would be quite lenient in its handling
of settings and today we aim for predictability for both users and
us. This commit removes leniency in the parsing of
http.max_content_length.
2018-04-02 20:20:01 -04:00
Lee Hinman 0013de7aed Adjust to xcontent being a separate lib (elastic/x-pack-elasticsearch#4259)
* Adjust to xcontent being a separate lib

This is the x-pack side of https://github.com/elastic/elasticsearch/pull/29300
where xcontent is now starting to be a separate jar/dependency

Original commit: elastic/x-pack-elasticsearch@1eb249565a
2018-04-02 15:58:48 -06:00
Lee Hinman 6b2167f462
Begin moving XContent to a separate lib/artifact (#29300)
* Begin moving XContent to a separate lib/artifact

This commit moves a large portion of the XContent code from the `server` project
to the `libs/xcontent` project. For the pieces that have been moved, some
helpers have been duplicated to allow them to be decoupled from ES helper
classes. In addition, `Booleans` and `CheckedFunction` have been moved to the
`elasticsearch-core`  project.

This decoupling is a move so that we can eventually make things like the
high-level REST client not rely on the entire ES jar, only the parts it needs.

There are some pieces that are still not decoupled, in particular some of the
XContent tests still remain in the server project, this is because they test a
large portion of the pluggable xcontent pieces through
`XContentElasticsearchException`. They may be decoupled in future work.
Additionally, there may be more piecese that we want to move to the xcontent lib
in the future that are not part of this PR, this is a starting point.

Relates to #28504
2018-04-02 15:58:31 -06:00
David Leatherman b3cc7fc2c5 Java versions for ci (elastic/x-pack-elasticsearch#4268)
* Add test matrix axis files for periodic java testing

* Add properties file defining java versions to use

Original commit: elastic/x-pack-elasticsearch@d679b9ab3e
2018-04-02 16:50:43 -04:00
Alexander Reelsen ca6879b83e Watcher: Fix JIRA tests (elastic/x-pack-elasticsearch#4271)
The response JSON has changed.

Original commit: elastic/x-pack-elasticsearch@86f9973a68
2018-04-02 13:59:31 -06:00
David Leatherman 1172b3b31b
Java versions for ci (#29320)
* Add test matrix axis files for periodic java testing

* Add properties file defining java versions to use

* We have no openjdk8

* Remove openjdk

Oracle Java and OpenJDK basically only differ in license, so we don't
need to test both.
2018-04-02 14:24:25 -04:00
Aaron Bull Schaefer 1f48d6d2da Add packagingTestSample option to dev-tools/ci script (elastic/x-pack-elasticsearch#4266)
This is going to be run on every pull request.

Related to https://github.com/elastic/infra/issues/4258

Original commit: elastic/x-pack-elasticsearch@5752d779b0
2018-04-02 16:04:44 +02:00
Igor Motov 51602ddb97 SQL: Extract H2 initialization logic (elastic/x-pack-elasticsearch#4260)
Makes it possible to specify custom initialization logic to the test H2
instance. This is will be used to separate H2 setup between geo and
non-geo use cases.

Relates elastic/x-pack-elasticsearch#4080

Original commit: elastic/x-pack-elasticsearch@fa064e35de
2018-04-02 09:45:53 -04:00
David Turner 3be960d1c2
Minor cleanup in the InternalEngine (#29241)
Fix a couple of minor things in the InternalEngine:

* Rename loadOrGenerateHistoryUUID to reflect that it always generates a UUID 

* Move .acquire() call next to the associated try {} block.
2018-04-02 10:07:28 +01:00
David Turner 40d19532bc
Clarify expectations of false positives/negatives (#27964)
Today this part of the documentation just says that Geo queries are not 100% 
accurate, but in fact we can be more precise about which kinds of queries see
which kinds of error. This commit clarifies this point.
2018-04-02 10:03:42 +01:00
David Turner 3ca9310aee
Update docs on vertex ordering (#27963)
At time of writing, GeoJSON did not enforce a specific ordering of vertices in
a polygon, but it now does. We occasionally get reports of Elasticsearch
rejecting apparently-valid GeoJSON because of badly oriented polygons, and it's
helpful to be able to point at this bit of the documentation when responding.
2018-04-02 09:59:12 +01:00
Mayya Sharipova e70cd35bda
Revert "REST high-level client: add support for Indices Update Settings API (#28892)" (#29323)
This reverts commit b67b5b1bbd.
2018-03-30 16:26:46 -07:00
Andy Bristol 0144d20213 [test] remove Streamable serde assertions (elastic/x-pack-elasticsearch#4261)
Serialization assertions in ElasticsearchAssertions, a transport
interceptor that used them, and a plugin that added that interceptor
were removed from the test framework. This test case no longer needs to
exclude them from its plugins.

Original commit: elastic/x-pack-elasticsearch@07e5c58983
2018-03-30 14:09:36 -07:00
Andy Bristol b7e6fb9ac5
[test] remove Streamable serde assertions (#29307)
Removes a set of assertions in the test framework that verified that
Streamable objects could be serialized and deserialized across different
versions. When this was discussed the consensus was that this approach
has not caught many bugs in a long time and that serialization testing of
objects was best left to their respective unit and integration tests.

This commit also removes a transport interceptor that was used in
ESIntegTestCase tests to make these assertions about objects coming in
or off the wire.
2018-03-30 14:09:26 -07:00
Zachary Tong b91640877a [Docs] Fix bad doc test
Typo, needed to use a test setup instead of a continuation

Original commit: elastic/x-pack-elasticsearch@cfbc1202c6
2018-03-30 21:07:19 +00:00
David Kyle a4fca07c01 Replace ThrottlerField -> Field in comments and string constants (elastic/x-pack-elasticsearch#4238)
Original commit: elastic/x-pack-elasticsearch@97b449d29d
2018-03-30 21:52:28 +01:00
Zachary Tong 574ce84885 [Docs] Add quickstart and limitation documentation for Rollups
Original commit: elastic/x-pack-elasticsearch@cb4aaa0992
2018-03-30 20:43:33 +00:00
Fabien Baligand 199d131385 Improve query string docs (#28882)
fix query string syntax doc when OR operator is missed
2018-03-30 16:36:40 +02:00
Zachary Tong e8a6c9f5d1 [Rollup] Delegate GetJobs to master (elastic/x-pack-elasticsearch#4247)
If a job is deleted and then GetJobs API is immediately called,
it is possible for a job to be returned in the response.  This is likely
due to the GetJobs API being executed on a node with a slightly
stale cluster state which shows the job as still existing.

So we delegate to the master node so the list of jobs/tasks is current.
After routing to the master, we need to check if the rollup job
is in the PersistentTask's CS.  A job can be acknowledged canceled,
removed from the CS, but the allocated task is still alive.  So we
first check the CS to make sure it's really there before going to the
allocated task to get the status.

As extra precaution, when running local to the task, we also make
sure the task isn't canceled before including it in the response.

relates elastic/x-pack-elasticsearch#4041 


Original commit: elastic/x-pack-elasticsearch@3b6fb65e12
2018-03-30 06:24:29 -07:00
Zachary Tong 54539a1eb0 [Rollup] Make Rollup a Basic license feature (elastic/x-pack-elasticsearch#4246)
* Make Rollup a Basic license feature

Original commit: elastic/x-pack-elasticsearch@ef1ee98855
2018-03-30 06:23:08 -07:00
Fabien Baligand 437ad06e40 fix query string example for boolean query (#28881) 2018-03-30 15:10:14 +02:00
javanna bcc9cbfba7 Resolve unchecked cast warnings introduced with #28892 2018-03-30 10:58:40 +02:00
olcbean b67b5b1bbd REST high-level client: add support for Indices Update Settings API (#28892)
Relates to #27205
2018-03-30 10:53:29 +02:00
Ryan Ernst 54f8f819ef
Search: Validate script query is run with a single script (#29304)
The parsing code for script query currently silently skips by any tokens
it does not know about within its parsing loop. The only token it does
not catch is an array, which means pasing multiple scripts in via an
array will cause the last script to be parsed and one, silently dropping
the others. This commit adds validation that arrays are not seen while
parsing.
2018-03-29 22:10:03 -07:00
Sue Gallagher 5518640d46
[DOCS] Added info on WGS-84. Closes issue #3590 (#29305) 2018-03-29 15:50:05 -07:00