Commit Graph

60468 Commits

Author SHA1 Message Date
Rory Hunter bf4e01e98e
Fix spotless gradle config (#76701)
An attempt to apply the spotless plugin everywhere and then disable
where it wasn't appropriate didn't work, and instead everything was
formatted. Revert how we apply the pluing, and use a different approach
to applying extra configuration in build files.
2021-08-19 14:38:21 +01:00
James Rodewig f02b10d68a
[DOCS] EQL: Remove multi-value field limitation (#76663)
Changes:
* Removes the limitation for multi-value fields.
* Adds a recommendation to avoid complex expressions for Boolean comparisons to the `string` fn.

Relates to #76610.
2021-08-19 09:20:48 -04:00
Dimitris Athanasiou cdd704a429
[ML] Stop model allocation node task on load failure (#76673)
When a model fails to load during allocation, we need to
stop the task so that future task-based requests do not
get routed to the older task.
2021-08-19 13:12:00 +03:00
Przemyslaw Gomulka 127015e54c
[Rest Api Compatibility] Clean up blocklist (#76179)
v7compatibilityNotSupportedTests was introduced to make it easier to
track tests that have been identified as not needing compatible changes
and those that still need to be checked.
We have checked all tests now and the separate list is no longer needed.

relates #51816
relates #73912
2021-08-19 10:09:46 +02:00
Yang Wang ccc9c3501a
Add docs for QueryApiKey API (#76521)
This PR adds documentation for the new QueryApiKey API added in #75335 and #76144

Relates: #71023
2021-08-19 10:11:38 +10:00
Gordon Brown b15578a5fe
Fix UnassignedInfo generation in AllocationRoutedStepTests (#76684)
This PR fixes the generation of `UnassignedInfo` in
AllocationRoutedStepTests#testExecuteAllocateUnassigned to
ensure that it will not trigger consistency-check assertions.
2021-08-18 17:54:53 -04:00
Tim Brooks dea32174f8
Do not checksum on LZ4 compress (#76666)
Currently we use the custom lz4-block scheme when compressing data. This
scheme automatically calculates and write a checksum when compressing.
We do not actually read this checksum when decompressing so it is
unnecessary. This commit resolves this by not writing a no-op checksum.
This will break arbitrary decompressors. However, since the lz4 block
format is not an official format anyway, this should be fine.

Relates to #73497.
2021-08-18 13:37:51 -06:00
Gordon Brown 0100e1148a
Remove Node Shutdown API feature flag (#76588)
* Remove Node Shutdown API feature flag

This PR removes the Node Shutdown API feature flag.

The Node Shutdown API will now always be available.

* Check if xpack is enabled in cleanup

When I removed the feature flag, I assumed that we would always have the
Node Shutdown APIs, but that turns out not to be the case if xpack isn't
enabled. This case was caught by the logic to handle the case where the
feature flag wasn't enabled by accident.

This commit adds the check we always should have had.

* Also check version before tyring cleanup
2021-08-18 14:35:02 -04:00
Jack Conradson e3985801a1
Add ability to augment classes with fields from other classes in Painless (#76628)
This change adds a a new "augmented" annotation to the Painless allowlist parser. The first use of the 
annotation supports adding static final fields to a specified allowlist class from another class. This 
supports the fields api as we can add additional fields types from other classes and augment the Field 
class with the new types.
2021-08-18 11:19:07 -07:00
Lisa Cawley 17848058d7
[DOCS] Add stub docs for QueryApiKey API (#76670) 2021-08-18 11:01:43 -07:00
James Rodewig 1acc7e5d5e
[DOCS] Remove unneeded sidebar from array docs (#76664) 2021-08-18 14:00:30 -04:00
Benjamin Trent 964816091e
[ML] refactor model allocation builders (#76463)
refactoring model allocation builders. The current design is fairly unintuitive and can make adding new states or predicates annoying.
2021-08-18 13:57:52 -04:00
Mark Vieira 13795c4e5e
Use Adoptium builds for bundled JDK (#76631) 2021-08-18 09:52:22 -07:00
Mark Vieira e7c0daee1c Add version constant for 7.16.0 2021-08-18 08:21:50 -07:00
Rene Groeschke 76c7e1bb94
Update nebula ospackage plugin (#76639)
This updates the nebula ospackage plugin to 8.6.1 that includes
a our provided PRs:

- https://github.com/nebula-plugins/gradle-ospackage-plugin/pull/402
- https://github.com/nebula-plugins/gradle-ospackage-plugin/pull/400
- https://github.com/nebula-plugins/gradle-ospackage-plugin/pull/397

and also an update to the redline library our fix for ssh256 headers

- https://github.com/craigwblake/redline/pull/157
2021-08-18 16:31:25 +02:00
Paweł Krześniak d2a6c1627f
[DOCS] Fix typo in parent-child example request (#76646) 2021-08-18 08:59:36 -04:00
Dimitris Athanasiou a9fd297dd0
[ML] Extend inference processor to work with allocated models (#76641)
This commit extends the `inference_processor` to support allocated
models. In particular, the internal infer action is now checking
if the model is allocated, and if so, it redirects the request
to an instance of the allocated model. If not, then it proceeds
as previously to load the model through the `ModelLoadingService`.

In addition, we now check that a model is not allocated when
the `StopTrainedModelDeploymentAction`.

Note that no new `InferenceConfigUpdate` objects are introduced
as there are no settings currently that can be set on inference time
for allocated models.
2021-08-18 15:17:46 +03:00
Bogdan Pintea 7a5ac3e4a9
EQL: Minimise CCS roundtrips (#76076)
This introduces an optimisation of the EQL requests when these target
one remote cluster only (i.e. no mixed local and remote indices or
multiple remote clusters). In this case, the EQL request is forwarded
to the remote cluster and executed there, instead of having the local
cluster perform multiple queries to the remote cluster.
2021-08-18 14:01:43 +02:00
Przemysław Witek ec07e4213e
[Transform] Rename interim_results to align_checkpoints (#76609) 2021-08-18 13:58:50 +02:00
Rory Hunter d01efa4fd6
Changes to keep Checkstyle happy after reformatting (#76464)
* Reformatting to keep Checkstyle after formatting

* Configure spotless everywhere, and disable the tasks if necessary

* Add XContentBuilder helpers, fix test

* Tweaks

* Add a TODO

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-08-18 07:15:55 -04:00
Rene Groeschke 86a577227e
Update Gradle wrapper to 7.2 (#75894)
* Update Gradle wrapper to 7.2-rc-1

Fix deprecation warnings on the go

* Remove deprecated lambda based Gradle task actions

* Remove usage of deprecated BasePluginConvention

* Update wrapper to 7.2-rc-2

* Update gradle wrapper to 7.2-rc-3

* Update gradle wrapper to 7.2
2021-08-18 05:11:28 -04:00
Georgii Gorbachev 87ca6faf25
Granting kibana_system reserved role access to all privileges to .internal.alerts* (#76624)
**Parent ticket:** https://github.com/elastic/kibana/issues/101016
**Related to:** https://github.com/elastic/elasticsearch/pull/72181

## Summary

Similar to the previous PR (https://github.com/elastic/elasticsearch/pull/72181), we'd like to add privileges to a new set of indices to the `kibana_system` role.

The reason for that is we need to have different naming schemes for alerts-as-data index aliases and backing indices pointing to these aliases, which in turn is needed to support backwards compatibility, migrations and reindexing in the future.

We didn't want to prefix the backing indices with `.kibana-`, so we're adding a new `.internal.alerts` prefix. Prefixing with `.kibana-` would make them system indices, which means they would not be supposed to be read by end users, which is not what we want.

`.internal` could become a universal prefix for hidden Kibana indices, but at this point I don't feel confident enough to generalise prematurely.
2021-08-17 20:16:54 -06:00
Gordon Brown bc5295bafc
Fix `NOT_STARTED` statuses appearing inappropirately during node shutdown (#75750)
This PR fixes two situations where `NOT_STARTED` can appear as the shard migration status inappropriately:
1. When the node is actually shut down after having all the shards migrate away.
2. When a non-data-node is registered for shutdown.

It also adds tests to ensure these cases are handled correctly.
2021-08-17 20:03:34 -06:00
Mark Vieira 241dae950c Mute AllocationRoutedStepTests.testExecuteAllocateUnassigned 2021-08-17 17:30:53 -07:00
Gordon Brown 8baa753033
Fix parsing of node shutdown allocation delay (#76589)
This commit fixes the parsing of allocation delay from XContent, which
was previously completely broken. Also adjusts the tests to exercise
that parsing.
2021-08-17 16:47:36 -06:00
Gordon Brown 66fc127c35
Reenable BWC after backport of #75606 (#76617)
This PR changes the serialization version for the contents of #75606 and re-enables BWC tests following the backport of that PR (backport in #76587).
2021-08-17 14:14:55 -06:00
Gordon Brown cd98d99ee8
Mute EqlSearchIt.testMultiValueFields (#76623)
This commit mutes testMultiValueFields, as it is flaky (see #76618)
2021-08-17 13:16:45 -06:00
Lyudmila Fokina 207f783924
Adding base RestHandler class for Enrollment APIs (#76564)
* Adding base RestHandler class for Enrollment APIs

This change adding an abstract RestHandler class and extends it by
enrollment API classes (node and Kibana enrollment). It will handle the
cases when `enrollment.enabled` is not set to `true`. It will return an
appropriate exception in this case.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-08-17 21:13:17 +02:00
Tim Brooks 673e8e17f4
Enable LZ4 transport compression by default (#76326)
This commit enables LZ4 transport compression by default at the
indexing_data level.

Relates to #73497.
2021-08-17 12:19:42 -06:00
Nik Everett a84427dde2
Gracefully handle very large sizes on terms (#76578)
* Gracefully nandle very large sizes on terms

Folks often as for the `terms` agg to have *very* large `size`
parameters in an effort to get everything they can. But they never fill
that large size. They can't! There isn't really enough heap to return
two billion buckets.

After #74096 we try to pre-allocate an array of `size + 1` length,
regardless of how many results are returned. When folks ask for
`MAX_INT` buckets this helpfully fails off in lucene land with an error
message that fairly esoterit to someone reading it outside of
Elasticsearch.

This change handles that `MAX_INT` case by building a
`TopBucketsBuilder` designed to handle large max sizes that are rarely
filled. When you ask for 1024 or more buckets you get that one instead
and we don't preallocate the entire array for the reduction. You get the
old preallocated one when you have few buckets.

Closes #76492

* fixup skip

* Moar comment
2021-08-17 14:15:59 -04:00
Jack Conradson dd8f0f3ff0
Move AnnotationTestObject to test package (#76619)
An extraneous test class was part of the spi core package. This change moves it to the test package. 
Also fixes a typo.
2021-08-17 11:11:17 -07:00
David Turner efe4a6b278
Use MockPageCacheRecycler in InboundDecoderTests (#76616)
The `InboundDecoderTests` use `PageCacheRecycler#NON_RECYCLING_INSTANCE`
for their recycler, which has no leak detection. This commit replaces it
with a `MockPageCacheRecycler` to catch leaks in this area, and fixes
the two (test-only) leaks that it found.
2021-08-17 18:54:25 +01:00
Gordon Brown 757662140e Disable BWC for backport of #75606 2021-08-17 10:31:54 -06:00
Andrei Dan 050acc97b3
Rewind ILM if create-snapshot fails to take snapshot (#75961)
This fixes the case when the create-snapshot step fails because it treats
a partial snapshot as a failure, hence the step will be retried and every retry
will fail as the snapshot already exists in the repository.

This makes the step report "incomplete" and have ILM rewind to `cleanup-snapshot`
step in order to first delete the existing (partial) snapshot and create a fresh one.

The change is quite big due to changing the signature of AsyncActionStep#performAction
to not use ActionListener<Boolean> (as all steps should've return true) but to use
ActionListener<Void>. This also deletes AsyncActionBranchingStep because it was
unfit for purpose given the new *explicit* binary state (success or failure) for async
steps - which was the source of the bug this commit is fixing.
2021-08-17 17:16:20 +01:00
James Baiera 543bca83e9
Aggregate data tier index stats separately from node stats (#76322)
Separate the stats collection for data tiers into two steps: nodes then index stats. Nodes are 
summarized by all the configured tiers they are assigned to. Indices are then checked for 
their most preferred tier, and are then summarized based on that, regardless of which node 
an index's shards are hosted from.
2021-08-17 11:15:27 -04:00
Stuart Tettemer aea8bfffc8
Script: ulong via fields API (#76519)
* Script: ulong via fields API

Exposes unsigned long via the fields API.

Unsigned longs default to java signed longs.  That means the upper range
appears negative.  Consumers should use `Long.compareUnsigned(long, long)`
`Long.divideUnsigned(long, long)` and `Long.remainderUnsigned(long, long)`
to correctly work with values known to be unsigned long.

Alternatively, users may treat the unsigned long type as `BigInteger` using
the field API, `field('ul').as(Field.BigInteger).getValue(BigInteger.ZERO)`.
```
field('ul').as(Field.BigInteger).getValue(BigInteger.valueOf(1000))
field('ul').getValue(1000L)
```

This change also implements the beginning of the converters for the fields
API.  The following conversions have been added:
```
ulong <-> BigInteger
long <-> BigInteger
double -> BigInteger
String (parsed as long or double) -> BigInteger
double -> long
String (parsed as long or double) -> long
Date (epoch milliseconds) -> long
Nano Date (epoch nanoseconds) -> long
boolean (1L for true, 0L for false) -> long
```
2021-08-17 10:06:28 -05:00
Adam Locke 0428970202
[DOCS] Add link to preview release page (#76510)
Adds a link to the [Elasticsearch Downloads page](https://www.elastic.co/downloads/elasticsearch#preview-release) for the `8.0.0-alpha1` release.
2021-08-17 09:05:36 -04:00
Dan Hermann dd7eedea78
Map iteration support for ForEach processor (#64062) 2021-08-17 07:21:46 -05:00
Andrei Stefan 0c2c93e732
EQL: mulit-value fields support (#76610)
Adds multi-valued fields support:
- remove in-place optimizations (ranges, binary comparisons, negation
logic)
- functions support for different values of the same field in multi-use
scenarios
- null handling
- negation handling
- backwards compatibility checks and tests for multi-value fields support
2021-08-17 15:05:30 +03:00
Henning Andersen 2bfeab6165
Mute recover from snapshot rolling first round (#76601)
Selectively muting parts of the rolling upgrade test for recover from
snapshot.

Relates #76595
2021-08-17 13:51:37 +02:00
Ioannis Kakavas a59684835d
Enroll Kibana API uses Service Accounts (#76370)
This commit changes the Enroll Kibana API to create and return
a token for this service account, instead of setting and returning the
password of the kibana_system built-in user. Both the token name and
value are returned in the response of the API.
2021-08-17 14:41:35 +03:00
Henning Andersen 031d9bb433
Test recovery from snapshot with indexing (#76550)
Add test to verify that concurrently indexing together with recover from
snapshot works.

Relates #76237
2021-08-17 12:03:20 +02:00
Rene Groeschke 1435e48578
Provide better error message when jdk metadata cannot be resolved (#76607)
This should help track down problems with the GlobalInfoPlugin people reported
2021-08-17 06:02:58 -04:00
Tim Vernum 5aa4a9422a
Migrate more code away from X-Pack SSL (#76142)
This commit is a bundle of changes to support the removal of X-Pack
SSL in favour of the ssl-config library.

The main changes are:
1. Migrating some certificate management in PKI and SAML realm to use
   ssl-config
2. Updating a variety of test cases to use ssl-config for their SSL
   setup and verification
2021-08-17 18:49:45 +10:00
Martijn van Groningen d764726e2e
Remove IndexAbstraction.DataStreamAlias implementation. (#76559)
Remove IndexAbstraction.DataStreamAlias implementation and instead reuse the `IndexAbstraction.Alias` implementation for data stream aliases.
2021-08-17 09:11:59 +02:00
Yang Wang 7bb1185806
HLRC support for query API key API (#76520)
This PR adds HLRC for the new Query API key API added with #75335 and #76144

Relates: #71023
2021-08-17 16:00:55 +10:00
Tim Vernum c1a32447a7
Recompute active realms when license changes (#76592)
This commit changes the implementation of the Realms class to listen
for license changes, and recompute the set of actively licensed realms
only when the license changes rather than each time the "asList" method
is called.

This is primarily a performance optimisation, but it also allows us to
turn off the "in use" license tracking for realms when they are
disabled by a change in license.

Relates: #76476
2021-08-17 15:53:19 +10:00
Yang Wang add0b7727f
[Test] Improve assertions for better messages on failure (#76543)
This PR adjusts assertions in testPagination so that more detailed messages
would be made available on failures. For example, if the sorted keys do not
match the expected order, it now shows all keys for better context instead of
just the single mismatched key.

Relates: #76542
2021-08-17 15:40:42 +10:00
Yang Wang 55cd7bb9d6
Query API key - Rest spec and yaml tests (#76238)
This PR adds Rest API spec and related yaml tests for the new Query API key API.

Relates: #71023
2021-08-17 10:56:40 +10:00
Gordon Brown 58f66cf04a
Delay shard reassignment from nodes which are known to be restarting (#75606)
This PR makes the delayed allocation infrastructure aware of registered node shutdowns, so that reallocation of shards will be further delayed for nodes which are known to be restarting.

To make this more configurable, the Node Shutdown APIs now support a `allocation_delay` parameter, which defaults to 5 minutes. For example:
```
PUT /_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown
{
  "type": "restart",
  "reason": "Demonstrating how the node shutdown API works",
  "allocation_delay": "20m"
}
```

Will cause reallocation of shards assigned to that node to another node to be delayed by 20 minutes. Note that this delay will only be used if it's *longer* than the index-level allocation delay, set via `index.unassigned.node_left.delayed_timeout`.

The `allocation_delay` parameter is only valid for `restart`-type shutdown registrations, and the request will be rejected if it's used with another shutdown type.
2021-08-16 15:59:50 -06:00