Commit graph

5752 commits

Author SHA1 Message Date
Joe Gallo
e082ad56bf
Update Maxmind mmdb fixture files (#122225) 2025-02-11 10:47:54 -05:00
Armin Braun
210f854430
Relax some search interfaces to allow arbitrary cancellable tasks (#122188)
An easy change we can split out of #121885 to make that shorter.
2025-02-10 19:29:07 +01:00
Armin Braun
d3abf9d5ba
Dry up search error trace ITs (#122138)
This logic will need a bit of adjustment for bulk query execution.
Lets dry it up before so we don't have to copy and paste the fix which
will be a couple lines.
2025-02-10 08:48:49 +01:00
Martijn van Groningen
d93f9c4d58
Address synthetic recovery source release test failures. (#122035) 2025-02-07 13:02:27 -08:00
Oleksandr Kolomiiets
d52be5f784
Add ignore_malformed and null_values to test data generation (#121983) 2025-02-07 11:59:28 -08:00
Simon Cooper
3ed5f73600
Add a parameter to describe the lambda in a transformedMatch matcher (#122013) 2025-02-07 17:13:26 +00:00
Armin Braun
9209341e21
Remove unnecessary FeatureService dependencies (#121496)
We have a lot of unused fields for this thing. Also, more of its methods
can just be made static to avoid a dependency.
2025-02-07 11:23:16 +01:00
Nik Everett
c659349289
ESQL: Clean index when retrying test (#121954)
This modifies the `HeapAttackIT` test to clean an index created by the
test if we have to retry it.

Closes #121873
2025-02-07 09:48:05 +11:00
Mark Vieira
eb6a49b7af
Upgrade mockito (#121849) 2025-02-06 09:36:04 -08:00
Mark Tozzi
69b2078723
Aggregations cancellation after collection (#120944)
This PR addresses issues around aggregations cancellation, mentioned in https://github.com/elastic/elasticsearch/issues/108701 and other places. In brief, during aggregations collection time, we respect cancellation via the mechanisms in the searcher to poison cancelled queries. But once the aggregation finishes collection, there is no further need to interact with the searcher, so we cannot rely on that for cancellation checking. In particular, deeply nested aggregations can spend a long time constructing the results tree.

Checking for cancellation is a trade off, as the check itself is somewhat expensive (it involves a volatile read), so we want to balance checking often enough that cancelled queries aren't taking up resources for a long time, but not so frequently that it slows down most aggregation queries. Our first attempt to this is to check once when we go to build sub-aggregations, as the worst cases for this that we've seen involve needing to build deep sub-aggregation trees. Checking at sub-aggregation construction time also provides a conveniently centralized method call to add the check to.

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Co-authored-by: Nik Everett <nik9000@gmail.com>
2025-02-06 17:15:01 +01:00
Yang Wang
b4d60b0c01 Merge main into multi-project 2025-02-06 14:15:37 +11:00
Yang Wang
6500ebeff6 Fix tests 2025-02-06 13:07:47 +11:00
Mark Vieira
56cac1bfe9
Don't attempt to install modules into test cluster more than once (#121833) 2025-02-06 00:15:16 +01:00
Yang Wang
38d74f7408 Merge main into multi-project 2025-02-06 10:04:49 +11:00
Ryan Ernst
0cf42f2388
Rename environment dir accessors (#121803)
The node environment has many paths. The accessors for these currently
use a "file" suffix, but they are always directories. This commit
renames the accessors to make it clear these paths are directories.
2025-02-05 14:03:28 -08:00
Nik Everett
85da28d919
ESQL: Grow heap attack tests (#121714)
This causes the ESQL heap attack tests to grow their memory usage if
they first don't cause a circuit breaking exception. It just tries again
with more data. That's slow, but it should stop this from failing quite
as much. And it'll give us even more information about failures.

Closes #121465
2025-02-05 21:47:45 +01:00
Salvatore Campagna
6a526755de
Use synthetic recovery source by default if synthetic source is enabled (#119110)
We experimented with using synthetic source for recovery and observed quite positive impact
on indexing throughput by means of our nightly Rally benchmarks. As a result, here we enable
it by default when synthetic source is used. To be more precise, if `index.mapping.source.mode`
setting is `synthetic` we enable recovery source by means of synthetic source.

Moreover, enabling synthetic source recovery is done behind a feature flag. That would allow us 
to enable it in snapshot builds which in turn will allow us to see performance results in Rally nightly
benchmarks.
2025-02-05 13:55:51 +01:00
David Turner
09bc343aab
Migrate to v9 transport handshake (#121646)
This commit moves to sending out a v9-format handshake (with apparent
transport version `8_800_00_0`) and drops support for handshakes from v7
nodes.
2025-02-05 12:06:03 +00:00
Yang Wang
4afa8ba62b Pass boolean supplier for supportsMultipleProjects (MP-1944)
Stateless has a subclass for PersistedClusterStateService which needs to
know the value of supportsMultipleProjects. Due to how a node is
initialized, the value is not known until the plugin components are
created which is after the stateless service is created. Therefore this
PR changes the parameter from boolean to a booleanSupplier so that it
can be resolved later when actually used.

The alternative is to change the PersistedClusterStateServiceFactory
interface so it takes a projectResolver or boolean
supportsMultipleProjects. I prefer to not change the interface. The
creation of Stateless PersistedClusterStateService already uses two
other suppliers so that it feels more aligned to use a boolean supplier.
The other reason is that supportsMultipleProjects may not be needed in
long term so it is better to not have it in an interface.

Relates: MP-1880
2025-02-05 16:19:34 +11:00
Oleksandr Kolomiiets
e885da1e94
Introduce FallbackSyntheticSourceBlockLoader and apply it to keyword fields (#119546) 2025-02-04 16:13:20 -08:00
Yang Wang
fee57daf53 Merge main into multi-project 2025-02-05 11:03:29 +11:00
Jordan Powers
061920b585
Counted keyword randomized testing (#121462)
This patch adds the needed data generator and source matcher to include 
counted_keyword fields in our randomized testing.

This patch also updates the source matcher such that field-specific 
matchers are checked before the generic matcher is used. It seems that 
this is the correct behavior, and the only reason the generic matcher was
checked first was as a workaround for issue #111916, which is now closed.
2025-02-04 13:06:26 -08:00
Christoph Büscher
0af4646052
Fix rare failures in YAML xContent roundtrip tests (#121515)
Under very unfortunate conditions tests that check xContent objects
roundtrip parsing  (like i.e. SearchHitsTests#testFromXContent)
can fail when we happen to randomly pick YAML xContent type and create
random (realistic)Unicode character sequences that may contain the
character U+0085 (133) from the Latin1 code page. That specific character
doesn't get parsed back to its original form for YAML xContent, which can 
lead to rare but hard to diagnose test failures.

This change adds logic to AbstractXContentTestCase#test() which lies at
the core of most of our  xContent roundtrip tests that disallows test
instances containing that particular character  when using YAML xContent
type.

Closes #97716
2025-02-04 18:16:43 +01:00
Francisco Fernández Castaño
30a706a80d
Revert "Remove INDEX_REFRESH_BLOCK after index becomes searchable (#120807)" (#121427)
This reverts commit ae0f1a64b5.

The refresh block would be removed in a subsequent cluster state
update instead of removing it immediately after an index is ready
for searches.

Closes ES-10697
2025-02-04 08:08:38 +01:00
Yang Wang
fb6e142e86 Take project into account when deleting unused mappingHash
Indices from different projects could have identical mappings and hence
identical mapping hash. The unused mapping hashes are computed for a
project scope. Hence the deletion must also be project-scoped to not
deleting mapping hashes on a different project.

Resolves: ES-10568
2025-02-04 14:48:11 +10:00
Niels Bauman
a15932159a Merge remote-tracking branch 'public/main' into merge-main 2025-02-04 11:19:42 +10:00
Stanislav Malyshev
2fbec77015
Implement runtime skip_unavailable=true (#121240)
* Implement runtime skip_unavailable=true
2025-02-03 15:47:59 -07:00
Nik Everett
78a9d7b478
ESQL: Reenable another heap attack (#121572)
This one was disabled by a long-closed issue.
2025-02-04 08:58:51 +11:00
Nik Everett
50d76c205f
ESQL: Reenable heap attacks (#121565)
Reenables some heap attack tests, bumping their memory requirements to
try and force a failure on all CI machines. Previously some CI machines
weren't failing, invalidating the test on those machines.

Close #121481 Close #121465
2025-02-04 08:02:30 +11:00
Simon Cooper
c288684fdb
Use NavigableSet for representing test version sets, rather than List (#121266) 2025-02-03 14:01:57 +00:00
Niels Bauman
1b342b26ef Merge main into multi-project 2025-02-03 21:03:58 +10:00
Christoph Büscher
85f5222d69 Revert "WIP (#121463)"
This reverts commit fd1bd79b85.
PR was merged by a mistake, still needs to get reviewed.
2025-02-03 10:58:41 +01:00
Ievgen Degtiarenko
1058df407f
Add expectThrows with messageMatcher (#120290) 2025-02-03 10:14:49 +01:00
Christoph Büscher
fd1bd79b85
WIP (#121463)
Under very unfortunate conditions tests that check xContent objects
roundtrip parsing  (like i.e. [SearchHitsTests
testFromXContent](https://github.com/elastic/elasticsearch/issues/97716)
can fail when we happen to randomly pick YAML xContent type and create
random (realistic)Unicode character sequences that may contain the
character U+0085 (133) from the [Latin1 code
page](https://de.wikipedia.org/wiki/Unicodeblock_Lateinisch-1,_Erg%C3%A4nzung).

That specific character doesn't get parsed back to its original form for
YAML xContent, which can lead to [rare but hard to diagnose test
failures](https://github.com/elastic/elasticsearch/issues/97716#issuecomment-2464465939).

This change adds logic to AbstractXContentTestCase#test() which lies at
the core of most of our  xContent roundtrip tests that disallows test
instances containing that particular character  when using YAML xContent
type.

Closes #97716
2025-02-01 09:56:59 +11:00
Nik Everett
d9da7c9940
ESQL: Expand HeapAttack for LOOKUP (#120754)
* ESQL: Expand HeapAttack for LOOKUP

This expands the heap attack tests for LOOKUP. Now there are three
flavors:
1. LOOKUP a single geo_point - about 30 bytes or so.
2. LOOKUP a one mb string.
3. LOOKUP no fields - just JOIN to alter cardinality.

Fetching a geo_point is fine with about 500 repeated docs before it
circuit breaks which works out to about 256mb of buffered results.
That's sensible on our 512mb heap and likely to work ok for most folks.
We'll flip to a streaming method eventually and this won't be a problem
any more. But for now, we buffer.

The no lookup fields is fine with like 7500 matches per incoming row.
That's quite a lot, really.

The 1mb string is trouble! We circuit break properly which is great and
safe, but if you join 1mb worth of columns in LOOKUP you are going to
need bigger heaps than our test. Again, we'll move from buffering these
results to streaming them and it'll work better, but for now we buffer.

* updates
2025-01-31 19:11:13 +01:00
Moritz Mack
a896779271
Fix LambdaMatchers.transformedMatch to handle null values (#121371) 2025-01-31 10:34:48 +01:00
Niels Bauman
da7d58c06c Merge main into multi-project 2025-01-31 11:21:48 +10:00
Oleksandr Kolomiiets
1225b0720a
Fix propagation of dynamic mapping parameter when applying copy_to (#121109) 2025-01-31 00:26:58 +01:00
Martijn van Groningen
0d2db063ec
Update ESRestTestCase's ROLLUP_REQUESTS_OPTIONS (#121335)
Sometimes there are multiple warning.
2025-01-30 23:17:47 +01:00
Armin Braun
d537a1f323
Remove redundant LatchedActionListener from ESIntegTestCase (#121244)
This is effectively the same as the other class. The logging is
irrelevant and the dead `addError` is too => lets remove this.
2025-01-30 10:03:49 +01:00
Niels Bauman
621a18d947 Merge main into multi-project 2025-01-30 17:26:28 +10:00
Larisa Motova
bcd8d159d6
[ES|QL] Support some stats on aggregate_metric_double (#120343)
Adds non-grouping support for min, max, sum, and count, using
CompositeBlock as the underlying block type and an internal
FromAggregateMetricDouble function to handle converting from
CompositeBlock to the correct metric subfields.

Closes #110649
2025-01-29 12:08:46 -10:00
Mark Vieira
61dc93107f
Add lucene version compatibility tests (#121104)
This commit adds compatibility tests that target ES revisions that align with specific Lucene versions. In this case, we are intending to upgrade from Lucene 10.0 to 10.1. Since no on-prem Elasticsearch release exists with 10.0, we need another method to ensure compatibility with Lucene 10.0 indicies.

The work here is a bit hacky since all our compatibility testing infrastructure is centered around versions and we're now effectively doing compatibility tests between two different revisions of Elasticsearch that both report the same version. Ideally this specific testing would be replaced by unit tests, rather that reusing our full cluster restart tests for this purpose.

We'll also want to bump the commit referenced in the CI pipelines here to align with the last commit using Lucene 10.0.
2025-01-29 13:20:25 -08:00
Slobodan Adamović
c5ab17c3aa
Deprecate certificate-based remote cluster security model (#120806)
Today, Elasticsearch supports two models to establish secure connections
and trust between two Elasticsearch clusters:

- API key based security model
- Certificate based security model

This PR deprecates the _Certificate based security model_ in favour of *API key based security model*.
The _API key based security model_ is preferred way to configure remote clusters,
as it allows to follow security best practices when setting up remote cluster connections
and defining fine-grained access control.

Users are encouraged to migrate remote clusters from certificate to API key authentication.
2025-01-29 19:43:04 +01:00
Francisco Fernández Castaño
ae0f1a64b5
Remove INDEX_REFRESH_BLOCK after index becomes searchable (#120807)
This commit enhances the ShardStartedClusterStateTaskExecutor by
introducing functionality to automatically remove the
INDEX_REFRESH_BLOCK once an index becomes searchable.

The change ensures search availability by checking that at least one
copy of each searchable shard is available whenever an unpromotable
shard is started. Once this condition is met, the INDEX_REFRESH_BLOCK
is removed.

Closes ES-10278
2025-01-29 18:49:48 +01:00
Nik Everett
656d36aacf
ESQL: Bump heap attack suite timeout (#121198)
The heap attack test is growing so it is taking longer. We'll work to
speed it up, but for now, let's bump the timeout.

Closes #121112
2025-01-29 17:51:14 +01:00
Oleksandr Kolomiiets
cb2e5cf6f7
Fix matching of half_float and scaled_float values in LogsDB tests (#121098) 2025-01-29 10:46:22 +02:00
Martijn van Groningen
8185cafaf2
Emit deprecation warning when executing one of the rollup APIs (#113131)
Relates to #112690
2025-01-29 08:48:53 +01:00
Mark Vieira
e7e1155831
Use links when possible when installing test cluster modules (#121067)
When we install modules into test clusters we do a full copy instead of
links. This both eats up more IO and disk space unnecessarily.
2025-01-29 05:11:52 +11:00
Jonathan Buttner
a4d8a87f8a
Removing unified feature flag (#121043) 2025-01-28 12:43:57 -05:00