Commit Graph

63060 Commits

Author SHA1 Message Date
Christoph Büscher f31c36482e
Mute test for issue 84212 (#84214) 2022-02-22 11:18:33 +01:00
Alan Woodward 080a77350e
Only check for metadata input on the root object (#84140)
We have found that ContentPath.pathAsText() ends up being a very hot path
in indexing, and that it is specifically called a lot when checking that the current
path does not lead to a metadata mapper. The metadata mappers that accept
input only exist at the root, however, so instead of building the full path we can
instead check that we are on the root mapper and then just pass the current
field to the lookup.
2022-02-22 10:02:04 +00:00
David Turner 02f38e3da9
Make allocation explanations more actionable (#83983)
The cluster allocation explain API includes a top-level status
indicating to the user whether the shard can be assigned/rebalanced/etc
or not. Today this status is fairly terse and experience shows that
users sometimes struggle to understand how to interpret it and to decide
on follow-up actions.

This commit makes the top-level explanation more detailed and
actionable. For instance, in the cases like `THROTTLED` where the status
is transient we instruct the user to wait; if a shard is lost we say to
restore it from a snapshot; if a shard cannot be assigned we say to
choose a specific node where its assignment is expected and to address
the obstacles.

Co-authored-by: James Rodewig <james.rodewig@elastic.co>
2022-02-22 09:23:01 +00:00
Mayya Sharipova 1f65a1f548 Fix spotless format 2022-02-22 10:15:59 +01:00
Mayya Sharipova 1544d52861 Change to org.apache.lucene.tests
Relates to PR#83667
2022-02-22 10:07:57 +01:00
Mayya Sharipova 26c3dd6857
Upgrade to lucene-9.1.0-snapshot-1336263051c (#83667)
Lucene issues that resulted in elasticsearch changes:

LUCENE-9820 Separate logic for reading the BKD index from logic to intersecting it.
LUCENE-10377: Replace 'sortPos' with 'enableSkipping' in SortField.getComparator()
LUCENE-10301: make the test-framework a proper module by moving all test
classes to org.apache.lucene.tests
LUCENE-10300: rewrite how resources are read in ukrainian morfologik analyzer:
LUCENE-10054 Make HnswGraph hierarchical
2022-02-22 09:53:20 +01:00
David Turner e853bf5f3f
Fix testFollowerCheckerDetectsUnresponsiveNodeAfterMasterReelection (#84200)
This test would fail if we introduce the network partition while the
master is still publishing a cluster state update and hasn't received
the ack from the victim node. In this case the default publish timeout
means that the master will wait for 30s before completing the stalled
publication and moving on to the `node-left` one, but
`ensureStableCluster` also times out after 30s which leaves not much
time for the master to remove the victim node.

This commit reduces the publish timeout to 10s so that the master
recovers well before `ensureStableCluster` times out.

Closes #84172
2022-02-22 08:21:23 +00:00
Joe Gallo 119fbcf64e
[DOCS] Fix shrink index API prereqs (#84197) 2022-02-21 16:17:49 -05:00
Ignacio Vera 9f64720e12
Do not deserialise the document when not needed in the fields fetch phase (#84184) 2022-02-21 12:41:07 +01:00
Artem Prigoda 36e0298611
Add Maps.newLinkedHashMapWithExpectedSize (#84054)
* Add Maps.newLinkedHashMapWithExpectedSize
* Return LinkedHashMap
* Don't cast LinkedHashMap
2022-02-21 11:18:21 +01:00
Justin Cranford d103af2d06
Add JWT realm support for JWT validation (#83155) 2022-02-21 01:54:39 -05:00
Ioannis Kakavas 6e530c0383
Adjust auto-configuration related docs (#84080)
* Add a note that the http_ca.crt certificate that is generated and
stored in config/certs can be used to configure any client to trust
the certificate that elasticsearch uses for TLS on the HTTP layer
* Add a note that the elasticsearch-create-enrollment-token CLI
tool can only be used with auto-configured TLS settings.
2022-02-20 10:58:46 +02:00
Julie Tibshirani 4ed8570161 Mute FrozenSearchableSnapshotsIntegTests#testCreateAndRestorePartialSearchableSnapshot 2022-02-17 16:06:57 -08:00
Julie Tibshirani 1f6da034fd Mute LdapSessionFactoryTests#testSslTrustIsReloaded 2022-02-17 15:43:05 -08:00
Julie Tibshirani d85b13cc86 Fix spotless violation from last commit 2022-02-17 14:27:15 -08:00
Julie Tibshirani 69e75bad3b Mute GeoGridTilerTestCase#testGeoGridSetValuesBoundingBoxes_UnboundedGeoShapeCellValues 2022-02-17 14:06:16 -08:00
Nik Everett 3065c6d63b
Small formatting clean up (#84144)
Replaces some funny code formatting created when we applied spotless to
the code globally. Spotless does a fine job, but this was a little funky
looking.
2022-02-17 13:50:34 -05:00
Gordon Brown 4bc6a121c4
Always re-run Feature migrations which have encountered errors (#83918)
This PR addressed the behavior described in #83917, in which Feature migrations
which have encountered errors are not re-run in some cases. As of this PR, Features
which have encountered errors during migration are treated the same as Features 
requiring migration.

This PR also adds a test which artificially replicates #83917.
2022-02-17 09:56:53 -07:00
James Rodewig 6ad3f8bfdd
[DOCS] Clarify `orientation` usage for WKT and GeoJSON polygons (#84025)
Clarifies that the `orientation` mapping parameter only applies to WKT polygons. GeoJSON polygons use a default orientation of `RIGHT`, regardless of the mapping parameter.

Also notes that the document-level `orientation` parameter overrides the default orientation for both WKT and GeoJSON polygons.

Closes https://github.com/elastic/elasticsearch/issues/84009.
2022-02-17 10:33:06 -05:00
Nhat Nguyen 69e898db9f
Group field caps response by index mapping hash (#83494)
This commit utilizes the index mapping hash to share the fields-caps for 
indices with the same index mapping to reduce the memory usage and the
size of transport messages.

Closes #78665
Closes #82879
2022-02-17 10:19:47 -05:00
Nik Everett acf9968f9d
Shrink join queries in slow log (#83914)
This removes the defaults from the slow log for the remaining queries in
the `parent-join` module. So it should be easier to read the slow log
when it contains these queries.

Relates to #76515
2022-02-17 09:45:25 -05:00
weizijun c84c7d484e
TSDB: Reject the nested object fields that are configured time_series_dimension (#83920)
At the moment we really don't know what configuring a
`time_series_dimension` should *do* when there are nested documents.
So, for now, we're going to disable it. One day when someone has a good
idea of how it should work we can build that. But for now we don't want
to guess wrong and then lock us into some annoying behavior that no one
needs but we have to support for backwards compatibility reasons.

Closes: #83915
2022-02-17 09:39:57 -05:00
James Rodewig 8ff1336127
[DOCS] Remove note about partial response from Bulk API docs (#84053)
The bulk API response with a `200 OK` HTTP status always returns an entry for each action in the request. Partial responses aren't applicable.
2022-02-17 09:20:17 -05:00
Martijn van Groningen ae7defa9f9
Allow regular data streams to be migrated to tsdb data streams. (#83843)
A regular data stream can be migrated to a tsdb data stream if in template that created the data stream, the `index_mode` field is set to `time_series` and the data stream's `index_mode` property is either not specified or set to `standard`. Then on the next rollover the data stream is migrated to be a tsdb data stream.

When that happens the data stream's `index_mode` property is set to `time_series` and the new backing index's `index.mode` index setting is also set to `time_series`.

Closes #83520
2022-02-17 15:16:26 +01:00
James Rodewig f9a64b2e86
[DOCS] Fix `ignore_unavailable` parameter definition (#84071)
The current `ignore_unavailable` definition is a bit misleading. The parameter primarily determines if a request that targets a missing or closed index returns an error.
2022-02-17 08:24:06 -05:00
Artem Prigoda f976414cf7
Make Metadata extend AbstractCollection (#83791) 2022-02-17 14:14:02 +01:00
Seth Michael Larson 5b1f162db8
Add API specs for OpenID Connect APIs 2022-02-17 06:59:50 -06:00
Yang Wang 3a903ca17c
Revert "Clean up for superuser role name references (#83627)" (#84096)
This reverts commit a9cdbf42c6.

The role name change does not play well with API key creation.
2022-02-17 07:15:23 -05:00
Elasticsearch addict 4e55efc09d
Update Lucene analysis base url (#84094)
Moving to Lucene 9 slightly changed the base url for the analysis components
which this PR fixes.
2022-02-17 12:44:12 +01:00
David Turner 3d2617136c
Avoid null threadContext in ResultDeduplicator (#84093)
In #84038 we added a dependency on having a valid `threadContext` in a
repository, but some tests use mocking and may end up with a `null`
here. This seems not to be a problem in recent branches but causes
failures in 8.0. With this commit we ensure that we always have a valid
`threadContext` to avoid any problems.
2022-02-17 06:32:43 -05:00
David Turner 1b7b2a1a7a
Use static empty store files metadata (#84034)
In a large cluster we expect most nodes not to have a copy of most
shards, but today during replica shard allocation we create a new (and
nontrivial) object for each node that has no copy of a shard. With this
commit we check at deserialization time whether the response is empty
and, if so, avoid the unnecessary instantiation.

Relates #77466
2022-02-17 10:24:38 +00:00
David Turner e27145030c
Preserve context in snapshotDeletionListeners (#84089)
Closes #84036
2022-02-17 05:08:38 -05:00
Luca Cavanna 35c9258e46
Refactor FilterXContentParser and DelegatingXContentParser (#83457)
We have two implementations of XContentParser that both delegate all of its methods to a delegate, either an inner parser provided at construction (FilterXContentParser) or a more dynamic variant that is returned by overriding the delegate method (DelegatingXContentParser).

Effectively the two classes do exactly the same, the only difference being how the delegate parser is provided. While these two are two separate implementations, they could inherit from each other.

With this change we make FilterXContentParser be the previous DelegatingXContentParser, that allows to override the delegate method, and we introduce a new FilterXContentParserWrapper that takes the fixed delegate as a constructor argument.

Additionally, XContentSubParser is rewritten to extend FilterXContentParserWrapper.
2022-02-17 11:00:25 +01:00
David Roberts bf00ab381e
[ML] Add ML memory stats API (#83802)
Adds an API that can be used to find out how much memory ML
is permitted to use and is currently using on each node, both
within the JVM heap, and natively, outside of the JVM.
2022-02-17 09:19:14 +00:00
Hendrik Muhs 48e562ad9e
[Transform] Improve robustness of checkpointing (#80984)
rewrites checkpointing as internal actions, reducing several sub-calls to
only 1 per data node that has at least 1 primary shard of the indexes of
interest.

Robustness: The current checkpointing sends a request to every shard
 - primary and replica - and collects the results. If 1 request fails, even 
for a replica, checkpointing fails. See #75780 for details.

Performance: The current checkpointing is wasteful, it uses get index 
and get index stats which results in a lot more calls and executes a 
lot more code which produces results we are not interested in.

Number of requests before and after:
before: 1 + #shards * #indices * (#replicas + 1)
after: #data_nodes_holding_gt1_shard

Fixes #75780
2022-02-17 09:38:48 +01:00
David Turner 6121477ac5
Preserve context in ResultDeduplicator (#84038)
Today the `ResultDeduplicator` may complete a collection of listeners in
contexts different from the ones in which they were submitted. This
commit makes sure that the context is preserved in the listener.
2022-02-17 07:43:14 +00:00
Ievgen Degtiarenko aeed4ebe82
fix testRestoreLocalHistoryFromTranslogOnPromotion (#84027)
This test was failing in rare cases when there are only few operations
and maxSeqNoOfUpdatesOrDeletes is greater then maxSeqNoOfUpdatesOrDeletesBeforeRollback
2022-02-17 08:38:51 +01:00
Ignacio Vera 3e1b6612ac
GeometryNormalizer should not fail if it cannot compute signed area (#84051)
This commit removes the exception throwing and assumes that when the area is zero, the polygon has 
the right orientation. The exception will be thrown at indexing time when the polygon is invalid .
2022-02-17 08:12:52 +01:00
Ignacio Vera ed6627f804
Fix GeoHexAggregationBuilderTests (#84049)
Adjust some of the random values that are out of bounds.
2022-02-17 07:00:01 +01:00
Ioannis Kakavas 238cd20e88
Adjust timeout for responses from SMB fixture (#84037)
We have recently seen a number of failures in ActiveDirectorySessionFactoryTests
where we fail to get a response from the Samba Server we use in
the default time frame of 5 sec. The fixture seems to be up and
running successfully so there is the case that it's just too slow
to respond within the 5 sec. This commit bumps the timeout to 15s
2022-02-17 07:14:18 +02:00
Yang Wang fb65f95757
Improve BWC for persisted authentication headers (#83913)
Authentication headers are persisted as part of a task definition including ML
jobs, CCR following etc. The persistence process store them into either an
index or the cluster state. In both cases, the headers are retrieved from
ThreadContext as a string which is the serialised form of the Authentication
object. This string is always serialised with the node's version.

The problem is: In a mixed cluster, the task can be created in a newer node and
persisted into an index but then needs to be loaded by a older node. The older
node does not understand the newer format of the serialised Authentication
object and hence error out on reading it.

This PR adds additional logic in places where the headers are persisted. It
compares the Authentication version with minNodeVersion and rewrites it if the
minNodeVersion is older. Since we already filter security headers in places
where headers are persisted, the new logic is hooked into the same places and
essentially another enhancement on how to handle security headers for persisted
tasks.

Resolves: #83567
2022-02-17 15:52:43 +11:00
Gordon Brown 7d094c3e5a
Correct documentation regarding how to restore no `feature_states` (#83814)
This commit corrects the snapshot creation and restoration docs to
describe the usage of `"none"` to restore no feature states. Previously,
they incorrectly stated that using an empty array would accomplish this,
but specifying an empty array results in the default behavior (rather
than preventing feature state snapshot/restoration).
2022-02-16 20:04:00 -05:00
Tim Vernum f9f6ec9ed3
Remove all "user" related methods from HLRC (#84011)
Removes the following methods from the SecurityClient component
of the High Level Rest Client

- putUser
- deleteUser
- changePassword
- authenticate

As part of this change, I renamed the SecurityClientTestHelper class
to TestSecurityClient and made it a real object rather than a set of
utility methods.

This was needed because different tests need different RequestOptions
objects, but passing it into every method made it cumbersome.
The code is clearer if we use a field in the test client itself. 

Relates: #83423
2022-02-17 10:46:06 +11:00
Albert Zaharovits 476240e208
Security global privilege for writing profile data of applications (#83728)
This PR adds a new global privilege which can be used to restrict writes
for user profile data. The privilege is configurable for the names of
the top level keys in the profile data maps (`data` and `access`), which
by convetion are "application" names. Lastly it adds such a privilege,
for the `kibana-*` application namespace, to the `kibana_system`
built-in role.

Eg:

```
{
  "global": {
    "application": {
      "manage": {
        "applications": [...]
      }
    },
    "profile": {
      "write": {
          "applications": [...]
        }
      }
    }
}
```

Notes: * for every role there can be only one list of application names
for the write profile privilege, and the list does not support excludes
(and it supports wildcards) * there is no validation that the privilege
refers to valid application names (eg empty application name)
2022-02-16 17:00:59 -05:00
Keith Massey b001a6fe12
Adding a warning if node.attr.data is set (#84050)
This adds a warning-level deprecation if a user has set the node.attr.data setting, since it is a sign that they are
trying to create a hot/warm setup in the way that is no longer supported.
Closes #83800
2022-02-16 15:25:25 -06:00
James Baiera dd3397b2c8
Unmute BWC rest tests (#84058)
This PR unmutes some tests that were muted for backporting #83290
2022-02-16 15:47:18 -05:00
Lisa Cawley 458ef91066
[DOCS] Move ML info and upgrade APIs (#84005) 2022-02-16 11:23:00 -08:00
Mark Vieira 68a149072a Make pull request BWC testing a matrix job for better parallelization 2022-02-16 10:56:05 -08:00
Mark Vieira a438708b29 Rename BWC intake job so that old job is removed 2022-02-16 09:23:08 -08:00
Mark Vieira 900a013618 Make intake BWC testing a matrix job for better parallelization 2022-02-16 09:07:35 -08:00