Commit Graph

87582 Commits

Author SHA1 Message Date
Yang Wang 74fd66c1f1
Drain responses on completion for TransportNodesAction (#130303)
This PR ensures the node responses are copied and drained exclusively in
onCompletion so that they do not get concurrently modified by
cancellation.

Resolves: #128852
2025-07-03 10:25:35 +10:00
Yang Wang c17bfcbfc2
Migrate the reserved repository action to be per-project (#130155)
Resolves: ES-10479
2025-07-03 10:25:27 +10:00
Oleksandr Kolomiiets f3c5eb7815
Delete unowned documents during split (#130240) 2025-07-02 16:20:10 -07:00
Ryan Ernst 9e6464eeae
Test for duplicate transport versions (#130494)
We used to have an assertion during transport version loading that
duplicate ids were not found, but it appears to have been lost in
refactorings. This commit adds a test to ensure duplicate ids do not
occur.

relates #130486
2025-07-03 08:44:56 +10:00
elasticsearchmachine 9b8c0d3aff Mute org.elasticsearch.xpack.logsdb.LogsdbTestSuiteIT test {yaml=/52_esql_insist_operator_synthetic_source/FROM with INSIST_🐔} #130507 2025-07-03 08:34:51 +10:00
elasticsearchmachine c02116dd09 Mute org.elasticsearch.xpack.logsdb.LogsdbTestSuiteIT test {yaml=/52_esql_insist_operator_synthetic_source/FROM with INSIST_🐔and LIMIT 1} #130506 2025-07-03 08:34:43 +10:00
elasticsearchmachine 6ec8da777c Mute org.elasticsearch.xpack.esql.action.EsqlActionBreakerIT testTopNPushedToLucene #130505 2025-07-03 08:06:51 +10:00
elasticsearchmachine 542b51f6b7 Mute org.elasticsearch.xpack.esql.action.EsqlActionBreakerIT testProjectWhere #130504 2025-07-03 08:06:43 +10:00
elasticsearchmachine ddc1df5b02 Mute org.elasticsearch.index.codec.vectors.cluster.HierarchicalKMeansTests testHKmeans #130497 2025-07-03 07:33:38 +10:00
Larisa Motova e149db0eec
[ES|QL] Support avg on aggregate metric double (#130421)
Other major aggregations (min, max, sum, count) are available but avg was not.
This commit adds it in.
2025-07-02 11:11:36 -10:00
Evgenii-Kazannik 5d0c5e02bd
Add Ibm Granite Completion and Chat Completion support (#129146)
* Add Ibm Granite Completion and Chat Completion support

* Apply suggestions

* remove ibm watsonx transport version constant

* update transport version
2025-07-02 16:57:16 -04:00
Mark Tozzi 82b6e45a81
fix transport version conflict (#130486)
#129649 introduced a duplicate transport version. This fixes it.
2025-07-02 15:05:28 -04:00
Jordan Powers a6c4c08527
Fix index version check in match_only_text (#130415)
Accidentally used the wrong backport index version in #130363.
2025-07-03 04:18:07 +10:00
Pooya Salehi 54c9db9a41
Record project deletions in ProjectStateRegistry (#130225)
Project deletions is used to update the Stateless lease blob, as a project deletion 
is a notable event that that our stateless cluster consistency check should consider 
before acknowledging writes. 

Relates ES-11207
2025-07-03 04:08:56 +10:00
Patrick Doyle 89f701f4c4
Bootstrap entitlements for testing (#129268)
* Fix ExceptionSerializationTests to use getCodeSource instead of getResource.

Using getResource makes this sensitive to unrelated classpath entries,
such as the entitlement bridge library, that get prepended to the classpath.

* FIx logging tests to use org.elasticsearch.index instead of root logger.

Using the root logger makes this sensitive to unrelated
logging, such as from the entitlement library.

* Fix entitlement error message by stashing the module name in ModuleEntitlements.

Taking the actual module name from the class doesn't work in tests,
where those classes are loaded from the classpath and so their module
info is misleading.

* Ignore server locations whose representative class isn't loaded

* Partial initial implementation

* System properties: testOnlyClasspath and enableForTests

* Trivially allow some packages

* DEBUG: use TreeMap in TestScopeResolver for readability

* Special case bouncycastle for security plugin

* Add CONFIG to TestPathLookup

* Add the classpath to the source path list for every plugin

* Add @WithoutEntitlements to tests that run ES nodes

* Set es.entitlement.enableForTests for all libs

* Use @WithoutEntitlements on ingest plugin tests

* Substitute ALL-UNNAMED for module name in non-modular plugins

* Add missing entitlements found by unit tests

* Comment in TestScopeResolver

* Properly compute bridge jar location for patch-module

* Call out nonServerLibs

* Don't build two TestPathLookups

* More comments for meta-tests

* Remove redundant dependencies for bridgeJarConfig.

These are alread set in ElasticsearchJavaBasePlugin.

* Add bridge+agent dependencies only if those exist.

For serverless, those project dependencies don't exist, and we'll need
to add the dependencies differently, using Maven coordinates.

* [CI] Auto commit changes from spotless

* Pass testOnlyPath in environment instead of command line.

It's typically a very very long string, which made Windows angry.

* [CI] Auto commit changes from spotless

* Split testOnlyPathString at File.pathSeparator

* Use doFirst to delay setting testOnlyPath env var

* Trivially allow jimfs (??)

* Don't enforce entitlements on internalClusterTest for now

* Replace forbidden APIs

* Match testOnlyClasspath using URI instead of String.

We already get the "needle" in the form of a URI, so this skips
a step, and has the benefit of also working on Windows.

* [CI] Auto commit changes from spotless

* More forbidden APIs

* Disable configuration cache for LegacyYamlRestTestPluginFuncTest

* Strip carriage-return characters in expected output for ReleaseNotesGeneratorTest.

The template generator also strips these, so we need to do so to make this pass
on Windows.

Note that we use replace("\r", "") where the template generator uses
replace("\\r", ""). The latter didn't work for me when I tried it on Windows,
for reasons I'm not aware of.

* Move configureEntitlements to ElasticsearchTestBasePlugin as-is

* Use matching instead of if

* Remove requireNonNull

* Remove default configuration

* Set inputs instead of dependencies

* Use test.systemProperty

* Respond to PR comments

* Disable entitlement enforcement for ScopedSettingsTests.

This test works by altering the logging on the root logger.
With entitlements enabled, that will cause additional log statements to appear,
which interferes with the test.

* Address PR comments

* Moritz's configureJavaBaseModuleOptions

* Allow for entitlements not yet enforced in serverless

* fix entitlementBridge config after rename

* drop empty file collections

* Remove workaround in LegacyYamlRestTestPluginFuncTest

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Co-authored-by: Lorenzo Dematté <lorenzo.dematte@elastic.co>
Co-authored-by: Moritz Mack <mmack@apache.org>
2025-07-02 13:44:38 -04:00
Ioana Tagirta fc59cd7918
ES|QL: Add FUSE as a temporary copy of RRF (#130434) 2025-07-02 19:39:07 +02:00
Fang Xing c43a51d842
[ESQL] Ensure date/date_nanos implicit casting rule behind snapshot (#130026)
* put date date_nanos implicit casting rule behind snapshot
2025-07-02 13:14:19 -04:00
Mark Tozzi a7a79f7612
ESQL - transport version change to support TSDB metadata (#129649)
Relates to #128621

This is a first step in making the ES|QL query planner aware of TSDB Dimensions and Metric field metadata. This is purposefully small to only touch the serialization change we'll need for this. The plan is get the TSDB metadata field type out of Field Caps and to store this information on EsField. This PR adds a place to store such a field, and adds it to the serialization for EsField and its sub-classes.

As of this PR, we don't do anything with this data. That's intentional, to minimize the footprint of the transport version change. Further PRs in this project will load and act on this data. I've added some constructors here to minimize the number of files I'm touching in this PR. I hope that as we begin loading this data (as opposed to just defaulting it right now) we can get rid of some of these default value constructors.
2025-07-02 12:58:51 -04:00
Dan Rubinstein 136442d83c
Allow timeout during trained model download process (#129003)
* Allow timeout during trained model download process

* Update docs/changelog/129003.yaml

* Update timeout message

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-07-02 12:40:52 -04:00
Albert Zaharovits 72b5c0175a
assertTrue for submitMergeTask (#130430)
Previously, out of zealousness for testing efficiency, the mocked
filesystems were reused across the test suite class. But this makes
tests liable to interference wrt to filesystem stats calls. Moreover, if
one test fails, it can trigger failures in other test methods.

This PR recreates the mocked filesystems for every test method. 

Fixes #129296 #130205
2025-07-03 02:17:01 +10:00
Parker Timmins b38d5454ad
Add pattern_text feature flag to logsdb yaml tests (#130399)
Patterned text yaml tests in logsdb plugin are failing as they assume the presence of the pattern_text type. Enable the feature flag for the tests.
2025-07-02 10:55:22 -05:00
Mridula 73d6063c3b
Fixed RRF YAML REST Test: `rrf with pinned retriever as a sub-retriever` (#130402)
* fixed failing pinned retriever test

* Update docs/changelog/130402.yaml

* Delete docs/changelog/130402.yaml

* Worked on the PR comments

* Fixed the Match_none

* space format

* space format
2025-07-03 01:47:38 +10:00
Nikolaj Volgushev 7ed57c4996
Unmute testRolesCacheIsClearedWhenPrivilegesIsChanged (#130329)
This test used to fail a long time ago and got muted. Unmuting it for
some CI time.

Closes: https://github.com/elastic/elasticsearch/issues/93447
2025-07-03 01:27:29 +10:00
elasticsearchmachine 379a5395c3 Mute org.elasticsearch.test.rest.yaml.RcsCcsCommonYamlTestSuiteIT test {p0=msearch/20_typed_keys/Multisearch test with typed_keys parameter for sampler and significant terms} #130472 2025-07-03 00:48:20 +10:00
Albert Zaharovits a8b22df672
[DOCS] Disk space aware threadpool merge scheduler (#130465)
This documents the new threadpool-based merge scheduler, which is disk
space aware, and blocks merges when disk space is low. The code changes
were mostly introduced in
https://github.com/elastic/elasticsearch/pull/120869 and
https://github.com/elastic/elasticsearch/pull/127613 .
2025-07-03 00:41:28 +10:00
Carlos Delgado 315aba696a
ESQL - Add K mandatory param for KNN function (#129763) 2025-07-03 00:06:37 +10:00
Benjamin Trent a9625cec7a
Reduce final clustering pass sample size (#130451)
Figuring out the right balance on index throughput and speed is tricky.
Initially I was digging into reducing the "neighborhood" size for the
fix up. This actually harmed recall a bit too much in my tests, while it
did speed things up. While I do think there is ground to be covered
there, I pivoted to reducing the sample size since now we actually have
true random sampling (instead of the first N docs).

In the extreme case, this improves force-merge time by 25% with zero
change in recall. On the lower end, it only improves about 8%.

I really do think there is ground to be recovered in the "fix up phase",
but this is a nice improvement :).

```
index_name                           index_type  num_docs  index_time(ms)  force_merge_time(ms)  num_segments
-----------------------------------  ----------  --------  --------------  --------------------  ------------
corpus-quora-E5-small.fvec.flat             ivf    500000           17443                 18422             0
cohere-wikipedia-docs-768d.vec              ivf   2000000          156320                193383             0
corpus-dbpedia-entity-arctic-0.fvec         ivf   1000000           92902                 82131             0

index_name                           index_type  n_probe  latency(ms)  net_cpu_time(ms)  avg_cpu_count      QPS  recall   visited
-----------------------------------  ----------  -------  -----------  ----------------  -------------  -------  ------  --------
corpus-quora-E5-small.fvec.flat             ivf       10         0.95              0.00           0.00  1052.63    0.83   5713.06
corpus-quora-E5-small.fvec.flat             ivf       20         0.69              0.00           0.00  1449.28    0.89  10620.80
corpus-quora-E5-small.fvec.flat             ivf       30         0.81              0.00           0.00  1234.57    0.92  15498.94
corpus-quora-E5-small.fvec.flat             ivf       40         0.94              0.00           0.00  1063.83    0.93  20088.68
corpus-quora-E5-small.fvec.flat             ivf       50         1.11              0.00           0.00   900.90    0.94  24801.41
cohere-wikipedia-docs-768d.vec              ivf       10         1.20              0.00           0.00   833.33    0.66   2824.19
cohere-wikipedia-docs-768d.vec              ivf       20         1.33              0.00           0.00   751.88    0.74   4875.23
cohere-wikipedia-docs-768d.vec              ivf       30         1.44              0.00           0.00   694.44    0.79   6974.69
cohere-wikipedia-docs-768d.vec              ivf       40         1.56              0.00           0.00   641.03    0.81   9147.20
cohere-wikipedia-docs-768d.vec              ivf       50         1.66              0.00           0.00   602.41    0.83  11478.62
cohere-wikipedia-docs-768d.vec              ivf       60         1.80              0.00           0.00   555.56    0.85  13863.93
cohere-wikipedia-docs-768d.vec              ivf       70         1.96              0.00           0.00   510.20    0.87  16301.12
cohere-wikipedia-docs-768d.vec              ivf       80         2.05              0.00           0.00   487.80    0.88  18761.24
cohere-wikipedia-docs-768d.vec              ivf       90         2.18              0.00           0.00   458.72    0.89  21185.38
cohere-wikipedia-docs-768d.vec              ivf      100         2.27              0.00           0.00   440.53    0.90  23648.77
corpus-dbpedia-entity-arctic-0.fvec         ivf       10         0.79              0.00           0.00  1265.82    0.52   3654.77
corpus-dbpedia-entity-arctic-0.fvec         ivf       20         0.97              0.00           0.00  1030.93    0.61   7170.57
corpus-dbpedia-entity-arctic-0.fvec         ivf       30         1.13              0.00           0.00   884.96    0.67  10761.73
corpus-dbpedia-entity-arctic-0.fvec         ivf       40         1.27              0.00           0.00   787.40    0.70  14550.00
corpus-dbpedia-entity-arctic-0.fvec         ivf       50         1.42              0.00           0.00   704.23    0.72  18149.22
corpus-dbpedia-entity-arctic-0.fvec         ivf       60         1.61              0.00           0.00   621.12    0.74  21971.72
corpus-dbpedia-entity-arctic-0.fvec         ivf       70         1.74              0.00           0.00   574.71    0.76  25612.96
corpus-dbpedia-entity-arctic-0.fvec         ivf       80         1.94              0.00           0.00   515.46    0.77  29311.67
corpus-dbpedia-entity-arctic-0.fvec         ivf       90         2.05              0.00           0.00   487.80    0.78  33034.66
corpus-dbpedia-entity-arctic-0.fvec         ivf      100         2.23              0.00           0.00   448.43    0.80  36743.77
```
2025-07-03 00:04:11 +10:00
Ignacio Vera f81d35536d
optimize OptimizedScalarQuantizer#scalarQuantize (#129874)
optimize OptimizedScalarQuantizer#scalarQuantize when destination can optimize 
OptimizedScalarQuantizer#scalarQuantize when destination can be an integer array
2025-07-02 14:57:59 +01:00
Quentin Pradet 24a5440851
rest-api-spec: fix esql.get_query accept header (#130377) 2025-07-02 17:03:09 +04:00
Laura Trotta 9f24b2ae3e
add missing format param (#130317)
Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
2025-07-02 16:55:16 +04:00
Edu González de la Herrán 3b8f5d3a57
[Docs] Includes information about available index settings in Serverless (#129704)
* index settings for serverless information added

* comment removed

* Apply suggestions from code review

Co-authored-by: shainaraskas <58563081+shainaraskas@users.noreply.github.com>

* serverless applies removed from coerce doc

* eck applies addded to config reference landing

* toc updated

* index settings landing page aligned with toc

* serverless doc intro updated

---------

Co-authored-by: shainaraskas <58563081+shainaraskas@users.noreply.github.com>
2025-07-02 14:40:32 +02:00
Rene Groeschke 50d047471b
[Build] Fix maven-aggregation generation for shadowed artifacts (#130412)
- Ensure we include sources and javadoc jar to maven publication
2025-07-02 12:36:34 +02:00
Dimitris Rempapis 8ffbf4a976
Throw a 400 when sorting for all types of range fields 2025-07-02 12:22:29 +03:00
Charlotte Hoblik c41922fefb
[DOCS]: Rename serach connectors to content connectors (#130309)
* Rename serach connectors to content connectors

* Adding support table to documentation

* replace 'search' to 'content'

* fix links
2025-07-02 10:40:37 +02:00
kosabogi 27ff25386c
Adds 'Update a document' API example page (#129840)
* Adds Update a document API example page

* Update docs/reference/elasticsearch/rest-apis/update-document.md

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>

* Adresses suggestions

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2025-07-02 10:18:48 +02:00
elasticsearchmachine 580831a6ba Mute org.elasticsearch.ingest.PipelineFactoryTests testCreateUnsupportedFieldAccessPattern #130422 2025-07-02 15:34:58 +10:00
Jordan Powers a69c48477f
Add index version for match_only_text stored field in binary format (#130363)
Follow-up to #130049 to gate using the binary format for the stored field
in match_only_text fields behind an index version.
2025-07-01 18:19:18 -07:00
Mark Vieira 7d4ba31681
Document logs essentials restricted ESQL commands for Kibana (#130346) 2025-07-01 16:29:01 -07:00
Larisa Motova 8b6acd06f4
[ES|QL] Fix suggested_cast yaml test (#130404)
The wrong capability name was being used in this yaml test
causing it to be skipped. This commit fixes that.
2025-07-01 12:24:27 -10:00
Ryan Ernst 4b7de2fa30
Add http-only headers to ElasticsearchException (#130348)
When return an error from Elasticsearch exceptions may contain values
written as http response headers. ElasticsearchException contains a map
of headers that are added to the response. But these values are also
written to a special "header" section of the response body.

This commit renames the existing "headers" in ElasticsearchException to
"body headers", which are both http headers and written to the response
body. A new "http headers" is added for headers that should only be
written as response headers.
2025-07-01 15:03:08 -07:00
Benjamin Trent a6dfe64652
Fix sampling for kmeans and address assignment edge case (#130405)
This is three fixes:

 - We should be doing actual sampling when doing kmeans clustering, taking the first N vectors creates some weird edge cases
 - Having assignments initialized as `0` means that if a vector gets assigned to cluster ord `0`, that cluster centroid actually isn't updated later in the lloyd steps. So, this initializes assignments to -1
 - If we actually don't sample the vectors for lloyd, don't bother with final pass to potentially update the centroids
2025-07-02 06:54:46 +10:00
Benjamin Trent 044f34bf3e
Refactor bulk quantization writing into a unified class (#130354)
this is a small refactor, laying ground work for more generalized bulk
writing.

I did some benchmarking and there was no significant performance
difference (as expected).
2025-07-02 06:53:45 +10:00
Benjamin Trent c1a4f8ae68
Fix multi-indexing runs for checkVec (#130408)
We now can do multiple query time parameters, but this sort of broke
running multiple indexing loads. 

This corrects multiple indexing & search tests for the KnnIndexTester:

Example output.

```
index_name                           index_type  num_docs  index_time(ms)  force_merge_time(ms)  num_segments
-----------------------------------  ----------  --------  --------------  --------------------  ------------
corpus-quora-E5-small.fvec.flat             ivf    100000            4386                  4522             0
cohere-wikipedia-docs-768d.vec              ivf    100000            7784                  8331             0
corpus-dbpedia-entity-arctic-0.fvec         ivf    100000            7513                  8969             0

index_name                           index_type  n_probe  latency(ms)  net_cpu_time(ms)  avg_cpu_count      QPS  recall   visited
-----------------------------------  ----------  -------  -----------  ----------------  -------------  -------  ------  --------
corpus-quora-E5-small.fvec.flat             ivf       10         0.87              0.00           0.00  1149.43    0.88   5511.60
corpus-quora-E5-small.fvec.flat             ivf       20         0.73              0.00           0.00  1369.86    0.94  10101.70
corpus-quora-E5-small.fvec.flat             ivf       30         0.76              0.00           0.00  1315.79    0.95  14382.15
corpus-quora-E5-small.fvec.flat             ivf       40         0.84              0.00           0.00  1190.48    0.96  18554.68
corpus-quora-E5-small.fvec.flat             ivf       50         0.99              0.00           0.00  1010.10    0.97  22609.69
cohere-wikipedia-docs-768d.vec              ivf       10         0.39              0.00           0.00  2564.10    0.61   2567.00
cohere-wikipedia-docs-768d.vec              ivf       20         0.53              0.00           0.00  1886.79    0.78   5017.25
cohere-wikipedia-docs-768d.vec              ivf       30         0.66              0.00           0.00  1515.15    0.84   7486.77
cohere-wikipedia-docs-768d.vec              ivf       40         0.80              0.00           0.00  1250.00    0.88  10177.80
cohere-wikipedia-docs-768d.vec              ivf       50         0.95              0.00           0.00  1052.63    0.90  12744.67
corpus-dbpedia-entity-arctic-0.fvec         ivf       10         0.48              0.00           0.00  2083.33    0.62   3302.07
corpus-dbpedia-entity-arctic-0.fvec         ivf       20         0.66              0.00           0.00  1515.15    0.74   6333.91
corpus-dbpedia-entity-arctic-0.fvec         ivf       30         0.78              0.00           0.00  1282.05    0.81   9545.16
corpus-dbpedia-entity-arctic-0.fvec         ivf       40         0.93              0.00           0.00  1075.27    0.85  12786.62
corpus-dbpedia-entity-arctic-0.fvec         ivf       50         1.08              0.00           0.00   925.93    0.87  15749.40
```
2025-07-02 05:58:32 +10:00
James Baiera 2144baeb8c
[Streams] Add new ingest pipeline field access flag (#129096)
This PR introduces a new flag to ingest pipeline configurations which will be used to control how 
fields are accessed from within that pipeline.
2025-07-01 15:50:53 -04:00
Parker Timmins 3a69d45892
Add test for matching middle key bug (#130396)
There was a bug in previous version where flattened fields would produce incorrect synthetic source with too few opening braces. This bug was fixed as a side effect of #129600. Adding this test to confirm. See #129600 for a full explanation.
2025-07-01 14:24:48 -05:00
Graeme Mjehovich 416405877f
Add age_in_millis to ILM Explain Response (#128866)
* Add age_in_millis to ILM Explain Response

* Fix: Declare age_in_millis in ILM Explain Response Parser

* Add unit tests for age_in_millis field in IndexLifecycleExplainResponse

* Update docs/changelog/128866.yaml

* Update docs/changelog/128866.yaml

* Update IndexLifecycleExplainResponse.java

Fix comments; follow DRY for getAge(nowSupplier) call in IndexLifecycleExplainResponse

---------

Co-authored-by: Joe Gallo <joe.gallo@elastic.co>
2025-07-01 13:42:38 -04:00
Keith Massey ae450dad20
Correctly handling data stream settings when component templates are used (#130394) 2025-07-01 12:40:37 -05:00
Liam Thompson 137eac554f
[DOCS] Update esql docs readme with 9.x+ version differentiation guidance (#130340) 2025-07-01 18:15:57 +02:00
Niels Bauman 2404dac592
Make deprecation plugin project-aware (#130364)
Updates the majority of the plugin to be aware of multiple projects.

The deprecation plugin is excluded in serverless, so in
`DeprecationIndexingComponent` we hard-code the default project ID to
avoid an unworthy investment of namespacing effort.
2025-07-01 12:08:48 -03:00
Ankit Sethi 6520fa2b7c
Add cloud API keys to auth info report (#130041)
* add change and test

* improve test
2025-07-01 09:45:54 -05:00