Commit Graph

45141 Commits

Author SHA1 Message Date
Alan Woodward 31db53599f
Adjust skip value in tests after backport (#40270)
Now that the `use_field` option has been backported to the 7.x branch,
we can run BWC tests against all versions from 7.1

Follow up to #40157
2019-03-21 15:39:33 +00:00
lcawl c65423d7cf Adds URL for preview data frame transforms 2019-03-21 08:27:43 -07:00
RomainGeffraye 00b9f5d1e4 Fix typo (#40273) 2019-03-21 07:54:11 -07:00
Lisa Cawley bbba32fb6b
[DOCS] Adds placeholder for get data frame transform APIs (#40283) 2019-03-21 07:45:17 -07:00
Ed Savage b0ce522869
[ML] Add integration tests to check persistence (#40272)
Additional checks have been added to exercise the behaviour of
persistence on graceful close of an anomaly job. In particular:

 - check that persistence does not occur for a job that is opened and
 then immediately closed, with nothing else having happened.
 - check that persistence occurs on graceful close of a job if it has
 processed data.
 - check that persistence occurs subsequent to time being manually
 advanced - even if no additional data has been seen by the job
 - check the edge case where persistence occurs if a job is opened, time
 is manually advanced and then the job is closed, having seen no data.

 Related to elastic/ml-cpp#393
2019-03-21 14:33:21 +00:00
Armin Braun a19087ba35
Log Warning on Failed Blob Deletes in BlobStoreRepository (#40188)
* Log Warning on Failed Blob Deletes in BlobStoreRepository
* We should not just debug log these spots, they all can and will lead to leaked files when snapshot deletion fails
2019-03-21 14:58:37 +01:00
James Rodewig 6aadcd93c4
[DOCS] Add 'recovery' to glossary for issue #7264 (#40275) 2019-03-21 08:25:26 -04:00
Costin Leau 7591cb1a15
SQL: Preserve original source for cast/convert function (#40271)
Improve rule for pruning cast to preserve the original source
Fix #40239
2019-03-21 14:08:16 +02:00
Jason Tedor ddddbdfe6d
Reduce retention lease sync intervals (#40302)
This commit adjusts the frequency with which CCR renews retention leases
and with which primaries sync retention leases to replicas. This helps
Lucene reclaim soft-deleted documents more aggressively, which we have
found in some use-cases can help improve performance, and either way
will help keep disk space under more control.
2019-03-21 07:37:04 -04:00
krisds fe1e0af2bf Remove unused variable in QueryContainer 2019-03-21 10:48:31 +01:00
Andrei Stefan 4e5d5af58a
SQL: fix LIKE function equality by considering its pattern as well (#40260)
* Define a equals method for Like function so that the pattern used
is considered in the equality check. Whenever the functions are resolved
this check should be used.
2019-03-21 11:42:18 +02:00
Andrei Stefan 9beb31fd3c
Moving tests in locale-aware test file (#40254) 2019-03-21 10:56:29 +02:00
Albert Zaharovits 357aac8066
Refactor Token Service (#39808)
This refactoring is in the context of the work related to moving security
tokens to a new index. In that regard, the Token Service has to work with
token documents stored in any of the two indices, albeit only as a transient
situation. I reckoned the added complexity as unmanageable,
hence this refactoring.

This is incomplete, as it fails to address the goal of minimizing .security accesses,
but I have stopped because otherwise it would've become a full blown rewrite
(if not already). I will follow-up with more targeted PRs.

In addition to being a true refactoring, some 400 errors moved to 500. Furthermore,
more stringed validation of various return result, has been implemented, notably the
one of the token document creation.
2019-03-21 10:55:09 +02:00
Yogesh Gaikwad f5e69f98e9
Find and use non local IPv4 address while testing IP filtering (#40234)
* Find and use non local IPv4 address while testing IP filtering

For pattern "n:localhost" PatternRule#isLocalhost() matches
any local address, loopback address.
[Note: I think for "localhost" this should not consider IP address
as a match when they are bound to network interfaces. It should just
be loopback address check unless the intent is to match all local addresses.
This class is adopted from Netty3 and I am not sure if this is intended
behavior or maybe I am missing something]

For now I have fixed this assuming the PatternRule#isLocalhost check is
correct by avoiding use of local address to check address denied.

Closes #40194
2019-03-21 15:54:51 +11:00
Yogesh Gaikwad 775344f46d
Correct documentation link for authorization engine example (#40261)
This commit fixes the link for authorization engine example.
2019-03-21 13:43:12 +11:00
Yogesh Gaikwad 3c1d851153
Fix so non super users can also create API keys (#40028)
When creating API keys we check for if API key with
the same key name already exists and fail the request if it does.
The check should have been performed with XPackSecurityUser
instead of the authenticated user. This caused the request to fail
in case of the non-super user trying to create an API key.
This commit fixes by executing search action with SECURITY_ORIGIN
so it can be executed with XPackSecurityUser.
Also fixed the Rest test to avoid using a user with `super_user` role.

Closes #40029
2019-03-21 13:29:43 +11:00
Marios Trivyzas 2eae029bbf
SQL: Fix issue with getting DATE type in JDBC (#40207)
Previously, calling getDate()/getTime()/getTimestamp() and getObject()
with the corresponding java.sql class on a column of SQL DATE type from
the JDBC result set would throw an Exception.
2019-03-21 01:14:07 +01:00
Marios Trivyzas 8832d25b2e
SQL: Fix issue with optimization on queries with ORDER BY/LIMIT (#40256)
Previously, when a trival plain `SELECT` or a trivial `SELECT` with
aggregations has also an `ORDER BY` or a `LIMIT` or both, then the
optimization to convert it to a `LocalRelation` was skipped resulting
in exception thrown. E.g.::
```
SELECT 'foo' FROM test LIMIT 10
```
or
```
SELECT 'foo' FROM test GROUP BY 1 ORDER BY 1
```

Fixes: #40211
2019-03-20 23:51:15 +01:00
Mayya Sharipova 2945b8f57b Adjust the version for 250_distance_feature test
Relates to #39385
2019-03-20 16:04:41 -04:00
Marios Trivyzas 9376761b69
SQL: Fix issue with date columns returned always in UTC (#40163)
When selecting columns of ES type `date` (SQL's DATETIME) the
`FieldHitExtractor` was not using the timezone of the client session
but always resorted to UTC. The same behaviour (UTC only) was
encountered also for grouping keys (`CompositeKeyExtractor`) and
for First/Last functions on dates (`TopHitsAggExtractor`).

Fixes: #40152
2019-03-20 19:58:57 +01:00
Lisa Cawley e7f9c73d10
[DOCS] Adds placeholder for data frame preview API (#40232) 2019-03-20 10:19:41 -07:00
Nhat Nguyen 8add00079e Mute testRelocationWithConcurrentIndexing
Tracked at #34950
2019-03-20 12:44:58 -04:00
Alan Woodward 64a53e42cd
Add `use_field` option to intervals query (#40157)
This is the equivalent of the `field_masking_span` query, allowing users to
merge intervals from multiple fields - for example, to search for stemmed tokens
near unstemmed tokens.
2019-03-20 16:25:15 +00:00
Benjamin Trent 70615dd38d
[ML] Refactor GET Transforms API (#40015)
* [Data Frame] Refactor GET Transforms API:

* Add pagination
* comma delimited list expression support GET transforms
* Flag troublesome internal code for future refactor

* Removing `allow_no_transforms` param, ratcheting down pageparam option

* Changing  DataFrameFeatureSet#usage to not get all configs

* Intermediate commit

* Writing test for batch data gatherer

* Removing unused import

* removing bad println used for debugging

* Updating BatchedDataIterator comments and query

* addressing pr comments

* disallow null scrollId to cause stackoverflow
2019-03-20 11:05:22 -05:00
Like 3c352a8596 Make setting index.translog.sync_interval be dynamic (#37382)
Currently, we cannot update index setting index.translog.sync_interval if index is open, because it's
not dynamic which can be updated for closed index only.

Closes #32763
2019-03-20 16:55:59 +01:00
Jack Conradson 6921d1efc5
Add float and Float standard casting tests to Painless. (#40221) 2019-03-20 08:52:58 -07:00
Yannick Welsch 8b95daa65e
Fix snapshot restore logging on fresh restore (#40252)
A recent refactoring (#37130) where imports got mixed up (changing Lucene's
IndexNotFoundException to Elasticsearch's IndexNotFoundException) led to many warnings being
logged in case of restoring a fresh snapshot.
2019-03-20 16:51:04 +01:00
James Rodewig c6474a3c26
Add links to Freeze/Unfreeze index APIs (#40225)
* Add links to Freeze/Unfreeze index APIs

* Resolved merge conflicts with PR #40160
2019-03-20 11:44:36 -04:00
Yannick Welsch 6b03b131be
Remove note about Azure ARM plugin (#40219)
Relates to #22679
2019-03-20 16:31:03 +01:00
avshiav 955ccf2583 [DOCS] Fixed missing space (#38305) 2019-03-20 16:18:01 +01:00
krisds 6b81f0d37f [Contradictory type checks](https://lgtm.com/projects/g/elastic/elasticsearch/snapshot/dist-1916470085-1548143539391/files/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/debug/Debug.java#xe223478b74721d35:1) (#38154) 2019-03-20 16:16:23 +01:00
Luca Cavanna 94403c44f8
Remove throws IOException from PipelineAggregationBuilder#create (#40222)
IOException are never thrown in any of the existing pipeline aggregation
builders. Removing the throws IOException from the create method allows
to remove it also from a couple of other methods which ends up simplifying
 AggregationPhase (one less catch).
2019-03-20 16:14:08 +01:00
Nhat Nguyen 790fdb156c Use separate translog dir in testDeleteWithFatalError
This test currently opens a new engine but shares the same translog
directory of the previous opening engine.
2019-03-20 10:19:34 -04:00
Tim Brooks 2f41b1b64d
Remove `Tracer` from `MockTransportService` (#40237)
Currently we have a piece of infrastructure that allows tests to add
tracers to the MockTransportService. However, this functionality can
be implemented using the underlying transport message listener. This
commit removes the tracer. Additionally it modifies the tracer logger
tests to actually test the log messages.
2019-03-20 08:04:58 -06:00
David Kyle 217dc089c0
[ML] Data Frame HLRC Preview API (#40206) 2019-03-20 13:38:41 +00:00
Henning Andersen df9f0f729f
Cascading primary failure lead to MSU too low (#40249)
If a replica were first reset due to one primary failover and then
promoted (before resync completes), its MSU would not include changes
since global checkpoint, leading to errors during translog replay.

Fixed by re-initializing MSU before restoring local history.
2019-03-20 13:56:38 +01:00
Jason Tedor bd623bfd96
Use bundled JDK in Docker images (#40238)
Now that we have the bundled JDK in the Docker images, we should use
them as opposed to procuring a JDK ourselves. This commit replaces the
JDK in the Docker image with the bundled JDK.
2019-03-20 08:52:59 -04:00
David Turner a41f5e448e
Reword frozen indices introduction (#40160)
Clarifies that we don't move anything extra to persistent storage when freezing
an index, and gives a bit more context for less experienced users.
2019-03-20 11:56:36 +00:00
Martijn van Groningen 0e0357ceee
Add realistic hlrc response serialization test base class (#39844)
The base class facilitates generating a server side response test instance,
that gets serialized as xcontent, which then gets parsed into a hlrc response
instance, which then gets asserted against the server side response instance.

This way of testing is more realistic then how hlrc response classes are tested
today, which basically tests that serialization works by generating
hlrc response instance, serialize that to xcontent and then parse it back
to a hlrc response instance.

Besides adding a base test class, this change also cuts AcknowledgedResponseTests
and BroadcastResponseTests over to use this base class.

Relates to #39745
2019-03-20 12:49:47 +01:00
Simon Willnauer b8f8ed7f89 Bump BWC version to 7.1 after backport
Relates to #39698
2019-03-20 12:09:25 +01:00
Simon Willnauer 159eb721ea
Return cached segments stats if `include_unloaded_segments` is true (#39698)
Today we don't return segments stats for closed indices which makes it
hard to tell how much memory such an index would require. With this change
we return the statistics if requested by setting `include_unloaded_segments` to
true on the rest request.

Relates to #39512
2019-03-20 11:24:29 +01:00
Jason Tedor c46120f769
Modfiy casing in JVM home log message
This makes the log message consistent with the following line that shows
the JVM arguments.
2019-03-20 00:05:30 -04:00
Jason Tedor 3ca5662ddd
Upgrade bundled JDK and Docker images to JDK 12 (#40229)
This commit bumps the JDK used the bundled JDK and the Docker images to
JDK 12.
2019-03-19 23:44:19 -04:00
Nhat Nguyen 8d1893c2c8
Ensure flush happen before closing an index (#40184)
If there's an ongoing flush triggered by the translog flush threshold,
we may fail to execute a flush because waitIfOngoing is false by
default.

Relates to #36342
2019-03-19 21:27:08 -04:00
Nhat Nguyen fe03d24229
Reject illegal flush parameters (#40213)
This change rejects an illegal combination of flush parameters where
force is true, but wait_if_ongoing is false. This combination is trappy
and should be forbidden.

Closes #36342
2019-03-19 21:23:25 -04:00
Luca Cavanna d22c4b8db3
Re-enable bwc tests (#40215)
Relates to #40177 which is now merged and backported to all branches.
2019-03-19 21:25:46 +01:00
Zachary Tong 6f0f8ab4bc
Remove MovingAverage pipeline aggregation (#39328)
This was deprecated in 6.4.0 and for the entirety of 7.0.  Removed
in 8.0
2019-03-19 15:31:05 -04:00
Jim Ferenczi d234ef7612
Add date and date_nanos conversion to the numeric_type sort option (#40199)
This change adds an option to convert a `date` field to nanoseconds resolution
 and a `date_nanos` field to millisecond resolution when sorting.
The resolution of the sort can be set using the `numeric_type` option of the
field sort builder. The conversion is done at the shard level and is restricted
to dates from 1970 to 2262 for the nanoseconds resolution in order to avoid
numeric overflow.
2019-03-19 20:17:31 +01:00
Lisa Cawley 66b1fefbc5
[DOCS] Enable testing for API key examples (#39583) 2019-03-19 11:00:42 -07:00
Zachary Tong e368444bdb Mute SearchResponseMergerTests#testMergeSearchHits
Tracking issue: https://github.com/elastic/elasticsearch/issues/40214
2019-03-19 13:31:47 -04:00