Commit graph

75574 commits

Author SHA1 Message Date
Andrei Dan
4c42db5916
Increase timeout to account for slow node start (#105054) 2024-02-02 13:27:28 +00:00
Andrei Dan
e2a6fefe8b
Increase assertBusy to 30 seconds to make sure the disk health data is received (#105056)
The local health monitor runs every 10 seconds on every node and the
assertBusy statements we use to check the results are received also have
a 10 seconds timeout. This increases the timeout of the assertBusy
statements to 30 seconds to make sure the results from each node are
received.
2024-02-02 13:26:25 +00:00
Jedr Blaszyk
8f8bd334ab
[Connector API] Implement update index_name action (#104648) 2024-02-02 13:48:02 +01:00
Armin Braun
8652e5cb57
Simplify and save allocations around SeqNoFieldMapper (#105036)
We can dry up the code for SequenceIDFields etc. quite a bit.
Also, no point in storing the BytesRef as a field in
SingleValueLongField. Except for the case of nested docs (and I'm not
sure it's even guaranteed to help there) this saves no
allocations and only costs memory end to end (extra field + BytesRef
lives longer).
2024-02-02 13:43:59 +01:00
Johannes Fredén
88d584c55e
Add stricter validation for api key expiration time (#103973)
Add stricter validation for api key expiration time
2024-02-02 13:03:38 +01:00
Carlos Delgado
f4d3ab9df2
Extract interface from ModelRegistry so it can be used from server (#105012) 2024-02-02 12:55:37 +01:00
Andrei Dan
d0f96e7b59
Use assertBusy to allow for the thread to be cancelled (#105053)
Fixes #44997
2024-02-02 06:41:42 -05:00
Mary Gouseti
55cf726a80
Fix typo in test (#104744) (#105052)
Easy fix, there was a typo in the warning instead of checking for the
correct index patterns `other-*` it was checking for `ds-*`.

Closes #104774
2024-02-02 06:30:54 -05:00
Andrei Dan
bf30dbfb8e
Use a cluster client after a cluster restart (#105051)
After a cluster restart an old client could be using a node that's
restarting still (throwing `NodeClosedException`).

Fixes #99520
2024-02-02 06:15:15 -05:00
Felix Barnsteiner
f642b8a3aa
Add setting to ignore dynamic fields when field limit is reached (#96235)
Adds a new `index.mapping.total_fields.ignore_dynamic_beyond_limit`
index setting.

When set to `true`, new fields are added to the mapping as long as the
field limit (`index.mapping.total_fields.limit`) is not exceeded. Fields
that would exceed the limit are not added to the mapping, similar to
`dynamic: false`.  Ignored fields are added to the `_ignored` metadata
field.

Relates to https://github.com/elastic/elasticsearch/issues/89911

To make this easier to review, this is split into the following PRs: -
[x] https://github.com/elastic/elasticsearch/pull/102915 - [x]
https://github.com/elastic/elasticsearch/pull/102936 - [x]
https://github.com/elastic/elasticsearch/pull/104769

Related but not a prerequisite: - [ ]
https://github.com/elastic/elasticsearch/pull/102885
2024-02-02 05:53:52 -05:00
Jedr Blaszyk
75e11814fa
[Connectors API] Implement connector status update action (#104750) 2024-02-02 11:05:45 +01:00
Gareth Ellis
e5adc3c46c
Modify name of threadpool metric for rejected (#105015)
* Modify name of threadpool metric for rejected to adhere to standard

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-02-02 11:04:03 +01:00
Slobodan Adamović
e87f58d308
Hot-reloadable LDAP bind password (#104320)
This PR enables `secure_bind_password` setting to be updated 
via `reload_secure_settings` API, without the need to restart nodes.

The `secure_bind_password` must be updated on the AD/LDAP 
server, changed in the Elasticsearch keystore and reloaded via 
`reload_secure_settings` API. This change does not include a 
support for the grace period, where both old and new passwords 
are active. The new password change is active immediately after 
reload and will be used when establishing new LDAP connections.
LDAP connections are stateful, and once a connection is established 
and bound, it remains open until explicitly closed or until a connection
timeout occurs. Changing the bind password on will not affect and 
invalidate existing connections.
2024-02-02 10:37:01 +01:00
Daniel Mitterdorfer
c552bc10d1
[Profiling] Rename stacktrace_ids field (#105046)
With this commit we rename the field `stacktrace_ids` to
`stacktrace_ids_field` for the API calls `_profiling/stacktraces` and
`_profiling/flamegraph`. The semantics of this field are to contain the
name of the field to query in the indices provided by the `indices`
parameter. As the old field name was misleading (should we provide the
name of the field or a list of ids?) we rename it. As these APIs are
meant for exclusive use by Kibana and the field has been unused so far
we make this change directly without introducing any BWC layer.
2024-02-02 10:26:28 +01:00
Slobodan Adamović
7c2fdff1b5
Fix SearchResponse leaks in cross cluster access tests (#105039)
Fixes ref counting of SearchResponse in cross cluster access tests.

Resolves #105038
2024-02-02 09:20:09 +01:00
Johannes Fredén
a9824042d8
Add rest spec for Query User API (#104529)
Add rest spec for Query User API
2024-02-02 08:21:01 +01:00
Nhat Nguyen
77309dbc5d
Support enrich remote mode (#104993)
This PR supports enrich in remote mode. Enrich with remote mode can't be 
after another enrich with the coordinator mode, an aggregation, or a
limit. While we can't address the first two limitations, we should
remove the constraint with LIMIT. Otherwise, users are forced to write
queries that may not perform well. For instance,

```
FROM test
| ORDER @timestamp 
| LIMIT 10 | ENRICH[ccq.mode:remote]
```
does not work. In such cases, users must rewrite it as

```
FROM test 
| ENRICH[ccq.mode:remote]
| ORDER @timestamp
| LIMIT 10
```

which is equivalent to bringing all data to the coordinating cluster.

We might consider implementing the actual remote enrich on the 
coordinating cluster (like remote field extracting), however, this
requires retaining the originating cluster and restructing pages for
routing, which might be complicated.
2024-02-01 22:03:36 -08:00
Nhat Nguyen
a6895b0559
Add IT tests for PushDownEnrich rule (#104957)
This PR adds some queries that could fail without the PushDownEnrich rule.
2024-02-01 20:26:05 -08:00
Ryan Ernst
84a5edcfa6
Expose forbidden apis fail on missing classes option (#104999)
The forbidden apis task always fails when classes are missing. Sometimes
we may want to not fail, for example when it is not possible to get to
the classes in question, as is the case with preview features. This
commit adds an ignoreMissingClasses option to the forbidden apis task
and extends the worker to conditionally use the forbidden apis option to
fail on missing classes.
2024-02-01 15:23:01 -08:00
Nhat Nguyen
a5a4b9e529
Add security tests for cross clusters query (#104879) 2024-02-01 13:15:22 -08:00
John Verwolf
98a37c7b6b
Enhancement: Metrics for Search Took Times using Action Listeners (#104996)
* Instrument search took times

* Update assertion helper method to use client param

* Update docs/changelog/104996.yaml

* spotless

* Fix test
2024-02-01 12:51:12 -08:00
Bogdan Pintea
1091f712a1
Drop deprecated _esql API endpoint (#105029)
Drop initial and now deprecated `_esql` API endpoint, replaced by `_query`.
2024-02-01 21:30:39 +01:00
Armin Braun
81f0c206d1
Fix search response leaks in rank eval tests (#105014)
It's in the title. Somehow none of these tests were leak-proof.
Moving the responses to unpooled to fix things.

closes #104570
2024-02-01 21:24:25 +01:00
David Kyle
64396146d7
[ML] Apply windowing and chunking to long documents (#104363)
Adds a chunkedInfer() method to the InferenceService interface which 
automatically splits long text before sending the inputs to the model.
Chunking is done via a sliding window of length window_size with an 
overlap of span. This change only applies to the ELSER model and Text Embedding 
models deployed locally in the cluster
2024-02-01 19:21:49 +00:00
Przemyslaw Gomulka
95a4ed1d73
Update build tools changelog schema for new Core/Infra/Metrics label (#105016)
a new Core/Infra/Metrics label has been added, this commit updates the schema
2024-02-01 19:18:06 +01:00
Nhat Nguyen
a72b403afb
Harden assertions when checking target indices (#105001)
We should have checked and failed if there is an inconsistent pair of 
data node plan and target indices. This PR strengthens these checks and
adds assertions to fail hard in tests.

Relates #10480
2024-02-01 09:43:09 -08:00
Ryan Ernst
b67f5a6b57
Make cluster feature predicate available to plugins (#105022)
A predicate to check whether the cluster supports a feature is available
to rest handlers defined in server. This commit adds that predicate to
plugins defining rest handlers as well.
2024-02-01 09:11:18 -08:00
Pat Whelan
341d29a5db
Transforms: Adding basic stats API param (#104878)
* Transforms: Adding basic stats API param

Adds an optional parameter to the `transform/_stats` API called
`basic`.  This parameter defaults to false, returning the
complete set of stats (this is the same functionality as today).

This helps reduce the latency calling for stats of one or more
transforms, as the `operationsBehind` calculation is increasingly
expensive as the size of the transform and number of nodes grow. Users
can get a basic view of the current state, health, and progress of one
or more transforms, and a second call for the complete stats set can be
made when users want to drill down into a given transform.

When `transform/_stats?basic=true`, Transforms will only return a
subset of stats obtained by information immediately available from the
main node, including `id`, `state`, `node`, `stats`, and `health`.

`checkpointing` may be omitted.

For continuous transforms, `checkpointing` will include the `last`
`checkpoint` id.  If there is a difference in data but the transform
has not started on that difference yet, the `next` checkpoint will
be included with the `position` and `progress`.

For stopped transforms, `checkpointing` will include the `last`
`checkpoint` id and the `next` `position` and `progress`.

In both cases, `operationsBehind` will never be calculated, and all
timestamp information will not be recorded.
2024-02-01 11:17:57 -05:00
Dianna Hohensee
b94b11aad5
Mute TokenAuthIntegTests testRefreshingMultipleTimesWithinWindowSucceeds (#104991) 2024-02-01 10:27:16 -05:00
Kostas Krikellas
42f3a8f6ca
[TEST] Fix test failure for dynamic template tests (#105021)
* Fix test failure

https://gradle-enterprise.elastic.co/s/icg66i6mwnjoi

* Fix test failure

https://gradle-enterprise.elastic.co/s/icg66i6mwnjoi
2024-02-01 16:35:56 +02:00
Kostas Krikellas
2e824bd35a
Fix test failure (#105019)
https://gradle-enterprise.elastic.co/s/icg66i6mwnjoi
2024-02-01 16:17:24 +02:00
Tim Rühsen
d82821f3c6
[Profiling] Compute cloud costs for Azure instances (#104964)
* [Profiling] Read Azure costs data

* Parse the Azure instance_type

* Amend tests for the CostCalculator

* Adjust and comment pre-allocation in InstanceTypeService

* Remove outdated comment in InstanceType

* Amend comments in InstanceType

* Remove 'provider' from costs data

* Add a StopWatch for loading the profiling costs data

* Remove pre-allocation in InstanceTypeService

* InstanceTypeService: Extend the scope of 'log' variable
2024-02-01 14:58:27 +01:00
Panagiotis Bailis
7ce8d76559
Making k and num_candidates optional for knn search (#101209) 2024-02-01 15:43:09 +02:00
Pooya Salehi
e2d68aeb95
Limit RTG exceptions to retry on (#105003)
Limit RTG exceptions to retry on and do not throw in
`getCurrentNodeOfPrimary`. Follow up to
https://github.com/elastic/elasticsearch/pull/104579#discussion_r1472702037.

Relates ES-5727
2024-02-01 08:36:39 -05:00
Kostas Krikellas
149ec37777
Introduce experimental pass-through field type (#103648)
* Introduce passthrough field type

`PassthoughObjectMapper` extends `ObjectMapper` to create a container
for fields that also need to be referenced as if they were at the root
level. This is done by creating aliases for all its subfields.

It also supports an option of annotating all its subfields as
dimensions. This will be leveraged in TSDB, where dimension fields can
be dynamically defined as nested under a passthrough object - and still
referenced directly (i.e. without prefixes) in aggregation queries.

Related to #103567

* Update docs/changelog/103648.yaml

* no subobjects

* create dimensions dynamically

* remove unused method

* restore ignoreAbove incompatibility with dimension

* fix test

* refactor, skip aliases on conflict

* fix branch

* fix branch

* add tests

* update test

* remove unused variable

* add yaml test for subobject

* minor refactoring

* add unittest for PassThroughObjectMapper

* suggested fixes

* suggested fixes

* update yaml with warning for duplicate alias

* updates from review

* add withoutMappers()
2024-02-01 15:31:48 +02:00
Salvatore Campagna
bdd3a4ffbe
Hash the tsid to overcome dimensions limits (#98023)
A Lucene limitation on doc values for UTF-8 fields does not allow  us to
write keyword fields whose size is larger then 32K. This limits  our
ability to map more than a certain number of dimension fields  for time
series indices. Before introducing this change the tsid is created as a
catenation of dimension field names and values into a keyword field.

To overcome this limitation we hash the tsid. This PR is intended to be
used as a draft to test different options.

Note that, as a side effect, this reduces the size of the tsid field as
a result of storing far less data when the tsid is hashed. Anyway, we
expect tsid hashing to affect compression of doc values and resulting in
larger storage footprint. Effect on query latency needs to be evaluated
too.

Resolves #93564
2024-02-01 08:25:31 -05:00
Navarone Feekery
d8ff2892ce
[Connectors API] Add new field api_key_secret_id to Connector (#104982)
- Add api_key_secret_id field
- Add update endpoint for api_key_id and api_key_secret_id
2024-02-01 13:50:58 +01:00
Carlos Delgado
155f2cdf3f
Extract inner classes from TransportBulkAction (#104986) 2024-02-01 13:11:29 +01:00
Martijn van Groningen
81a49f1567
Restrict usage of certain aggregations when in sort order execution is required (#104665)
A number of aggregations that rely on deferred collection don't work
with time series index searcher and will produce incorrect result. These
aggregation usages should fail. The documentation has been updated to
describe these limitations.

In case of multi terms aggregation, the depth first collection is
forcefully used when time series aggregation is used. This behaviour is
inline with the terms aggregation.
2024-02-01 07:09:17 -05:00
Pooya Salehi
5b22d4245e
Retry TransportShardMultiGetFomTranslogAction during relocations (#104901)
Same as #104579 but for MGET.

Relates ES-5727
2024-02-01 12:23:10 +01:00
Yang Wang
cc097edd43
Remove S3RequestRetryStats in favor of APM metrics (#104973)
APM metrics based s3 request stats have been available since #102505. It
has collected sufficient data that we can now remove the log based stats
introduced in #100272.

Resolves: ES-7500
2024-02-01 06:19:21 -05:00
Henning Andersen
81be06ea48
Fix blob cache testGetMultiThreaded (#105002)
The verification that we always find a free region could fail due to racing
against incRef'ers (which is not locked).

Closes #104997
2024-02-01 11:35:37 +01:00
Shan Swanlow
f048225d62
Share field mapper tests with other modules (#99142) 2024-02-01 12:14:06 +02:00
Michael Peterson
06a25b60c9
Add keep_alive param to the async-search status endpoint (#104629) 2024-01-31 17:25:37 -05:00
Dianna Hohensee
8ef5bb5c77
Mute RatedRequestsTests.testSuggestionsNotAllowed (#104990) 2024-01-31 14:58:41 -05:00
Armin Braun
17bc83f481
Dry up some code around ScaledFloatFieldMapper (#104951)
We can dry up logic around LeafDoubleFieldData quite a bit. The
RamBytesUsed value passed to the constructor is always `0` and we can
reuse this class in one more spot. Also the object -> double path is the
same code we have in the `NumberFieldMapper`.
2024-01-31 20:21:57 +01:00
Mark Tozzi
a29a3f4dd9
[ESQL] Move binary operator compatbility checking into type resolution (#104490)
This starts moving the binary compatibility type checking out of the verifier and into the type resolve path. Additionally, and as a test case, it wires up the addition tests to use errorForCasesWithoutExamples, which requires the type resolve improvement, and validates that we're doing the right thing for binary addition.

Before we can actually remove the code from the verifier, we need to also adapt the binary comparison functions, which is a fair bit of work. I am planning to do that in a follow up PR, as this one has already been open for two weeks.
2024-01-31 13:32:08 -05:00
Ryan Ernst
125c1c86af
Fix server cli to always pass through exit code (#104943)
In certain circumstances if Elasticsearch encounters an error while
starting up, the server cli may exit with no error. This commit fixes
the cli to always check and wait on the Elasticsearch process and exit
with the same exit code.

relates #104055
2024-01-31 12:28:09 -05:00
Armin Braun
5c99ff5941
Fix needless BytesArray allocation in SourceToParse (#104975)
No need to copy here and allocate GB/min of additional pointers to the same
`byte[]` over and over, the reference here is in most if not all
relevant cases backed by an array anyway.
2024-01-31 17:17:48 +01:00
Nhat Nguyen
efc8be185c
Support enrich coordinator mode (#104936)
This change supports the enrich coordinator mode for cross-cluster queries.
2024-01-31 07:37:42 -08:00