Commit Graph

48166 Commits

Author SHA1 Message Date
Ioannis Kakavas 9ee7b3743e
Add FIPS 140 mode to XPack Usage API (#47278) (#47976)
This change adds support for the FIPS 140 mode feature to be
retrieved via the XPack Usage API.
2019-10-14 10:40:24 +03:00
Nhat Nguyen 8180cf1e68 Mute testDoNotInfinitelyWaitForMapping
Tracked at #47974
2019-10-13 22:06:50 -04:00
Nhat Nguyen 2995d4a9c0 Sequence number based replica allocation (#46959)
With this change, shard allocation prefers allocating replicas on a node
that already has a copy of the shard that is as close as possible to the
primary, so that it is as cheap as possible to bring the new replica in
sync with the primary. Furthermore, if we find a copy that is identical
to the primary then we cancel an ongoing recovery because the new copy
which is identical to the primary needs no work to recover as a replica.

We no longer need to perform a synced flush before performing a rolling
upgrade or full cluster start with this improvement.

Closes #46318
2019-10-13 22:06:50 -04:00
Nhat Nguyen 4f06225928 Avoid unneeded refresh with concurrent realtime gets (#47895)
This change should reduce refreshes for a use-case where we perform 
multiple realtime gets at the same time on an active index. Currently,
we only call refresh if the index operation is still on the versionMap.
However, at the time we call refresh, that operation might be already or
will be included in the latest reader. Hence, we do not need to refresh.
Adding another lock here is not an issue as the refresh is already
sequential.
2019-10-13 20:08:21 -04:00
Nhat Nguyen 4c1bb210cb Force flush in translog retention policy test (#47879)
If we roll translog but do not index, then a flush without force is a 
noop. In this case, the number of retained translog files will be higher
than the value specified by the retention policy.

Closes #4741
2019-10-13 20:08:21 -04:00
David Roberts 46ae86ac31 [ML] Fix detection of syslog-like timestamp in find_file_structure (#47970)
Usually syslog timestamps have two spaces before a single
digit day-of-month. However, in some non-syslog cases
where syslog-like timestamps are used there is only one
space. The grok pattern supports this, so the timestamp
parser should too. This change makes the
find_file_structure endpoint do this.

Also fixes another problem that the same test case
exposed in the find_file_structure endpoint, which was
that the exclude_lines_pattern for delimited files was
always created on the assumption the delimiter was a
comma. Now it is based on the actual delimiter.
2019-10-13 20:07:54 +01:00
Tanguy Leroux 742fa818b8
Add Pause/Resume Auto Follower APIs (#47510) (#47904)
This commit adds two APIs that allow to pause and resume
CCR auto-follower patterns:

// pause auto-follower
POST /_ccr/auto_follow/my_pattern/pause

// resume auto-follower
POST /_ccr/auto_follow/my_pattern/resume

The ability to pause and resume auto-follow patterns can be
useful in some situations, including the rolling upgrades of
cluster using a bi-directional cross-cluster replication scheme
(see #46665).

This commit adds a new active flag to the AutoFollowPattern
and adapts the AutoCoordinator and AutoFollower classes so
that it stops to fetch remote's cluster state when all auto-follow
patterns associate to the remote cluster are paused.

When an auto-follower is paused, remote indices that match the
pattern are just ignored: they are not added to the pattern's
followed indices uids list that is maintained in the local cluster
state. This way, when the auto-follow pattern is resumed the
indices created in the remote cluster in the meantime will be
picked up again and added as new following indices. Indices
created and then deleted in the remote cluster will be ignored
as they won't be seen at all by the auto-follower pattern at
resume time.

Backport of #47510 for 7.x
2019-10-13 09:22:51 +02:00
Marios Trivyzas 65717f6f42 SQL: Fix Nullability of DATEADD (#47921)
Previously, Nullability was set to UNKNOWN instead of TRUE which
resulted on QueryFolder not correctly folding to NULL if any of the args
was null.

Remove the overriding nullable() also for DatePart/DateTrunc to allow
delegation the parent class.

(cherry picked from commit 05a7108e133b5ae7bec2257db5ae2d30ad926ee2)
2019-10-12 13:25:08 +02:00
Yogesh Gaikwad ac209c142c
Remove uniqueness constraint for API key name and make it optional (#47549) (#47959)
Since we cannot guarantee the uniqueness of the API key `name` this commit removes the constraint and makes this field optional.

Closes #46646
2019-10-12 22:22:16 +11:00
Ryan Ernst dc8080e88a Add snapshot support to distribution download plugin (#47837)
The distribution download plugin which handles finding built
distributions for testing currently only knows how to find locally built
snapshots. When an external Elasticsearch plugin uses build-tools, these
snapshots do not exist. This commit extends the download plugin so it
pulls from the Elastic snapshots service when used outside of the
Elasticsearch repository.

closes #47123
2019-10-11 16:14:43 -07:00
Przemyslaw Gomulka 6ab58de7ef
[7.x] Enable ResolverStyle.STRICT for java formatters backport(#46675) (#47913)
Joda was using ResolverStyle.STRICT when parsing. This means that date will be validated to be a correct year, year-of-month, day-of-month
However, we also want to make it works with Year-Of-Era as Joda used to, hence custom temporalquery.localdate in DateFormatters.from
Within DateFormatters we use the correct uuuu year instead of yyyy year of era

worth noting: if yyyy(without an era) is used in code, the parsing result will be a TemporalAccessor which will fail to be converted into LocalDate. We mostly use DateFormatters.from so this takes care of this. If possible the uuuu format should be used.
2019-10-11 21:19:56 +02:00
Benjamin Trent 627faf1850
[7.x] [ML][Analytics] fix bug where regression deleted early does not delete state (#47885) (#47914)
* [ML][Analytics] fix bug where regression deleted early does not delete state (#47885)

* [ML][Analytics] fix bug where regression deleted early does not delete state

* Fixing ml with security test failure

* fixing for older java
2019-10-11 15:11:16 -04:00
Nick Knize 7f01b0a670 Mute AzureBlobStoreRepositoryTests.testIndicesDeletedFromRepository (#47949) 2019-10-11 14:07:24 -05:00
Nick Knize 68eaa21d77 Mute testBasicFailureRetention (#47940) 2019-10-11 14:03:46 -05:00
Chris Roberson c57191b163
[Monitoring] Add new cluster privilege now necessary for the stack monitoring ui (#47871) (#47915)
* Add new cluster privilege now necessary for the stack monitoring ui

* PR feedback, and add test
2019-10-11 14:54:59 -04:00
Benjamin Trent 1636fa5f15
[ML][Transforms] Muting tests in 7.x (#47946) 2019-10-11 14:49:20 -04:00
William Brafford fe8767789a
GlobalBuildInfo plugin should search packed references for commit IDs (#47464) (#47936)
* GlobalBuildInfo plugin searches packed references

In recent versions of Git, references may be packed in a packed-refs
file. If this happens, Gradle will need to look in that file to find
build information.
2019-10-11 14:47:34 -04:00
James Rodewig 256102042b
[DOCS] Reformat get snapshot lifecycle policy API docs (#47827) (#47930) 2019-10-11 13:00:48 -04:00
Christoph Büscher 2ef12c37f5 Add builder for distance_feature to QueryBuilders (#47846)
The QueryBuilders convenience class is currently missing a shortcut to construct
a DistanceFeatureQueryBuilder, which is added here.

Closes #47767
2019-10-11 18:20:01 +02:00
Alpar Torok 5cbc96ccb6
Fix dependency info tasks (#47857)
We fixed warnings related to task input and outputs in #45098.
This particular input was not considered, a warning was present for it
and Gradle didn't use it as part of task inputs.
As soon as we fixed it Gradle started considering it an input and
enforced that it exists.

With this change we make it optional as the task can work both wih and
without this directory.
2019-10-11 11:11:52 -05:00
Alan Woodward ec9198d0e2
Adjust Version.V_6_8_4 to refer to Lucene 7.7.2 (#47926)
6.8.4 will ship with Lucene 7.7.2, so we need to change our version settings to
reflect this.

Relates #47901
2019-10-11 17:01:42 +01:00
James Rodewig aa5689f5b3
[DOCS] Reformat put snapshot lifecycle policy API docs (#47811) (#47925) 2019-10-11 11:28:38 -04:00
Hendrik Muhs 0ca53bd80e
add BWC alias for internal index
create an alias for old nodes to retrieve new documents in the internal index as they do not know the new index pattern
2019-10-11 17:15:01 +02:00
David Turner ba62eb3dce Allow truncation of clean translog (#47866)
Today the `elasticsearch-shard remove-corrupted-data` tool will only truncate a
translog it determines to be corrupt. However there may be other cases in which
it is desirable to truncate the translog, for instance if an operation in the
translog cannot be replayed for some reason other than corruption. This commit
adds a `--truncate-clean-translog` option to skip the corruption check on the
translog and blindly truncate it.
2019-10-11 15:48:12 +01:00
James Rodewig 58289a857d
[DOCS] Reformat reload search analyzers API docs (#47824) (#47907) 2019-10-11 09:40:49 -04:00
Ioannis Kakavas 33705c4b95
Document SAML APIs (#45105) (#47909)
This change adds documentation for the SAML APIs in Elasticsearch
and adds simple instructions on how these APIs can be used to
authenticate a user with SAML by a custom web application other
than Kibana.

Resolves: #40352
2019-10-11 16:34:11 +03:00
Przemysław Witek c62fe8c344
Require that the dependent variable column has at most 2 distinct values in classfication analysis. (#47858) (#47906) 2019-10-11 14:57:08 +02:00
Henning Andersen a0d0866f59 Shrink should not touch max_retries (#47719)
Shrink would set `max_retries=1` in order to avoid retrying. This
however sticks to the shrunk index afterwards, causing issues when a
shard copy later fails to allocate just once.

Avoiding a retry of a shrink makes sense since there is no new node
to allocate to and a retry will likely fail again. However, the downside of
having max_retries=1 afterwards outweigh the benefit of not retrying
the failed shrink a few times. This change ensures shrink no longer
sets max_retries and also makes all resize operations (shrink, clone,
split) leave the setting at default value rather than copy it from source.
2019-10-11 14:22:56 +02:00
Hendrik Muhs 3da91d5f7a
[Transform] Rename internal indexes for transform plugin (#47788) (#47900)
rename internal indexes of transform plugin

- rename audit index and create an alias for accessing it, BWC: add an alias for old indexes to
  keep them working, kibana UI will switch to use the read alias
- rename config index and provide BWC to read from old and new ones
2019-10-11 14:16:17 +02:00
Hendrik Muhs 5dd6bd6f49
do not assert on state in mixed cluster due to endpoint differences (#47898)
do not assert on state in mixed cluster due to endpoint differences between 7.3 and 7.4

regression #46452
fixes #47693
2019-10-11 12:27:54 +02:00
Przemyslaw Gomulka 0c439fe495
[7.x] Allow partial parsing dates (#47872) backport(#46814)
Enable partial parsing of date part. This is making the behaviour in java.time implementation the same as with joda.
2018, 2018-01 and 2018-01-01 are all valid dates for date_optional_time or strict_date_optional_time
closes #45284
closes #47473
2019-10-11 11:17:19 +02:00
Hendrik Muhs fd1c4c198a [Transform] fixes tests which might fail due to auto-stop (#47867)
Batch transforms automatically stop after all data has processed, therefore tests can not reliable test the state. This change rewrites tests to remove the unreliable tests or use continuous transforms instead as they do not auto-stop.

fixes #47441
2019-10-11 11:10:38 +02:00
Przemysław Witek d210bfa888
[7.x] Add MlClientDocumentationIT tests for classification. (#47569) (#47896) 2019-10-11 10:19:55 +02:00
Alexander Reelsen e60221d2bd Update jakarta mail dependency to 1.6.4 (#47810)
This one contains a few small bugfixes, see https://eclipse-ee4j.github.io/mail/docs/CHANGES.txt
2019-10-11 09:24:11 +02:00
Alpar Torok ec91fa5df1 Make the run task honor tests.es properties (#47860)
* Make the run task honor tests.es properties

Closes #47797

With this PR we now again honor tests.es and tests.heap.size

* remove debuging
2019-10-11 04:38:32 +03:00
Matt Braymer-Hayes d315726c23 [DOCS] Fix gcloud command typo in discovery-gce.asciidoc. (#47312) 2019-10-10 14:21:46 -04:00
Armin Braun 48823b1112
Fix SLMSnapshotBlockingIntegTests (#47841) (#47863)
One of the tests in this suit stops a master node,
plus we're doing other node starts in this suit.
=> the internal test cluster should be TEST and not `SUITE`
scoped to avoid random failures like the one in #47834

Closes #47834
2019-10-10 18:41:57 +02:00
Zachary Tong 2de3411c9c Make sibling pipeline agg ctor's protected (#42808)
SiblingPipelineAggregator is a public interfaces,
but the ctor was package-private.  These should be protected so that
plugin authors can extend and implement their own sibling pipeline agg.
2019-10-10 12:31:14 -04:00
Marios Trivyzas 59b3294bc9 SQL: Implement DATEADD function (#47747)
Implement DATEADD/TIMESTAMPADD function as per the MS-SQL spec:
https://docs.microsoft.com/en-us/sql/t-sql/functions/dateadd-transact-sql?view=sql-server-2017
which allows a user to add/subtract specified number of specified units
to/from a date/datetime field/expression.

Closes: #47746
(cherry picked from commit e624bc281bebb4bbe0b0c2e0a8cbc712e50097a8)
2019-10-10 16:22:13 +02:00
Igor Motov b5afa95fd8 Fix Mute RunDataFrameAnalyticsIT.testOutlierDetectionStopAndRestart
Tracked by #47612
2019-10-10 18:17:01 +04:00
Igor Motov 17433e79d8 Mute RunDataFrameAnalyticsIT.testOutlierDetectionStopAndRestart
Tracked by #47612
2019-10-10 17:56:23 +04:00
James Rodewig a8e027551a
[DOCS] Document `bytes` and `time` params in cat API docs (#47672) (#47854) 2019-10-10 09:48:40 -04:00
Costin Leau dc6f0f9dc7 SQL: Re-enable muted test
Close #47080

(cherry picked from commit 63a0aa7b392f565ea01ac478fec1dd91a80202e5)
2019-10-10 15:47:47 +03:00
Christoph Büscher f07de06cdd
Ensure random timestamps are within search boundary (#38753) (#47787)
The random timestamps were landing too close to the current time,
so an unlucky rollup interval would round such that the doc wasn't
included in the search range (and thus not "rolled up") which
would then fail the test.

The fix is to make sure the timestamp of all docs is sufficiently behind
'now' that the possible rounding intervals will always include them.

Backport of #38753 to 7.x where the test was still muted.
2019-10-10 14:38:01 +02:00
Marios Trivyzas c1f30e34ff SQL: Refactor binary date time functions (#47786)
Refactor DateTrunc and DatePart to use separate Pipe classes which
allows the removal of the BinaryDateOperation enum.

(cherry picked from commit a6075e7718dff94a90dbc0795dd924dcb7641092)
2019-10-10 13:52:41 +02:00
Andrei Stefan 6a4bf5de2c SQL: make date/datetime and interval types compatible in conditional functions (#47595)
(cherry picked from commit 6ff953e6396d7cc90640419aee5d036954e2eae3)
2019-10-10 13:58:35 +03:00
István Zoltán Szabó 9eac8bf2a8 [DOCS] Adds supported fields section to the PUT DFA API description (#47842) 2019-10-10 12:42:54 +02:00
David Turner ecb20ebc6c More bootstrap docs tweaks (#47809)
Clarifies not to set `cluster.initial_master_nodes` on nodes that are joining
an existing cluster.

Co-Authored-By: James Rodewig <james.rodewig@elastic.co>
2019-10-10 09:55:30 +01:00
Jim Ferenczi dc39196ea4 Fix tag in the search request timeout option docs (#47776)
and add missing parentheses `search_timeout` param
2019-10-10 10:35:44 +02:00
Jim Ferenczi bd6e2592a7 Remove the SearchContext from the highlighter context (#47733)
Today built-in highlighter and plugins have access to the SearchContext through the
highlighter context. However most of the information exposed in the SearchContext are not needed and a QueryShardContext
would be enough to perform highlighting. This change replaces the SearchContext by the informations that are absolutely
required by highlighter: a QueryShardContext and the SearchContextHighlight. This change allows to reduce the exposure of the
complex SearchContext and remove the needs to clone it in the percolator sub phase.

Relates #47198
Relates #46523
2019-10-10 10:34:10 +02:00