Commit graph

5752 commits

Author SHA1 Message Date
Tanguy Leroux
0569fc7f24
Forbid the removal of the write block if the index is read-only (#120648)
Ensure that a `write` block cannot be removed on a read-only compatible index in version N-2, while allowing to change a `read_only` block into a `write` block if needed as well as closing/reopening such indices.

Requires #120647 to be merged on `8.x`.

Relates ES-10320
2025-01-28 16:40:01 +01:00
Panagiotis Bailis
8e2044de15
Normalize negative scores for text_similarity_reranker retriever (#120930) 2025-01-28 16:56:47 +02:00
Armin Braun
453db3fd71
Optimize InternalAggregations construction a little (#120868)
We can streamline and optimize this logic a little to
see less copying and more compact results.
2025-01-28 11:50:47 +01:00
Francisco Fernández Castaño
2ebbad406b
Defer unpromotable shard refreshes until index refresh blocks are cleared (#120642)
This update postpones unpromotable refreshes for indices with an active INDEX_REFRESH_BLOCK 
until the block is cleared.
This ensures refresh operations proceed only when the index is no longer blocked.

To avoid indefinite delays, the maximum wait time is governed by the bulk request timeout
whereas for explicit refreshes it relies on the fact that the block will be removed eventually.

Closes ES-10134
2025-01-28 10:32:27 +01:00
Moritz Mack
a608f0626e
Added query param ?include_source_on_error for ingest requests (#120725)
A new query parameter `?include_source_on_error` was added for create / index, update and bulk REST APIs to control
if to include the document source in the error response in case of parsing errors. The default value is `true`.
2025-01-28 09:33:22 +01:00
Kostas Krikellas
22099bad49
[TEST] Restore copy_to, double and float randomized testing (#120906)
Partial rollback of #120859, these data types seem fine.
2025-01-28 02:47:40 +11:00
Dimitris Rempapis
a0bb46d95f
Remove duplicate code in ESIntegTestCase (#120799)
Remote duplicated code
2025-01-27 12:11:44 +02:00
Slobodan Adamović
52e0f21bdd
Enable queryable built-in roles feature by default (#120323)
Making the `es.queryable_built_in_roles_enabled` feature flag enabled by default.
This feature makes the built-in roles automatically indexed in `.security` index and available
for querying via Query Role API. The consequence of this is that `.security` index is now 
created eagerly (if it's not existing) on cluster formation.

In order to keep the scope of this PR small, the feature is disabled for some of the tests, 
because they are either non-trivial to adjust or the gain is not worthy the effort to do it now. 
The tests will be adjusted in a follow-up PR and later the flag will be removed completely.

Relates to #117581
2025-01-27 10:25:54 +01:00
Kostas Krikellas
1cb2a65e19
Skip flaky configuration in randomized testing for logsdb (#120859) 2025-01-25 11:59:31 +02:00
Keith Massey
160bdab8fd
Removing the reindex data stream feature flag (#120677) 2025-01-24 15:56:29 -06:00
Oleksandr Kolomiiets
3d4349851b
[TEST] Restore scaled_float and half_float data generation (#120756) 2025-01-24 13:45:42 -08:00
Kostas Krikellas
969cd70aa0
Restore source matching in randomized logsdb tests (#120773)
Applies the fix in `SourceMatcher` from #120756, along with disabling
`SCALED_FLOAT` and `HALF_FLOAT` that have accuracy issues leading to
false positives.
2025-01-25 04:36:59 +11:00
Joe Gallo
5e662c507e
Optimize IngestDocMetadata isAvailable (#120753) 2025-01-24 09:22:21 -05:00
Dimitris Rempapis
66db8c7d4c
Test/107515 RestoreTemplateWithMatchOnlyTextMapperIT (#120392)
Update the way of comparing stateMaps for equality
2025-01-24 15:47:44 +02:00
Alexey Ivanov
32eada688f
Introduce minimumCompatibilityVersion to BuildVersion (ES-9378) (#119101) 2025-01-24 12:41:00 +00:00
Martijn van Groningen
cd10b05162
Turn _source meta fieldmapper's mode attribute into a no-op. (#119072)
Closes #118596
2025-01-24 09:25:55 +01:00
Panagiotis Bailis
86fbec3cd4
Avoid populating rank docs metadata if explain is not specified (#120536) 2025-01-24 08:25:37 +02:00
Niels Bauman
6495dcbb40 Merge main into multi-project 2025-01-24 15:48:39 +10:00
Jordan Powers
b88f1eddc4
Counted keyword: inherit source keep mode from index settings (#120678)
This patch adds a property to CountedKeywordMapper to track the
synthetic_source_keep index setting. This property is then used to properly
implement synthetic source support in the counted_keyword field type, with
fallback to the ignore_source mechanism when synthetic_source_keep is set
in either the field mapping or the index settings.
2025-01-23 15:32:51 -08:00
Stanislav Malyshev
f27f74666f
ES|QL async queries: Partial result on demand (#118122)
Add capability to stop async query on demand
The theory:

- User initiates async search request
- User sends the stop request (POST _query/async/<ID>/stop)
- If the async is finished by that time, it's like regular async get
- If it's not finished, the sinks are closed and the request is forcefully finished
2025-01-23 10:21:52 -07:00
Ignacio Vera
9a9bc69883
Stop caching source map on SearchHit#getSourceMap (#119888)
This call has the side effect that if you are iterating a number of hits calling this method, you will be increasing the 
memory usage by a non trivial number which in most of cases is unwanted. Therefore this commit removes this caching
all together and add an assertion so the method is call once during the lifetime of the object.
2025-01-23 17:28:52 +01:00
Simon Cooper
787a16d0d5
Update the index version compatible test to only check the minimum (#120406) 2025-01-23 15:59:19 +00:00
Niels Bauman
682cf0a18f Merge remote-tracking branch 'public/main' into merge-main 2025-01-23 13:27:52 +10:00
Nik Everett
8ab75b35af
ESQL: Bump memory usage on heap attack test (#120620)
This particular test expects circuit breaker to trigger when an
operation uses too much memory. But it isn't using too much memory in a
few builds. This bumps it to use more memory so it will fail as
expected.

Closes #120587
2025-01-23 10:19:06 +11:00
Niels Bauman
82d15a3de0 Clean up active project instead of deleting (MP-1922)
Instead of deleting and recreating projects after every YAML
multi-project test, we should create the projects once at the start of
the test suite and clean up the active project after every test.
2025-01-23 09:10:14 +10:00
Oleksandr Kolomiiets
e7a9690186
Don't generate mappings that copy_to into itself (#119997) 2025-01-22 11:27:14 -08:00
Nik Everett
fd864de50e
ESQL: Unit tests for LOOKUP (#120559)
This adds a unit test for LOOKUP that's going to be quite good at
finding leaks.
2025-01-22 14:50:45 +00:00
Simon Cooper
e6a3aff093 Merge commit '13c75c02f0' into merge-main-22-01-25T12 2025-01-22 12:09:34 +00:00
Nik Everett
03cb3853a9
ESQL: Heap attack tests (#120313)
* ESQL: Heap attack tests

Adds tests for requests that would fill up the heap and crash
elasticsearch but for our circuit breakers. In an ideal world we'd
stream these results back to and this wouldn't crash anything. But we
don't have that at the moment.

* Better date

* Update
2025-01-21 07:42:22 -05:00
David Turner
49f27e39ea
Migrate discovery-ec2 QA tests to javaRestTest (#119384)
No need for all this Gradle magic any more, we can just test the
discovery behaviour directly using Java REST tests.
2025-01-21 21:20:19 +11:00
Niels Bauman
6c7d2d285b Merge main into multi-project 2025-01-21 11:04:37 +10:00
Nick Tindall
c02292f82b
Retry internally when CAS upload is throttled [GCS] (#120250)
Fixes #116546
2025-01-20 12:28:34 +11:00
Yang Wang
7a1f5c5d4f Merge main into multi-project 2025-01-20 11:17:40 +11:00
Mark Vieira
1ba5d259e7
Allow overriding of module metadata files in integration tests (#120427) 2025-01-18 03:29:57 +00:00
Tim Vernum
552cec7ff0 Merge revision 34059c9dbd into multi-project 2025-01-17 16:32:15 +11:00
Patrick Doyle
34059c9dbd
Limit ByteSizeUnit to 2 decimals (#120142)
* Exhaustive testParseFractionalNumber

* Refactor: encapsulate ByteSizeUnit constructor

* Refactor: store size in bytes

* Support up to 2 decimals in parsed ByteSizeValue

* Fix test for rounding up with no warnings

* ByteSizeUnit transport changes

* Update docs/changelog/120142.yaml

* Changelog details and impact

* Fix change log breaking.area

* Address PR comments
2025-01-16 19:30:23 +00:00
Mark Vieira
806069b544
Allow overriding of plugin metadata files in integration tests (#120245) 2025-01-16 07:50:39 -08:00
Simon Cooper
be049bb698
Remove most references to 7.9 and 7.10 transport versions (#118784) 2025-01-16 14:55:30 +00:00
Yang Wang
7f3e7773d6
[Test] Fix testcontainers wait for Minio (#120175)
This PR changes the wait strategy from the default HostPortWaitStrategy
to LogMessageWaitStrategy to accommodate the change in the latest Minio
docker image.

The default HostPortWaitStrategy has two issues: 1. It assumes certain
Linux commands such as grep and nc available    inside the container.
This is not the case for the latest version of    Minio docker image
which does not have either of the commands. 2. The first item on their
own is not fatal since the check also falls    back on just reading the
listening port as a file with    `/bin/bash -c
'</dev/tcp/localhost/9000'`. However, the command    stirng is build
using the system's current locale which may not be    Engilsh and can
have different symbols for print integers like 9000.    This completely
breaks the command and in turn leads to total failure    of the wait
check.

There is no easy fix for the above issues nor do I think it is necessary
to fix. So the PR simply switches the wait strategy to be log message
based.

Resolves: #120101 Resolves: #120115 Resolves: #120117 Resolves: #118548
2025-01-16 22:01:14 +11:00
Simon Cooper
5a70623d8d Merge remote-tracking branch 'upstream-main/main' into merge-main-16-01-25 2025-01-16 09:23:46 +00:00
Niels Bauman
9f597a4eb5
Remove trappy timeouts from GetIndexRequest (#120037)
Relates #107984
2025-01-16 16:05:36 +10:00
Joe Gallo
24ceec13e2
Rename test utility methods (#120213) 2025-01-15 13:49:40 -05:00
David Turner
679ae619b5
Remove unused Transport#version field (#120202) 2025-01-16 03:41:50 +11:00
Jim Ferenczi
4b1656d9f7
Rebuild Inference Metadata Fields During Snapshot Recovery (#120045)
This PR introduces support for reconstructing inference metadata fields that are removed from `_source` by `SourceFieldMapper#applyFilters` during operations recovery.
The inference metadata fields are retrieved using value fetchers and are re-added to `_source` under the `_inference_fields` metadata field.
2025-01-15 14:50:57 +00:00
Simon Cooper
a2d84b1b90
Remove assumed features in server for 9.0 (#119946)
All features added before 8.18 can now be assumed and removed in 9.0
2025-01-15 08:37:04 +00:00
Salvatore Campagna
fc8e2fcc22
Move source mode setting from SourceFieldMapper to IndexSettings (#120096)
Here we move the `index.mapping.source.mode` setting to `IndexSettings` because of dependencies
and because of the initialisation order of static fields for classes `IndexSettings` and `SourceFieldMapper`.
Not initialising settings `index.mode`, `index.mapping.source.mode`, and `index.recovery.use_synthetic_source`
in the right order results in multiple `NullPointerException`.

This work is done to simplify another PR #119110
2025-01-14 15:07:48 +01:00
Yang Wang
60a54e6ab7
[Test] Upgrade minio docker image used for tests (#120086)
This PR upgrades the minio docker image from
RELEASE.2021-03-01T04-20-55Z which is 3+ years old to the latest
RELEASE.2024-12-18T13-15-44Z.

Relates: #118548
2025-01-14 21:38:09 +11:00
Nik Everett
c990377c95
ESQL: Limit memory usage of fold (#118602)
`fold` can be surprisingly heavy! The maximally efficient/paranoid thing
would be to fold each expression one time, in the constant folding rule,
and then store the result as a `Literal`. But this PR doesn't do that
because it's a big change. Instead, it creates the infrastructure for
tracking memory usage for folding as plugs it into as many places as
possible. That's not perfect, but it's better.

This infrastructure limit the allocations of fold similar to the
`CircuitBreaker` infrastructure we use for values, but it's different
in a critical way: you don't manually free any of the values. This is
important because the plan itself isn't `Releasable`, which is required
when using a real CircuitBreaker. We could have tried to make the plan
releasable, but that'd be a huge change.

Right now there's a single limit of 5% of heap per query. We create the
limit at the start of query planning and use it throughout planning.

There are about 40 places that don't yet use it. We should get them
plugged in as quick as we can manage. After that, we should look to the
maximally efficient/paranoid thing that I mentioned about waiting for
constant folding. That's an even bigger change, one I'm not equipped
to make on my own.
2025-01-13 15:04:27 +00:00
Simon Cooper
415a5e67d2 Merge main into multi-project 2025-01-13 06:20:35 +00:00
Tim Vernum
f76be23dfd Make cluster stats operate over all projects (MP-1892)
This updates the cluster stats action to take all projects into account
when calculating the statistics. This is true even if a specific project
is requested.

The only exception is the "health status" because we only have
primitives for calculating the health of a single project. The stats
response will always give the health of the targeted project.
2025-01-13 16:22:50 +11:00