Commit graph

75574 commits

Author SHA1 Message Date
Kyungeun Kim
6780739ffd
x-pack/plugin/apm-data: add transaction.profiler_stack_trace_ids field to apm plugin (#105223)
* feat: add transaction.profiler_stack_trace_ids field to apm plugin

* docs: add changelog file

* fix: add counted-keyword module
2024-02-14 12:25:51 +09:00
Keith Massey
f0ec294382
Limiting the number of nested pipelines that can be executed (#105428)
Limiting the number of nested pipelines that can be executed within a single pipeline to 100
2024-02-13 16:28:31 -06:00
Keith Massey
c884945a93
Adding executedPipelines to the IngestDocument copy constructor (#105427) 2024-02-13 15:11:47 -06:00
Michael Peterson
8e53b0f0bf
Cross cluster search minimize roundtrips avoids incremental merges until Kibana polls via async-search-status endpoint (#105455)
This is a temporary change to avoid doing incremental merges in
cross-cluster async-search when minimize_roundtrips=true.

Currently, Kibana polls for status of the async-search via the
_async_search endpoint, which (without this change) will
do an incremental merge of all search results. Once Kibana
moves to polling status via _async_search/status, then
we will undo the change in this commit.
2024-02-13 14:21:24 -05:00
Rene Groeschke
b984b44767
Update Gradle wrapper to 8.6 (#103796) 2024-02-13 11:13:29 -08:00
David Kyle
ecb01405e7
[ML] Move the model parameter from task settings to service settings (#105458)
When configuring an OpenAI text embedding service the `model_id` should
have always been part of the service settings rather than task settings.
Task settings are overridable, service settings cannot be changed. If
different models are used the configured entities are considered
distinct. 

task_settings is now optional as it contains a single optional field
(`user`)

```
PUT _inference/text_embedding/openai_embeddings
{
  "service": "openai",
  "service_settings": {
    "api_key": "XXX",
    "model_id": "text-embedding-ada-002"
  }
}
```

Backwards compatibility with previously configured models is maintained
by moving the `model_id` (or `model`) from task settings to service
settings at the first stage of parsing. New configurations are persisted
with `model_id` in service settings, old configurations with `model_id`
in task settings are not modified and will be tolerated by a lenient
parser.
2024-02-13 13:44:33 -05:00
Max Hniebergall
05d2375e61
[ML] System auditor notifications for pytorch restarts (#105411)
* Add systemAudit logs to process restarts

* Updated error message for system audit / notifications

* Added system audit message for not restarting pytorch process

* Switch to inferenceAuditor and update error message
2024-02-13 13:25:34 -05:00
Max Hniebergall
89bf949555
[ML] Fix for inference modelId trained model deployment id collision (#105303)
* Fix for inference modelId trained model deployment id collision

* Add check for model already downloaded before put trained model
2024-02-13 12:31:07 -05:00
David Kyle
88f82b5c93
[ML] Return chunks for each input to InferenceService::chunkInfer (#105447) 2024-02-13 16:40:33 +00:00
Max Hniebergall
05f2c1164e
[ML] Changed system auditor to use levels (#105429)
* Changed system auditor to use levels

* Update docs/changelog/105429.yaml
2024-02-13 11:31:58 -05:00
Jack Conradson
b5828fbb67
Add plumbing to check cluster features in SearchSourceBuilder (#105417)
This change adds additional plumbing to pipe through the available cluster features into 
SearchSourceBuilder. A number of different APIs use SearchSourceBuilder so they had to make this 
available through their parsers as well often through ParserContext. This change is largely mechanical 
passing a Predicate into existing REST actions to check for feature availability.

Note that this change was pulled mostly from this PR (#105040).
2024-02-13 08:30:04 -08:00
Mark Vieira
a42a940b78
Update Gradle Enterprise plugin to 3.16.1 (#104435) 2024-02-13 08:15:59 -08:00
Andrei Dan
87c23c734c
[DSL] Avoid reading the PREFER_ILM setting until needed (#105446) 2024-02-13 15:14:29 +00:00
Mary Gouseti
77a5d15cc7
Wait for all cluster state updates to be processed before wiping the cluster (#104846) (#105349)
In #104846, we see an inconsistency in the state of the clusters between
the test and the clean up at the end of the test. 

The failure is as follows: - The test using ILM at some point creates a
full searchable snapshots with name `restore-my-index-xxxx` - Then ILM
moves to frozen and creates a partially searchable snapshots with alias
`restore-my-index-xxxx` - The test confirms that `restore-my-index-xxxx`
is an alias and ends - During tear down, it appears that the cluster
state retrieved contains the `restore-my-index-xxxx` as an index so it
issues a request to delete it. - The deletion fails because
`restore-my-index-xxxx` is an alias.

I do not think that the test has an issue, most of the clues shows that
the partial searchable snapshot has been correctly processed. Only this
cluster state retrieval seems a bit off. In order to reduce this
flakiness we introduce a `GET _cluster/health?wait_for_events=languid`
to ensure we get the latest cluster state.

Fixes #104846
2024-02-13 09:12:17 -05:00
Nassim Kammah
e1217e41db
Doc update (#105270)
Following the migration from Jenkins to Buildkite, docs previews are now available at <repo>_bk_<PR>.

More context in https://github.com/elastic/docs/pull/2898
2024-02-13 14:48:02 +01:00
Slobodan Adamović
1f0ea3e015
[Doc] Mark secure_bind_password settings as reloadable (#105448)
This is a followup to #104320, which updates the docs for `secure_bind_password` 
settings and marks them as reloadable.
2024-02-13 14:04:32 +01:00
Felix Barnsteiner
15fa0bf0eb
Avoid false-positive matches on intermediate objects in ecs@mappings (#105440)
Fixes #102794
2024-02-13 06:59:03 -05:00
Felix Barnsteiner
6066d1d46e
Add highlight section to release notes for #99747 (#105412) 2024-02-13 11:16:38 +01:00
Matteo Piergiovanni
0951b32c36
Test fix: handling engine closed when refreshing FieldInfos (#105374) 2024-02-13 10:22:38 +01:00
Daniel Mitterdorfer
e6e14d727c
[Profiling] Ignored unmapped stacktrace fields (#105385)
In a scenario where multiple indices are queried and some of them don't
contain the specified stacktrace field, empty stacktrace buckets will be
returned (that's ok and expected) but instead of being of type
`StringTerms` they are of type `UnmappedTerms`. This leads to avoidable
`ClassCastExceptions` when we instead just use the common base interface
`Terms` internally to iterate over buckets.
2024-02-13 08:16:27 +01:00
Daniel Mitterdorfer
1a85de20e0
Mute DownsampleActionIT#testRollupIndex() (#105438)
Relates #105437
2024-02-13 02:16:04 -05:00
Daniel Mitterdorfer
4255946e1c
[Profiling] Return early when no data are found (#105380)
With this commit we check whether any documents match when custom
indices are provided and terminate early if the response is empty.
2024-02-13 07:10:56 +01:00
Costin Leau
7ef7cc3450
ESQL: Add plan consistency verification after each optimizer (#105371)
To catch potential mistakes in the output of a plan, introduce a sanity
 check rule for verifying the nodes dependency within a tree after each
 optimizer runs.

The goal of the rule is to assert that after being modified dependencies
 between nodes don't get misplaced or incorrectly replaced.
2024-02-12 21:44:42 -08:00
Keith Massey
e2b2232569
Improving the performance of the ingest simulate verbose API (#105265)
This updates the simulate verbose API to run in O(N) (for number of pipelines)
time and memory like the simulate and ingest APIs rather than O(N^2).
2024-02-12 16:04:21 -06:00
Mark Tozzi
03eadaa7dc
Clarify some javadoc (#105422)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-02-12 16:37:43 -05:00
David Turner
e2ff447b60
Improve RareClusterStateIT (#105390)
Today this test suite relies on being able to cancel an in-flight
publication after it's reached a committed state. This is questionable,
and also a little flaky in the presence of the desired balance allocator
which may introduce a short delay before enqueuing the cluster state
update that performs the reconciliation step.

This commit removes the questionable meddling with the internals of
`Coordinator` and instead just blocks the cluster state updates at the
transport layer to achieve the same effect.

Closes #102947
2024-02-12 15:43:29 -05:00
Costin Leau
b135b4a56f
ESQL: Fix Analyzer to not interpret escaped * as a pattern (#105325)
Fix a bug in the Analyzer which always considered `*` (match any string)
 in field names even when escaped (back quoted). This caused the clause
 to be too greedy and either keep or drop too many fields.

Fix #104955
2024-02-12 12:41:13 -08:00
Keith Massey
a14a06e89b
Handling the case in ActionErrorIntegrationTests where watch history index is being created when read (#105369) 2024-02-12 14:18:57 -06:00
Costin Leau
8272b3a5da Fix failing test. 2024-02-12 12:10:14 -08:00
Dmitry Cherniachenko
a50e58d99a
Use single-char variant of String.indexOf() where possible (#105205)
* Use single-char variant of String.indexOf() where possible

indexOf(char) is more efficient than searching for the same one-character String.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-02-12 14:14:32 -05:00
Dmitry Cherniachenko
df4792e7ca
Remove a copy of IndexNameGenerator.generateValidIndexName() (#105132)
GenerateUniqueIndexNameStep contained the exact copies of the generateValidIndexName() and generateValidIndexSuffix() methods from the IndexNameGenerator utility class.

I removed the duplicates and changed the code to use the utility method instead.
Also added javadoc and switched to a pre-compiled Pattern.

The test was also broken as it checked the suffix to consist of only illegal characters.
Replacing matches() with find() makes it check for presence of at least one illegal character.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-02-12 14:11:40 -05:00
Keith Massey
5ccadaee7b
Adding a custom exception for problems with the graph of pipelines to be applied to a document (#105196)
This PR removes the need to parse the exception message to detect if a cycle has been detected
in the ingest pipelines to be run on a document.
2024-02-12 13:11:00 -06:00
Martijn van Groningen
6a6fba689a
Change PerFieldMapperCodec to use tsdb doc values codec for all fields. (#105301)
The index needs to be in tsdb mode. All fields will use the tsdb coded, except fields start with a _ (not excluding _tsid).

Before this change relies on MapperService to check whether a field needed to use tsdb doc values codec, but we missed many field types (ip field type, scaled float field type, unsigned long field type, etc.). Instead we wanted to depend on the doc values type in FieldInfo, but that information is not available in PerFieldMapperCodec.

Borrowed the binary doc values implementation from Lucene90DocValuesFormat. This allows it to be used for any doc values field.

Followup on #99747
2024-02-12 19:53:47 +01:00
Dmitry Cherniachenko
e21a4874ab
Use String.replace() instead of replaceAll() for non-regexp replacements (#105127)
* Use String.replace() instead of replaceAll() for non-regexp replacements

When arguments do not make use of regexp features replace() is a more efficient option, especially the char-variant.
2024-02-12 13:11:15 -05:00
Lee Hinman
d95d6adae5
Clarify update operations may be performed on a data stream's backing indices (#105408)
These statements come off a little too strongly towards "don't use data streams if you *ever* have updates", but they do support updates when necessary, as long as the backing indices are used.
2024-02-12 10:58:13 -07:00
Ryan Ernst
0d1f2d9407
Pass through migration status (#105399)
This was unintentionally left out of the args to the main ctor.

relates #102271
2024-02-12 12:27:00 -05:00
Joe Gallo
f25ea29522
[DOCS] Drop these unused references (#105409) 2024-02-12 12:10:33 -05:00
Albert Zaharovits
a241dcb4ac
Avoid using the grant-API-key-API in yml test (#105402)
The grant API key API is disabled in serverless.
Rather than mute the Query API Key yml test (21_query_with_aggs),
which uses the grant API key API, for the serverless build,
I've here modified the yml test to not invoke the grant API Key API.
Querying for granted API keys is already covered
(e.g. ApiKeyAggsIT#testFilterAggs).

Relates #104895
2024-02-12 19:07:48 +02:00
Joe Gallo
d54329011f
Remove HLRC from ES codebase (#105406) 2024-02-12 11:50:01 -05:00
Andrei Stefan
9151d2d6b1
ESQL: make cidr_match foldable (#105403)
Fixes https://github.com/elastic/elasticsearch/issues/105376 Creates two
new ESQL specific base classes for functions, eliminating boilerplate
code from many concrete function implementations.
2024-02-12 11:41:44 -05:00
Ryan Ernst
4b5f0a0bb7
Mute flaky SearchableSnapshotsCanMatchOnCoordinatorIntegTests
see https://github.com/elastic/elasticsearch/issues/105339
2024-02-12 08:26:16 -08:00
Przemyslaw Gomulka
11f3c29089
DocumentSizeObserver infrastructure to allow not reporting upon failures (#104859)
We want to report that observation of document parsing has finished only upon a successful indexing.
To achieve this, we need to perform reporting only in one place (not as previously in both IngestService and 'bulk action')

This commit splits the DocumentParsingObserver in two. One for wrapping an XContentParser and returning the observed state - the DocumentSizeObserver and a DocumentSizeReporter to perform an action when parsing has been completed and indexing successful.

To perform reporting in one place we need to pass the state from IngestService to 'bulk action'. The state is currently represented as long - normalisedBytesParsed.

In TransportShardBulkAction we are getting the normalisedBytesParsed information and in the serverless plugin we will check if the value is indicating that parsing already happened in IngestService (value being != -1) we create a DocumentSizeObserver with the fixed normalisedBytesParsed and won't increment it.

When the indexing is completed and successful we report the observed state for an index with DocumentSizeReporter

small nit: by passing the documentParsingObserve via SourceToParse we no longer have to inject it via complex hierarchy for DocumentParser. Hence some constructor changes
2024-02-12 17:16:24 +01:00
István Zoltán Szabó
6e8e7ba875
[DOCS] Adds cohere service to inference API docs (#105394) 2024-02-12 16:35:57 +01:00
Keith Massey
d268173350
Fixing a minor typo in bulk api docs (#105404) 2024-02-12 09:24:42 -06:00
Alexander Spies
a241b96b8f
Upgrade ANTLR4 to 4.13.1 (#105334) 2024-02-12 15:24:32 +01:00
David Turner
a71f9aae68 AwaitsFix for #105331 2024-02-12 13:43:25 +00:00
Albert Zaharovits
9ee76c6b26
Aggs support for Query API Key Information API (#104895)
Adds support for the aggs request body parameter to the Query API Key Information API.
This parameter works identically to the well known eponymous parameter of the _search endpoint,
but the set of allowed aggregation types as well as the field names allowed is restricted.
2024-02-12 14:22:34 +02:00
David Turner
60e4121c97 AwaitsFix for #102947 2024-02-12 11:59:50 +00:00
Jedr Blaszyk
3586a1702f
[Connector API] Change required privileges to indices:data/read(write) (#105289) 2024-02-12 12:36:51 +01:00
Daniel Mitterdorfer
7f1e81d377
Mute DatafeedJobsIT (#105387)
Relates #105239
2024-02-12 05:53:22 -05:00