Commit Graph

60468 Commits

Author SHA1 Message Date
Mark Vieira bd2340a288 Pull down beats artifacts when performing release tests 2021-08-23 09:44:34 -07:00
David Turner 4a17847b85
Add timing stats to publication process (#76771)
This commit introduces into the node stats API various statistics to
track the time that the elected master spends in various phases of the
cluster state publication process.

Relates #76625
2021-08-23 17:38:32 +01:00
David Turner c880f8c1d8
Fix BanFailureLoggingTests some more (#76668)
We spawn a background task to mark a task as cancelled when its inbound
connection closes. In these tests this might not happen until we've shut
the threadpool down, in which case it never happens. This change ensures
that we're not waiting for the cancellation to happen when the test
exits.

Closes #76558
2021-08-23 17:37:32 +01:00
David Turner 61be724cc2
Mention "warn threshold" in master service slowlog (#76815)
We tend to include the phrase `warn threshold` in log messages
indicating that something took much longer than we expected. The
`MasterService` has some log messages that date from before the adoption
of this convention. This commit adds the phrase `warn threshold` to
those logs.

Relates #76625
2021-08-23 17:23:04 +01:00
Rory Hunter a1fb9a92bb Fix DockerTests.test010Install 2021-08-23 16:42:34 +01:00
Lyudmila Fokina 3a8586b596
Re-enable tests affected by #75097 (#76814)
This change #76636 actually resolved the #75097 by only filtering out
the CAs certs/keys from xpack.security.http.ssl keystore
This change re-enables the tests previously affected by #75097

Resolves: #75097

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-08-23 17:35:04 +02:00
Henning Andersen 179a3fcd31
Fix testRecoveryIsCancelledAfterDeletingTheIndex (#76644)
Closes #76560
2021-08-23 17:25:37 +02:00
markharwood d9fa53b9a8
Test fix -WildcardFieldMapperTests bad test data. (#76819)
Seed produced a random document field value that didn’t produce any of the characters we were searching for.
Closes #76811
2021-08-23 15:08:01 +01:00
Keith Massey 83ca8b91c7
Updating supported version after backporting the feature (#76794)
Updating the version where the total_shards_per_node parameter is supported, after backporting the feature to 7.16.
Relates to #76775 #44070
2021-08-23 09:03:49 -05:00
Rory Hunter b8c356f7e6 Mute DockerTests.test140CgroupOsStatsAreAvailable
See #76812
2021-08-23 13:34:22 +01:00
James Rodewig 31153e0002
[DOCS] Fix multi-value search `preference` docs (#76822)
You can't combine a `_shards` search `preference` argument with `<custom-string>`.
2021-08-23 08:33:12 -04:00
Martijn van Groningen 8a1deff75a
Improve fault-detection.asciidoc (#76821)
Add section to fault-detection.asciidoc about nodes being removed from cluster
due to slow cluster state applying.
2021-08-23 14:31:06 +02:00
István Zoltán Szabó 8aed99fc02
[DOCS] Adds links that point to loss function to ML API docs. (#76438) 2021-08-23 13:09:37 +02:00
David Kyle addd7855eb
Fix spotless formatting (#76810) 2021-08-23 06:51:32 -04:00
Rory Hunter f738ba8139 Tweak Dockerfile.cloud-ess
Some Docker builds are apparently complaining about the `COPY` syntax in
this file, so try and fix it as Docker suggests.
2021-08-23 11:19:00 +01:00
David Kyle cf6a83fea5
Mute various CliSecurityIT tests (#76809) 2021-08-23 05:29:26 -04:00
David Kyle cf0d2b56aa
Mute testDiagnosticTrustManagerForHostnameVerificationFailure on Windows (#76805) 2021-08-23 04:53:20 -04:00
David Kyle abad722d61
Mute testShardStatusStaysCompleteAfterNodeLeavesIfRegisteredWhileNodeOffline (#76804) 2021-08-23 09:27:23 +01:00
markharwood 81e0bc2031
NullPointer fix for field capabilities API (#76742)
Composite runtime fields do not have a mapped type - add null check, test and Nullable annotation to SearchExecutionContext.getObjectMapper(name)

Closes #76716
2021-08-23 09:06:59 +01:00
James Rodewig 38fe33a870 [DOCS] Fix whitespace to hide attribute 2021-08-22 21:18:51 -04:00
Gordon Brown 660a3a84f8
Fix NPE in NodeSeenService (#76788)
This commit adjusts `NodeSeenService` to check if the `NodesShutdownMetadata`
is `null` before trying to work with it. If it is `null`, we can simply
return from the method early as we know there are no shutdowns registered.
2021-08-20 18:09:40 -04:00
Mark Vieira 0f6cbbf3d4 Add Debian 11 to packaging and platform test matrix 2021-08-20 14:48:10 -07:00
Mark Vieira d409122ce0 Disable Jenkins JUnit publisher 2021-08-20 13:49:55 -07:00
Rory Hunter d57b16403b Don't build Cloud docker images on assemble 2021-08-20 21:31:12 +01:00
Rory Hunter a6f2a4df8b
Introduce Cloud docker variant (#74980)
Closes #74795.

Introduce two Docker image variants for Cloud. The first bundles
(actually installs) the S3, Azure and GCS repository plugins. The
second bundles all official plugins, but only installs the repository
plugins.

Both images also bundle Filebeat and Metricbeat.

The testing utils have been refactored to introduce a `docker`
sub-package. This allows the static `Docker.containerId` to be
shared without needing all the code in one big class. The code for
checking file ownership / permissions has also been refactored to
a more Hamcrest style, using a custom Docker file matcher.
2021-08-20 20:11:05 +01:00
Armin Braun 484a0780f8
Remove Dead NamedWritableRegistry Fields in Aggs/Search Code (#76743)
No need for the registry in these places anymore => we can simplify things here and there.
2021-08-20 17:45:38 +02:00
Julie Tibshirani 334b184b44
Make sure copy_to accepts null values (#76665)
In #72820 we improved the error message when attempting to `copy_to` with an
object value. The change accidentally started throwing errors for null values
too, although they're allowed. This PR fixes the regression and adds an
explicit test for `copy_to` with null values.
2021-08-20 07:55:14 -07:00
Tom Veasey e511a2555d
[ML] Avoid very low p-values if the term is only a tiny fraction of the foreground set (#76764)
Whilst testing the p_value scoring heuristic for significant terms introduced
in #75313 it became clear we can assign arbitrarily low p-values if the overall
counts are high enough for terms which constitute a very small fraction of the
foreground set. Even if the difference in their frequency on the foreground and
background set is statistically significant they don't explain the majority of the
foreground cases and so are not of significant interest (certainly not in the use
cases we have for this aggregation).

We already have some mitigation for the cases that 1. the term frequency is
small on both the foreground and background set, 2. the term frequencies are
very similar. These offset the actual term counts by a fixed small fraction of
the background counts and make the foreground and background frequencies
more similar by a small relative amount, respectively. This change simply applies
offsets to the term counts before making frequencies more similar. For frequencies
much less than the offset we therefore get equal frequencies on the foreground
and background sets and p-value tends to 1. This retains the advantage of being
a smooth correction to the p-value so we get no strange discontinuities in the
vicinity of the small absolute and difference thresholds for the frequency.
2021-08-20 15:53:22 +01:00
Keith Massey 0aab3c01c9
Ensuring that the ShrinkAction does not hang if total shards per node is too low (#76732)
We added configuration to AllocateAction to set the total shards per node property on the index. This makes it possible that a user could set this to a value lower than the total number of shards in the index that is about to be shrunk, meaning that all of the shards could not be moved to a single node in the ShrinkAction. This commit unsets the total shards per node property so that we fall back to the default value (-1, unlimited) in the ShrinkAction to avoid this.
Relates to #44070
2021-08-20 09:41:19 -05:00
Ioannis Kakavas 4c149e8183
Generate and store password hash for elastic user (#76276)
For package installations (DEB,RPM), we are generating a
random strong password for the elastic user on installation time
so that we can show it to the user.
We subsequently hash and store this password in the
elasticsearch.keystore so that the node can pick it up on the first
run and use it to populate the relevant document for the elastic
user in the security index.
This change implements a class that can be called from the package
installation scripts (postinst) to

- Generate a strong password
- Hash it with the configured(default) password hashing algo
- Store it in the elasticsearch.keystore
- Print it in stdout so that it the bash script can capture it.
2021-08-20 16:56:28 +03:00
Jay Modi 22e9d3719d
System indices treated as restricted indices (#74212)
System indices should be treated as a special set of indices and not be
accessible by all users. The existing security codebase has the notion
of restricted indices, which are currently a subset of system indices.

This change unifies the two concepts by making system indices the set
of restricted indices. This means that going forward, consumers of
system indices will need access to restricted indices.

Our intention is that this will be handled internally as much as
possible.  For example, restricted index access can be used implicitly 
by setting a valid origin on a request or using a system index plugin.
In these cases, the security module will apply internally defined
privileges when necessary.

The main impact of this change for developers is that system index
deletions will require superuser privileges, so we have to make sure
we are using an admin role for test cleanup.

Closes #69298

Co-authored-by: William Brafford <william.brafford@elastic.co>
Co-authored-by: Albert Zaharovits <albert.zaharovits@elastic.co>
2021-08-20 09:28:33 -04:00
Benjamin Trent fbc982122c
Fixing bwc yaml test version after #76730 backport (#76746) 2021-08-20 09:14:11 -04:00
Peter Dyson cad55c8393
[DOCS] Clarify usage of optional human readable jvm uptime metric in Nodes Stats API (#76545)
To return the JVM `uptime` metric, the `human` query parameter must be `true`.

Co-authored-by: Adam Locke <adam.locke@elastic.co>
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
2021-08-20 08:55:23 -04:00
James Rodewig e246e1ce53
[DOCS] Remove 'step' from headings (#76753) 2021-08-20 08:52:04 -04:00
James Rodewig 22a6c1f0d3
[DOCS] Add search xref tip to `query_string` docs (#76728)
Adds a tip containing a cross-reference to the "Search your data" docs.
This is the preferred starting point for ES search.
2021-08-20 08:44:20 -04:00
James Rodewig 1304e648c8
[DOCS] Fix upgrade version logic for `-alpha` and `-beta` releases (#76727) 2021-08-20 08:29:35 -04:00
James Rodewig 1c355bfda9
[DOCS] Reuse snapshot config in put SLM policy API docs (#76712)
Updates the put SLM policy API's `config` parameter to reuse the create snapshot API's request body parameters.
Previously, the `config` parameter was missing the `feature_states` parameter. This change should keep the two docs in sync.
2021-08-20 08:29:16 -04:00
Benjamin Trent 55edc62b0d
Fix bug with significant terms background count (#76730)
When building empty responses for shards that don't have the term field in question,
significant terms ignored the background filter.

This commit fixes this bug by respecting the background filter count, even
when building empty results.

closes #76729
2021-08-20 07:20:55 -04:00
David Turner e87337fa38
Add descriptions to various tasks (#76700)
Adds a more detailed description to get-snapshots, get-shard-snapshot,
snapshots-status and field-capabilities tasks since these may somtimes
be long-running things and it may occasionally be necessary to track
down why they are running and what they're doing.
2021-08-20 11:15:40 +01:00
Martijn van Groningen c5d6ed90ed
Remove redundant enrich processor constructors (#76698)
By creating the search running in the processor factory
3 constructors are no longer needed.
2021-08-20 09:26:35 +02:00
Yang Wang 9d2a944417
[Test] More resilience for token invalidation test (#75319)
This PR add more resilience to testExpiredTokensDeletedAfterExpiration
by wrapping the empty error assertion into an assertBusy block. In rare
cases, it is possible for search to return a deleted but not yet
refreshed document. Trying to invalidate this document then result into
MissDocumentException. This state is transient and should go away once
all shards refresh.

Resolves: #67347
2021-08-20 14:46:05 +10:00
Tim Vernum 76a684ad32
Replace X-Pack SSL config with libs/ssl-config (#76636)
This is the final step in the removal of the X-Pack specific SSL
configuration code (replaced by libs/ssl-config)

For some time we have had two implementations of SSL Configuration
code. One was in org.elasticsearch.xpack.core.ssl, the other in
org.elasticsearch.common.ssl

These two implementations had essentially the same functionality:
- Handle settings such as '*.ssl.certificate`, `*.ssl.key` etc
- Load certificates and keys from PEM files and Keystores
- Build and configure Java class such as SSLContext, KeyManager, etc
  based on the configuration and certificates.

As of this common the X-Pack version is no more, and all SSL
configuration in Elasticsearch is handled by the libs/ssl-config
version instead.

Resolves: #68719
2021-08-20 10:31:02 +10:00
Ryan Ernst 2bc4eca529
Remove unused recent trial license version from license state (#76692)
* Remove unused recent trial license version from license state

The license state previously used the most recent trial license version
to determine the default security enabled state. Since that no longer
exists, this can be removed from the license state.

* compile

* fix tests

* iter

* more compile
2021-08-19 19:53:16 -04:00
Ryan Ernst 4a38b5357c
Re-enable bwc tests (#76731) 2021-08-19 17:00:29 -04:00
Ryan Ernst 0b42395496
Add utility for tracking licensed persistent tasks (#76672)
Licensed feature tracking of long running features happens now by
starting and stopping the tracking of a feature. This commit adds an
intermediate base class to be used by features that utilize persistent
tasks. The base class only requires specifying the feature and context,
and then any tasks created automatically are tracked. An example using
marchine learning's JobTask is also added here, using a new machine
learning job feature object.
2021-08-19 13:26:31 -07:00
David Turner dfe877c3a8
Introduce `ClusterStatePublicationEvent` (#76723)
Today we use `ClusterChangedEvent` to represent a committed change to
the cluster state while it's being applied, and also to represent the
proposed change while it's being published. These are quite different
usages in practice, so this commit separates them by introducing a
`ClusterStatePublicationEvent` to represent the change to be published.

Relates #76625 in that we will be able to use the new
`ClusterStatePublicationEvent` to track various stats about the
publication as it progresses, but which don't make sense on a
`ClusterChangedEvent`.
2021-08-19 21:00:56 +01:00
Gordon Brown 4944959acf
Node shutdown API docs (#74505)
* Put Shutdown API docs

* Get Shutdown API docs

* Properly escape regex

* Doc tests build now! (but don't pass)

* Doc tests pass now! (with a code fix that will go in a different PR)

* DELETE shutdown docs

* Edit for language & consistency

* Fix doctest

* Add cloud-only banner

* Add allocation_delay docs

* Restore file that got deleted somehow?

* Use `restart` type in example to demonstrate `allocation_delay` param

* Fix typo per review

Co-authored-by: debadair <debadair@elastic.co>

* Vastly improve wording per review

Co-authored-by: debadair <debadair@elastic.co>

* Adjust test request & response so it passes

Co-authored-by: Deb Adair <debadair@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-08-19 12:42:27 -04:00
Dimitris Athanasiou 3df39a616d
[ML] Fix concurrent usage of NLP processors (#76719)
This fixes a problem with using NLP processors concurrently.
In particular, the `BertRequestBuilder` holds a local reference
to the tokenization result which is needed for processing the
result. However, this is not thread-safe. Multiple concurrent
calls will override the cached tokenization result and, consuquently,
the final results will be wrong.

This commit fixes this by making `BertRequestBuilder` stateless
and caching the tokenization result in the stack in the method
that's waiting for the result to come through from the process.
2021-08-19 18:53:41 +03:00
Ryan Ernst dab586a985
Add license family attribute to feature usage tracking (#76622)
The feature usage tracking data currently contains an opaque "name"
attribute which identifies the feature that was used. This name needs to
be unique enough that certain features can be identified independently
of others. For example, distinguishing machine learning jobs from
trained models. Yet both those examples are all "machine learning".

This commit adds a "family" attribute so that similar tracked features
can be grouped together. The output format of the feature usage api is
essentially the same; it is still a flat list of features and their last
used times. The family attribute can be used on the receiving end to
group many features.
2021-08-19 08:03:34 -07:00
István Zoltán Szabó 7faec52a1e
[DOCS] Fixes model_prune_window property description. (#76711) 2021-08-19 16:16:37 +02:00