Commit Graph

72833 Commits

Author SHA1 Message Date
William Brafford 432e871124
Switch minimum node version to minimum mapping version (#100857)
* Switch minimum node version to minimum mapping version
* Add mappings version in security system indices
2023-10-18 11:44:17 -04:00
Chris Hegarty ad03c4c499
Additional ESQL serialization tests (#101058)
This commit expands the existing ESQL serialization tests verify coverage of expected logical plan nodes and functions.
2023-10-18 16:07:18 +01:00
Benjamin Trent 3f7985e440
Add logging and unmute SearchCancellationIT, additionally disable segment concurrency (#100840)
All the flaky failures started occurring after:
https://github.com/elastic/elasticsearch/pull/99689

This indicates to me that all these tests need re-working due to segment
concurrency. In an effort to get coverage back for our testing,
concurrency is disabled again so these tests can be unmuted. 

closes: https://github.com/elastic/elasticsearch/issues/99929

I verified that the test passes, running 100s of times locally. I added
trace logging just in case.
2023-10-18 11:03:07 -04:00
Simon Cooper 100b948a7f
Separate out the Node constructor into a separate class (#100768)
This is the first part of a complex refactor to get the node constructor under control and easier to modify
2023-10-18 16:02:51 +01:00
Christoph Büscher 1a46afd194
Add status code to rest.suppressed log output (#100990)
Currently the rest.suppressed logger in RestResponse logs the request path and
the request parameters for 500 errors (warn level) and 400s (debug). In order to
be able to filter on those status codes more efficiently we should add them to
the log message.
2023-10-18 16:54:10 +02:00
Michael Peterson 49d3baadee
The 'too many scroll requests' exception should return 429 status (#100968) 2023-10-18 10:47:09 -04:00
Nhat Nguyen b35c043407
Run driver with user context (#100724)
Today, we have a hierarchy of tasks in ESQL designed to leverage the 
task framework for reporting status and cancellation.

```mermaid
flowchart
 RESTLayer -->|  EsqlQueryRequest indices:data/read/esql  | ComputeService
 ComputeService -->| DriverRequest indices:data/read/esql/compute | Driver
 ComputeService -->| DataNodeRequest indices:data/read/esql/data | DataNode
 DataNode -->| DriverRequest indices:data/read/esql/compute | Driver
 Driver -->| LookupRequest indices:data/read/esql/lookup | EnrichLookupService
```

The primary issue here is that `DriverRequest` is neither 
`IndicesRequest` nor `CompositeIndicesRequest`. Consequently, the Driver
is executed within the context of the system user, leading to access
indices with the system user.

To address this issue, this PR makes `DriverRequest` a 
`CompositeIndicesRequest` and ensures that the Driver executes within
the user's context. With this fix we can now properly capture the
response headers when a Driver is yielded and rescheduled.

Relates #100707
Relates #99646

Relates #99926
Closes #100164
2023-10-18 07:46:21 -07:00
Benjamin Trent 12cd129e62
unmuting test (#101007)
it seems that https://github.com/elastic/elasticsearch/issues/96896 was
fixed but the test was never unmuted.

Or some race condition in folks muting/fixing/unmuting/remuting
occurred.
2023-10-18 10:42:17 -04:00
Mark Vieira 2a6c16079c
Migrate painless and runtime fields common tests to new test clusters (#101021) 2023-10-18 07:39:39 -07:00
Julia Bardi 63179d760a
[Fleet] add fleet-server-remote service account (#100950)
* add fleet-server-remote service account

* fixed test

* fix test

* added monitor privilege
2023-10-18 15:35:51 +02:00
David Turner 3ce905b754
Remove more unnecessary ActionType subclasses (#101053)
Relates #97721
2023-10-18 13:56:40 +01:00
Martijn van Groningen e3cb876bab
Adjust DateHistogram's bucket accounting to be iteratively (#101012)
Adjust DateHistogram's consumeBucketsAndMaybeBreak to be iteratively during reduce instead accounting all buckets at the end of the reduce.

In case of many non-empty buckets accounting the number of buckets at the end of the reduce may be too late. Elasticsearch may already have failed with an OOME. This change changes the accounting to happen iteratively during the reduce for non-empty bucket.

Note that for empty buckets accounting of the number of buckets already happens iteratively.
2023-10-18 14:36:32 +02:00
David Roberts a545fe2f14
[ML] Minor tidyups in ML serverless extension (#101039)
Followup to #99129 and #100956
2023-10-18 12:54:48 +01:00
Luigi Dell'Aquila 8d89f913a1
ESQL: Add warning header when default LIMIT is applied (#100894)
Fixes https://github.com/elastic/elasticsearch/issues/100555

ESQL [by default](https://github.com/elastic/elasticsearch/pull/99816)
adds an implicit `LIMIT 500` to queries that do not define a limit.
Since this can be confusing for the end user, with this PR we also add a
warning to the response, making this default clear and explicit.
2023-10-18 07:44:33 -04:00
Yang Wang 168a464f41
More consistent logging messages for snapshot deletion (#101024)
This PR makes sure that the start message ("deleting snapshots ...") is
logged after the cluster state is processed and any failures before
finishing updating the new repositoryData are always logged at warning
level.

Resolves: #99057 Resolves: #100481
2023-10-18 06:48:37 -04:00
Armin Braun 588fed797b
Remove redundant ActionType classes (#101037)
Got asked why we have these classes again last night ... figured I'd
remove some of them to get us going here.

None of these classes are necessary, we can just inline all of these
away and make `ActionType` itself final or a record now that the action
type consists only in name and reader. See #97721 that made these things
redundant I think.
2023-10-18 06:14:12 -04:00
Yang Wang cad7232c39
[Test] Ensure indices are healthy enough before closing (#101023)
Closing unassigned indices is not cleanly handled. This change avoids
doing so in the test.

Resolves: #99516
2023-10-18 20:54:35 +11:00
Kostas Krikellas deed5619d0
Throw when wrapping rate agg in DeferableBucketAggregator (#101032)
* Throw when wrapping rate agg in DeferableBucketAggregator

* Update docs/changelog/101032.yaml
2023-10-18 12:37:14 +03:00
Ignacio Vera b5dd2970d4
Mute VectorTileRestIT#testCentroidGridTypeOnPolygon (#101041)
relates https://github.com/elastic/elasticsearch/issues/101038
2023-10-18 05:36:09 -04:00
Luigi Dell'Aquila 22a025e96a
ESQL: Support date and time intervals as input params (#101001)
Fixes https://github.com/elastic/elasticsearch/issues/99570

Add support for DATE_PERIOD and TYPE_DURATION values as input
parameters, eg.

```
{
   "query": "row a = 1 | eval x = now() + ?", 
   "params": [{"type":"time_duration", "value":"5 hours"}]
}
```

The values have to be passed as strings and then will be converted to
the appropriate type.

The original issue also pointed to similar problems for Version type, so
the PR also includes a test for this case.
2023-10-18 05:33:06 -04:00
István Zoltán Szabó 9b404099b4
[DOCS] Adds links to token section in ESLER conceptual. (#101033) 2023-10-18 11:30:38 +02:00
David Turner 9e77bd7b2e AwaitsFix for #100502 2023-10-18 10:27:02 +01:00
David Roberts dffd8421c0
[ML] Don't log errors for problems caused by shape of input data (#100996)
Logging errors in response to user input can cause enormous volumes
of output, which then obscures errors caused by bugs in the software.
2023-10-18 09:34:54 +01:00
Ed Savage 48fcb2e7d4
[ML] Add "fake" availability zone mapper (#100956)
To solve an issue in serverless where multiple trained model allocations
are assigned to a single node, this PR introduces the concept of "fake"
availability zones, where each node is treated as being in its own
availability zone.
2023-10-18 09:11:23 +01:00
Ignacio Vera 86ed7800f7
Fix geo tile bounding boxes to be consistent with arithmetic method (#100826)
Added some logic to GeoTileUtils#toBoundingBox that make sure the generated bounding boxes 
are consistent with the arithmetic solution and hence we can use both approaches indistintable.
2023-10-18 09:47:55 +02:00
David Turner 76488e2525
Add/fix known issue docs for 8.10.4 (#101013)
8.10.4 includes a partial mitigation for the snapshots downgrades bug
introduced in 8.10.0. This commit adds known-issue docs for 8.10.4, and
adjusts the known-issue docs for earlier 8.10.x issues.
2023-10-18 08:06:42 +01:00
Mary Gouseti 5697fcf594
`WaitForSnapshotStep` verifies if the index belongs to the latest snapshot of that SLM policy (#100911)
The `WaitForSnapshotStep` used to check if the SLM policy has been
executed after the index has entered the delete phase, but it did not
check if the SLM policy included this index.

The result of this is that if the user used an SLM policy that did not
include this index, when the index would enter the
`WaitForSnapshotStep`, it would wait for a snapshot to be taken, a
snapshot that would not include the index, and then ILM would delete the
index.

See the exact reproduction path:
https://github.com/elastic/elasticsearch/issues/57809

**Solution** This PR, after it finds a successful SLM run, it verifies
if the snapshot taken by SLM contains this index. If not it throws an
error, otherwise it proceeds.

ILM explain will report:

```
"step_info": {
        "type": "illegal_state_exception",
        "reason": "the last successful snapshot of policy 'hourly-snapshots' does not include index '.ds-my-other-stream-2023.10.16-000001'"
      }
```

**Backwards compatibility concerns** In this PR, the
`WaitForSnapshotStep` changed from `ClusterStateWaitStep` to
`AsyncWaitStep`. We do not think this is gonna cause an issue. This was
tested manually by the following steps: - Run a master node with the old
version. - When ILM is executing `wait-for-snapshot`, we shutdown the
node - We start the node again with the new version os ES - ES was able
to pick up the step and continue with the new code.

We believe that this covers bwc concerns.

Fixes: https://github.com/elastic/elasticsearch/issues/57809
2023-10-18 03:00:09 -04:00
Armin Braun dcaba064dd
Remove more explicit SearchResponse references from test code (#100985)
Follow-up to #100966 adding more overrides to assertions that
consume a request builder.
2023-10-18 07:20:01 +02:00
William Brafford 96184ddb13
Use string version internally for PluginDescriptor (#100713)
* PluginDescriptor uses string version internally
2023-10-17 17:20:06 -04:00
Ryan Ernst 029fa49afa
Use mapped action filter for api filtering (#100998)
The MappedActionFilter was added to make filtering more efficient, but
the api filtering action filter was not yet using it. This commit
adjusts this shared action filter to implement MappedActionFilter.
2023-10-17 11:55:21 -07:00
Nhat Nguyen d769f92688
Avoid release expanded block twice (#101005) 2023-10-17 11:33:05 -07:00
Przemyslaw Gomulka c4d61bd9cb
Add getter to GetSettingsResponse (#100993)
This commit addes a getter on GetSettingsResponse
to allow the recreation of GetSettingsResponse during
response filtering.
2023-10-17 19:49:39 +02:00
Francisco Fernández Castaño 9101fd27da
Synchronize Coordinator#onClusterStateApplied (#100986)
When a cluster state has been applied and right after the node becomes a candidate, there's a small race condition where the the thread scheduling can lead to closing the PeerFinder while the node is a Candidate.

Closes #99023
2023-10-17 19:23:19 +02:00
Chris Hegarty 8506503612
ESQL: non-grouped aggregations not taking into account null groups (#100960) 2023-10-17 09:35:06 -07:00
Rene Groeschke 1773d4b5d1
Fix Gradle deprecation warning in examples project (#100988) 2023-10-17 12:00:47 -04:00
Abdon Pijpelink 8ac4ba751e
Restructure ES|QL docs (#100806)
* Break out 'Limitations' into separate page

* Add REST API docs

* Restructure commands, functions, and operators refs

* Add placeholder for getting started guide

* Group 'Syntax', 'Metafields', and 'MV fields' under 'Language'

* Add placeholder for Kibana page

* Add link from landing page

* Apply uniform formatting to ACOS, CASE, and DATE_PARSE function refs

* Reword default LIMIT

* Add support for COUNT(*)

* Move 'Commands' and 'Functions and operators' to individual pages

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2023-10-17 17:36:14 +02:00
Chris Hegarty 297f064534
ESQL: Enhance test assertion in testSimpleFinishClose (#100971) 2023-10-17 16:13:09 +01:00
Keith Massey 92ec9d6605
Add executed pipelines to bulk api response (#100031)
This change allows users to pass a new list_executed_pipelines parameter
to the bulk API, which results in an executed_pipelines list being returned.
2023-10-17 09:39:09 -05:00
Lisa Cawley 3418c6a2af
[DOCS] Alerts-as-data for anomaly detection rules (#100864) 2023-10-17 07:37:22 -07:00
Andrei Dan abf6c16762
[DOCS] Remove the `coming[8.10.4]` from release notes (#100979) 2023-10-17 10:29:14 -04:00
Ryan Ernst af2f0609ac
Improve painless error wrapping (#100872)
Painless sandboxes some errors from Java for which it can recover. These
errors are wrapped within a ScriptException. However, retaining the
error as a cause can be confusing when walking the error chain. This
commit wraps the error so that the real error type does not appear,
but maintains the same error message in xcontent serialized form.
2023-10-17 06:59:13 -07:00
Carlos Delgado 888813d815
Fix synonyms documentation (#100916) 2023-10-17 15:50:51 +02:00
Andrei Dan 60bef28a37 Prune changelogs after 8.10.4 release 2023-10-17 14:49:25 +01:00
Andrei Dan 2e23bf5005 Bump versions after 8.10.4 release 2023-10-17 14:48:48 +01:00
Armin Braun bae6991fb3
Remove ~600 references to SearchResponse in tests (#100966)
We'd like to make `SearchResponse` reference counted and pooled but there are around 6k
instances of tests that create a `SearchResponse` local variable that would need to be
released manually to avoid leaks in the tests.
This does away with about 10% of these spots by adding an override for `assertHitCount`
that handles the actual execution of the search request and its release automatically
and making use of it in all spots where the `.get()` on the request build could be inlined
semi-automatically and in a straight-forward fashion without other code changes.
2023-10-17 15:43:36 +02:00
Benjamin Trent 04db28631d
Adding more logging for diagnosing #100502 (#100961) 2023-10-17 09:35:25 -04:00
Kostas Krikellas a7a37f5196
[TEST] Replace flaky check on recovery stats with cluster health check in TSDS recovery test (#100963)
Recovery stats may contain additional entries, e.g. in case shards get 
relocated. When restoring an index from its snapshot, it suffices to 
check that the index is health and searchable.

Fixes #98746
2023-10-17 08:41:16 -04:00
Albert Zaharovits d6df838307
Refactor REST tests to the new internal cluster rule orchestration (#100399)
This PR is migrating some of the ITs that use either the
`elasticsearch.legacy-java-rest-test` or the
`elasticsearch.legacy-yaml-rest-test` gradle test plugins to the new 
`elasticsearch.internal-java-rest-test` and
`elasticsearch.internal-yaml-rest-test` equivalents. This is the list of
the affected ITs:  * SamlAuthenticationIT  * OperatorPrivilegesIT  *
ProfileIT  * SetSecurityUserProcessorWithWithSecurityDisabledIT  *
AsyncSearchSecurityIT  * SecurityRealmSmokeTestCase  *
KibanaSystemIndexIT  * KerberosAuthenticationIT  * ReindexWithSecurityIT
and ReindexWithSecurityClientYamlTestSuiteIT  *
ReloadSecureSettingsWithPasswordProtectedKeystoreRestIT  * PermissionsIT
from slm:qa:with-security  * Permissions IT from
runtime-fields:with-security  * Permissions IT from ilm:qa:with-securiy 
* GraphWithSecurityIT and GraphWithSecurityInsufficientRoleIT

Related: ES-6751
2023-10-17 07:42:43 -04:00
Artem Prigoda 252926423f
Mute `pre_filter_shard_size with shards that have no hit` test (#100954)
Mutes https://github.com/elastic/elasticsearch/issues/92058
2023-10-17 12:35:35 +02:00
Artem Prigoda ef1ff9a2f9
Mute ConcurrentSnapshotsIT#testMasterFailoverOnFinalizationLoop (#100951) 2023-10-17 11:51:25 +02:00