Commit Graph

78559 Commits

Author SHA1 Message Date
Stef Nestor 512bca8669
(Doc+) Error "number of documents in the index can't exceed" (#110449)
* (Doc+) Error "number of documents in the index can't exceed"

👋 howdy, team! 

This adds resolution outline for error ... which induces ongoing, lowkey support
```
Number of documents in the index can't exceed [2147483519]
```

* feedback

* feedback

Co-authored-by: David Turner <david.turner@elastic.co>

* feedback

Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>

* feedback

* feedback

* Test change to address docs check failure

* Revert test change

* Test docs check

---------

Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2024-07-16 11:39:30 +02:00
Artem Prigoda 199910c10b
[test] Fix IndexShardTests#testScheduledRefresh (#110312)
After we flushed the shard, we only make sure that the refresh call is
propagated to the shard engine, but we can't be sure that the call is
actually ends up in a shard refresh. The call in
`InternalEngine#refresh` can return `false` if we couldn't acquire the
lock on `ElasticsearchDirectoryReader`, because it's already being
refreshed.

We can wrap the call in `assertBusy` to retry it in order to make sure
that the shard eventually gets refreshed.

Resolves #101008
2024-07-16 18:25:17 +10:00
Salvatore Campagna 95194ac77f
LogsDB quality assurance testing (#110479)
This PR improves our integration testing coverage. The idea is to have two data streams,
referred as the baseline acting as the source of truth and a contender data stream whose
contents and results of queries need to be checked against the baseline.

We also include some capability around matching results which needs to be extended
to be able to consider artifacts in results introduced by the usage of synthetic source.
2024-07-16 09:44:03 +02:00
Ignacio Vera c4a4311ee8
[ESQL] Add test to check the consistency of spatial ESQL queries (#110831) 2024-07-16 09:06:20 +02:00
Nhat Nguyen 04845342f4
Fork field-caps for ES|QL (#110738)
We need to fork the field-caps API for ES|QL to allow changes to the new
internal API without risking breaking the external field-caps API.
2024-07-15 17:21:16 -07:00
Oleksandr Kolomiiets 1bb58ccff0
Fix logsdb mapping rest tests on serverless (#110900)
Currently fails due to validation that is only performed in serverless:

```
java.lang.AssertionError: Failure at [logsdb/20_mapping:94]: 
Expected: "Failed to parse mapping: Indices with with index mode [logs] only support synthetic source"
     but: was "Failed to parse mapping: Parameter [mode=disabled] is not allowed in source"
```
2024-07-16 08:15:33 +10:00
Michael Peterson 5c98098b0d
Revert "Search coordinator uses event.ingested in cluster state to do rewrites (#110352)" (#110881)
This reverts commit d45d164afe.
2024-07-15 15:44:03 -04:00
Fang Xing 91fb6e938d
[ES|QL] add tests for stats by constant (#110593)
* add tests for stats by constant
2024-07-15 15:21:22 -04:00
Mark Tozzi cf8b41e61e
remove unused core binary comparison classes (#110891)
Quick cleanup PR.  With
https://github.com/elastic/elasticsearch/pull/109413 merged, nothing in
ESQL production depends on the core binary comparison classes anymore. 
This PR removes them to avoid the potential for confusion, and open the
opportunity for merging the core `BinaryComparison` class with the
`EsqlBinaryComparison` base class, which is now its only direct
inheritor (work to be done in a future PR).
2024-07-16 04:46:36 +10:00
Oleksandr Kolomiiets a25ed530e5
Add validation for synthetic source mode in logs mode indices (#110677) 2024-07-15 11:11:57 -07:00
Craig Taverner 3a93757fde
Fix for union-types for multiple columns with the same name (#110793)
* Make union types use unique attribute names

* Cleanup leftover

* Added failing test and final fix to EsRelation

* Implement FieldAttribute.fieldName()

* Fix tests

* Refactor

* Do not ignore union typed field's parent

* Fix important typo

D'oh

* Mute unrelated (part of) test

* Move capability to better location

* Fix analyzer tests

* multi-node tests with an earlier version of union-types (before this change) fail

* Add capability to remaining failing tests

* Remove variable

* Add more complex test

* Consolidate union type cleanup rules

* Add 3 more required_capability's to make CI happy

* Update caps for union type subfield yaml tests

* Update docs/changelog/110793.yaml

* Refined changelog text

* Mute BWC for 8.15.0 for failing YAML tests

* union_types_remove_fields for all 160_union_types tests

The tests fail spordically, so safer to mute the entire suite.

---------

Co-authored-by: Alexander Spies <alexander.spies@elastic.co>
2024-07-15 20:03:52 +02:00
Jonathan Buttner 07c7bf438f
Anthropic docs (#110850) 2024-07-15 13:43:14 -04:00
Mark Vieira fa8b5375c2
Add runtime classpath as input to ThirdPartyAuditTask (#110882)
The runtime classpath of `ThirdPartyAuditTask` was not being tracked as
an input which can cause issues with task output caching and build
avoidance.
2024-07-16 03:34:51 +10:00
Iván Cea Fontenla 43a3af66e8
ESQL: Add boolean support to TOP aggregation (#110718)
- Added a custom implementation of BooleanBucketedSort to keep the top booleans
- Added boolean aggregator to TOP
- Added tests (Boolean aggregator tests, Top tests for boolean, and added boolean fields to CSV cases)
2024-07-16 03:14:29 +10:00
Jonathan Buttner 4c413f4434
[ML] Inference API request count telemetry and metrics core components (#110799)
* Adding new inference stats class

* Working test

* Adding factory to plugin

* Removing unnecessary changes

* Fixing test

* Removing close() for now

* Expanding modelId() comment

* using incrementby and refactoring interfaces
2024-07-15 12:56:45 -04:00
Volodymyr Krasnikov 7294af7399 AwaitsFix: https://github.com/elastic/elasticsearch/issues/110885 2024-07-15 09:55:44 -07:00
elasticsearchmachine 53c2094b75 Mute org.elasticsearch.upgrades.FileSettingsUpgradeIT org.elasticsearch.upgrades.FileSettingsUpgradeIT #110884 2024-07-16 02:51:57 +10:00
Armin Braun e5d0b40297
Ignore missing JNA in test framework module (#110880)
These come up as missing during third party audit.
2024-07-16 02:23:42 +10:00
Volodymyr Krasnikov 2ef87b8eec
Implement RequestedRangeNotSatisfiedException for Azure and GCP (#110401)
* Implement RequestedRangeNotSatisfiedException for Azure and GCP

* spotless

* rename test

* Generalize 3rd party tests for 3 cloud blob containers

* Follow comments

* minimize changes with main

* Follow comments 2
2024-07-15 09:09:37 -07:00
Iván Cea Fontenla ac6803cf78
ESQL: Add grouping cases to aggregation tests (#110795)
- Added a test case with groups to the aggregation tests, which detected:
  - Fixed BitArray out of index error on `fill()`
  - Fixed BooleanArrayState out of index error on `getOrDefault()`, affecting Max and Min
    - Also, this bug affected the results of Max/Min in some specific cases
2024-07-16 01:47:40 +10:00
Armin Braun c16f2c9f87
Speedup CanMatchPreFilterSearchPhase constructor (#110860)
This constructor is needlessly inefficient:
* Sorting an array is quite a bit faster than sorting an `ArrayList` the way we did it here (could do it faster via List.sort but array ist still better).
* Pre-size the hashmap of positions
* Faster `ShardId.compareTo`
* Much faster `SearchShardIterator.compareTo`!
2024-07-15 15:18:19 +02:00
David Turner 3f9f70469e
Simplify reset-features API (#110866)
Today we return HTTP code 207 if some features successfully reset and
others failed. This is not an appropriate response code, it has a _very_
precise meaning according to the HTTP specification to which we do not
adhere. Since this API is used only in tests we can be stricter and
return a 500 unless it completely succeeds.
2024-07-15 13:23:21 +01:00
David Kyle 48e6e0f86c
[ML] Log model download cancelled message as a warning not error (#110776) 2024-07-15 13:01:35 +01:00
Iraklis Psaroudakis 71ebd967bf
Do not write dangling indices in a test (#110867)
So that the only expected disk write at the point of the assertion is from the bulk request. And not from the asynchronous runnable of updateDanglingIndicesInfo().

Fixes #110551
2024-07-15 15:01:10 +03:00
David Turner 787b9336cd
Resolve repo earlier in `TransportGetSnapshotsAction` (#110863)
While it is _technically_ true that we only need to look up the
`Repository` instance in order to load `SnapshotInfo` blobs for
snapshots that aren't currently running, in practice the repository
should exist on all paths anyway, the lookup is cheap, and it simplifies
some future work to resolve it sooner.
2024-07-15 12:17:48 +01:00
Jedr Blaszyk 8417542edd
[Connector APIs] Add docs for sync job claim endpoint (#110412) 2024-07-15 13:01:12 +02:00
Liam Thompson 6590894c99
[DOCS] Add note about ML model 502 timeout when using `Create inference API` (#110835)
* [DOCS] Add note about ml model 502 timeout

* Add note to API ref
2024-07-15 12:19:21 +02:00
David Turner b15b76b869
Deprecate timed `PlainActionFuture#get` (#110859)
The timed `PlainActionFuture#get` method is almost exclusively used in
tests, and never in a place where it really matters that it supplies a
`PlainActionFuture<T>` rather than an `ActionListener<T>`. Moreover some
of its usages wait for longer than `SAFE_AWAIT_TIMEOUT`, typically 30s,
but not for any good reason. We have several suitable test utility
methods for achieving the same thing, and these utilities automatically
deal with exceptions/interrupts/timeouts appropriately. This commit
replaces all the test usages with more suitable test utilities.

The only production usages are in the CCR module. While it would be good
to remove this blocking code, for now this commit just introduces a new
CCR-only utility for this behaviour. That way we can deprecate the
widely-available `PlainActionFuture#get` method and remove it in a
follow-up.
2024-07-15 19:30:58 +10:00
Iván Cea Fontenla 6433c77d98
Fix CSV test cases names with SYNC or ASYNC (#110794)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-15 11:10:57 +02:00
David Turner cc964b486e AwaitsFix for #110406 2024-07-15 09:29:29 +01:00
Armin Braun 2dc28ac2f1
Use new runInParallel and startInParallel test util in more spots (#110853)
It's in the title. Use the utility in a couple more spots to save some code and thread creation.
2024-07-15 09:34:52 +02:00
Ryan Ernst e6713a5c0a
Remove JNA from server dependencies (#110809)
All native methods are now bound through NativeAccess. This commit
removes the jna dependency from server.

relates #104876
2024-07-12 19:49:13 -07:00
Ryan Ernst e4349f8787
Force resolution of fstat64 symbol with JNA (#110807)
When JNA loads libraries it creates a proxy object for the library.
Unfortunately it doesn't actually inspect any of the methods, those get
bound lazily at runtime when the method is called through the proxy. For
fstat64 we need to know at load time whether the symbol exists, so that
we can fallback to an alternate function if it doesn't.

This commit looks up the NativeLibrary object from JNA for libc and
checks if fstat64 exists during load time.
2024-07-12 14:53:01 -07:00
David Turner c96f801687
Further reduce allocations in `TransportGetSnapshotsAction` (#110817)
Collecting the list of snapshot IDs over which to iterate within each
repository today involves several other potentially-large intermediate
collections and a bunch of other unnecessary allocations. This commit
replaces those temporary collections with an iterator which saves all
this temporary memory usage.

Relates ES-8906
2024-07-13 07:37:43 +10:00
Jack Conradson 13c3211c70
Rename search response metric attribute (#110842)
This change renames the search response metric attribute status to response_status. This is more 
descriptive for an attribute that falls under the global labels namespace.

This also fixes a typo with succes to success.
2024-07-12 11:53:27 -07:00
Pat Whelan 7593db8922
[ML] Consolidate ExecutableActions (#110806)
- Created two new ExecutableActions, SenderExecutableAction and
  SingleInputSenderExecutableAction
- Most chat completions are migrated over the
  SingleInputSenderExecutableAction
- Every other Action are migrated over to SenderExecutableAction
- RequestManagers and Error Message construction are migrated into the
  ActionCreator classes.

Relate #110805
2024-07-12 14:49:40 -04:00
Fang Xing 0be34fe3b5
[ES|QL] Rewrite In with EvaluatorMapper (#109413)
* rewrite in with EvaluatorMapper
2024-07-12 14:15:47 -04:00
Nik Everett 9f001169c6
ESQL: Document the pattern to count TRUE (#110820)
This adds an example to the docs an example of counting the TRUE results
of an expression. You do `COUNT(a > 0 OR NULL)`. That turns the `FALSE`
into `NULL`. Which you need to do because `COUNT(false)` is `1` -
because it's a value. But `COUNT(null)` is `0` - because it's the
absence of values.

We could like to make something more intuitive for this one day. But for
now, this is what works.
2024-07-12 14:08:22 -04:00
Oleksandr Kolomiiets 216b5d56e1
Add tests for applying custom settings/mapping to indices in logs mode (#110803) 2024-07-12 10:41:10 -07:00
Mark Tozzi 2c1f70916f
[ESQL] Count_distinct(_source) should return a 400 (#110824)
Resolves
[#105240](https://github.com/elastic/elasticsearch/issues/105240)

Count_distinct doesn't work on source, but the type resolution was
allowing that through.  This resulted in a 500 layer deeper in the
aggregations code.  This PR fixes the 500 error by correctly failing
during type resolution.
2024-07-13 03:24:35 +10:00
Kathleen DeRusso 7493403e5b
Remove preview from top level query rules API page (#110838) 2024-07-12 12:19:12 -04:00
Rene Groeschke 320f2414aa
Ignore configs from DistributionDownload plugin and bwc for resolveAllDependencies (#110828) 2024-07-12 17:17:55 +02:00
David Turner be6583d274
Enhance startup timeout message (#110763)
Includes the setting name as well as its value, and also add a link to
the relevant troubleshooting docs. Also reinstates a thread interrupt
flag that could technically get lost here otherwise.
2024-07-13 00:24:22 +10:00
Mark J. Hoy 560d4048d2
[Inference API] Add Docs for Amazon Bedrock Support for the Inference API (#110594)
* Add Amazon Bedrock Inference API to docs

* fix example errors

* update semantic search tutorial; add changelog

* fix typo

* fix error; accept suggestions
2024-07-12 10:14:54 -04:00
Fang Xing 9f20d47439
[ES|QL] Pushdown string format for BinaryComparison on datetime fields (#110669)
Use string format in datetime field BinaryComparison.
2024-07-12 09:18:29 -04:00
Mark Tozzi cecdc9b4cd
[ESQL] Combine rule superclasses (#110728)
Small refactoring to merge some optimizer rule super classes that have
exactly one implementation with that implementation.  This makes sure
our tests are pointing at the right classes, and makes finding relevant
code a little easier.
2024-07-12 23:10:23 +10:00
Benjamin Trent c2e1ab8934
Correct tests, skipping on cluster features in mixed clusters is buggy (#110747)
Cluster feature "skip" just doesn't work as expected in a mixed cluster
scenario. It could be that the request is handled by a new node. I
honestly don't know whats happening there.

This adjusts the tests so that we verify that `allow_unmapped_fields`
modifies the behavior as expected.

closes: https://github.com/elastic/elasticsearch/issues/110720 closes:
https://github.com/elastic/elasticsearch/issues/110719
2024-07-12 22:39:14 +10:00
Moritz Mack e1a091f1a2
Skip stacktrace for exceptions when stacktrace is not relevant. (#110785)
These exceptions are expected and don't imply bugs, their stacktrace
isn't relevant and should not be logged.

Relates to ES-7097
2024-07-12 10:47:57 +02:00
Rene Groeschke 384b6a9956
[Gradle] Replace deprecated build scan api usage (#110783)
We updated to use develocity plugin a while ago but still used
a deprecated api in the build complete logic we have running on ci
2024-07-12 09:55:54 +02:00
elasticsearchmachine c61b9eebd5
Forward port release notes for v8.14.3 (#110787) 2024-07-12 08:09:12 +01:00