Commit graph

802 commits

Author SHA1 Message Date
Ryan Ernst
991e80d56e
Remove unnecessary generic params from action classes (#126364)
Transport actions have associated request and response classes. However,
the base type restrictions are not necessary to duplicate when creating
a map of transport actions. Relatedly, the ActionHandler class doesn't
actually need strongly typed action type and classes since they are lost
when shoved into the node client map. This commit removes these type
restrictions and generic parameters.
2025-04-07 16:22:56 -07:00
Armin Braun
29ac2611fe
Make some constant SubscribableListener instances cheaper (#124452)
We can just use a real constant for the `null` case, avoiding any
non-plain stores in all cases. This should be somewhat helpful for the
security interceptors.
2025-03-09 22:32:00 +01:00
Yang Wang
88b5900837
Require project-id for waitForPersistentTasksCondition (#124180)
The method should be called with an explicit project-id to access
persistent tasks from the right project. This PR does that. The
callsites are updated by using the default project-id for the timebeing.
They work for single project deployments but should eventually be
updated for multi-project setup.

Relates: ES-11039
2025-03-07 14:00:09 +11:00
Gal Lalouche
a6e47ae85b
Refactor FieldCapabilities creation by adding a proper builder object (#121310)
Reduce boilerplate associated with creating `FieldCapabilities` instances.
Since it's a class with a huge number of fields, it makes sense to define a builder object, as that can also help with all the Boolean and null blindness going on.
Note while there is a static Builder class in `FieldCapabilities`, it is not a proper builder object (no setters, still need to pass a lot of otherwise default parameters) and also package-private. To avoid changing that, I defined a new `FieldCapabilitiesBuilder` class. I also went over the code and refactored places which used the old constructor.
2025-03-05 13:09:36 +01:00
David Turner
77a3d30d26
Remove trappy timeouts from IndicesAliasesRequest (#123987)
Relates #107984
2025-03-05 02:11:50 +11:00
Niels Bauman
afff39ed5c
Run XPack usage actions on local node (#122933)
These actions solely need the cluster state, they can run on any node.

Relates #101805
2025-03-03 13:37:27 +01:00
Yang Wang
cea5adcb49
Add null check in more places for persistent tasks (#123566)
There is no guarantee that a project has non-null persistent tasks [0].
Null check is already done in most places. This PR adds it in a few more
places.

[0] Since health-node is now a cluster-scoped persistent task, it has
become more likely for the project-scoped tasks to be null.

Relates: #123262
2025-02-27 15:10:30 +11:00
Yang Wang
b882c079f6 Make persistent task framework project aware (MP-1955)
This PR is the follow-up work for MP-1945 and MP-1938 which laid the
foundation of two different scoped persistent tasks. It updates the
persistent task framework to be aware of the two task types so that it
can handle both cluster scope tasks and per-project tasks. Once these
changes are in place, we will make health-node to be the first
cluster-scope persistent task.

Relates: ES-10168
2025-02-26 13:45:09 +11:00
Tim Vernum
77bf65d9af Merge main into multi-project 2025-02-25 10:33:53 +11:00
David Turner
d007dae1ad
Remove redundant IndexNameExpressionResolver params (#123258)
Follow-up to #120531 to remove all the now-redundant constructor
parameters.
2025-02-25 04:08:31 +11:00
Tim Vernum
fd9f8e1b08 Merge main into multi-project 2025-02-22 16:42:59 +11:00
Simon Cooper
274be7997a
Create a SearchResponseBuilder for creating SearchResponses in tests (#122196)
As well as simplifying test code, this also highlights which settings in the response are actually needed for individual tests
2025-02-21 12:00:17 +00:00
Tim Vernum
680e7a6979 Merge revision 5c00341c2b into multi-project 2025-02-14 17:17:41 +11:00
Yang Wang
71e45ae138
Make persistent task name and ID available in update source (#122334)
Add the task name (when possible) and ID as part of the source string
for updating cluster state. This helps better identifying the source of
a task. The updatePersistentTaskState method already does it. This PR
ensures it is the case in other places.
2025-02-13 14:45:23 +11:00
Pat Whelan
99c5398137
[Transform] Delete Alias Write Index (#122074)
When the Transform is configured to write to an alias, specifying
`DELETE _transform/<id>?delete_dest_index` will follow the alias
to the concrete destination index.

Fix #121913

Co-authored-by: Przemysław Witek <przemyslaw.witek@elastic.co>
2025-02-12 16:24:07 +01:00
Pat Whelan
39da0749b0
[Transform] Reset plugin after tests (#122252)
There is a race condition where the test is trying to clean up while the
Transform auditor is still writing messages - resetting the plugin will
stop the auditor (and properly reset it).

Fix #12148
2025-02-12 16:16:16 +01:00
Yang Wang
04d459009b Merge main into multi-project 2025-02-12 09:57:09 +11:00
Pat Whelan
5d5741d874
[Transform] Recreate Notifications Index (#121912)
If the notification index and alias gets deleted, recreate the index.

Fix #121909
2025-02-06 14:27:32 -05:00
Niels Bauman
7b430dd050 Make system index cleanup project-aware 2025-02-04 13:32:21 +10:00
Niels Bauman
621a18d947 Merge main into multi-project 2025-01-30 17:26:28 +10:00
David Kyle
a52c26a6b4
[ML] Change the auditor to write via an alias (#120064)
Changes the ml and transform auditor classes to write through an alias. 
The alias is required to rollover the index which required for upgrades
2025-01-29 17:20:50 +01:00
Pat Whelan
9009606a47
[Transform] add support for extended_stats (#120340)
Building off of `stats` and multi-value aggregations, including the
limitation:
- all values of extended_stats will be mapped to `double` if mapping
  deduction is used

Relates #51925
2025-01-29 15:33:16 +01:00
Francisco Fernández Castaño
7d9a8455d6
Remove unused parameter from IndexRoutingTable#readyForSearch (#121152) 2025-01-29 14:23:35 +01:00
Niels Bauman
6495dcbb40 Merge main into multi-project 2025-01-24 15:48:39 +10: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
David Turner
a1fd7bc374
Fix trappy timeouts in persistent tasks requests (#120514)
Ensure that callers constructing these master-node requests pass in an
explicit timeout.

Relates #107984
2025-01-23 20:35:45 +11:00
Niels Bauman
682cf0a18f Merge remote-tracking branch 'public/main' into merge-main 2025-01-23 13:27:52 +10:00
Pat Whelan
b75a2c7e83
[Transform] Use seqno when migrating max_page_search_size (#120639)
Refetch TransformConfig with SeqNo before migrating
max_page_search_size, then include the SeqNo in the index request to
ensure we are not overwriting a user's intentional config change.  If we
are, just drop the migration and try again next time.
2025-01-22 22:33:57 +00:00
Simon Cooper
569c1fc1cd Merge remote-tracking branch 'upstream-main/main' into merge-main-22-01-25T12 2025-01-22 12:22:36 +00:00
Simon Cooper
39601ed683
Remove IndexNameExpressionResolver from base classes that don't use it (#120531) 2025-01-22 10:17:07 +00:00
Niels Bauman
b1a3e9c5a3 Make ML feature reset work on default project only (MP-1873)
Updates various places - mostly related to ML - to make the `POST
_features/_reset` API not fail when there are multiple projects.
This does not actually make those places project-aware,
but since nothing ML-related has been made project-aware,
this is the best way forward for now to make IT cleanup project aware.
2025-01-20 09:55:08 +10:00
Tim Vernum
18528dde76 Merge main into multi-project 2025-01-17 16:32:24 +11:00
Pat Whelan
0971f43e64
[Transform] Unblock after update (#120144)
If an update changes the destination index, optimistically assume the
new destination index does not have a write block and try to run the
transform.  If the new destination index has a write block, the
transform will drop the run and move back into a blocked state.

Fix #120065
2025-01-16 20:31:15 +00: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
Tim Vernum
280fcb1a57 Merge main into multi-project 2025-01-09 19:39:24 +11:00
Pat Whelan
b367f70f61
[Transform] Wait while index is blocked (#119542)
When the destination index is blocked, the bulk request is ignored.
Each subsequent trigger will check the cluster state if the index is
unblocked or else drop the trigger.

Users can call the ScheduleNow API to skip the index block check and let
the trigger start the next checkpoint - if the index is blocked then the
bulk request will fail again.

While the Transform is skipping triggers, the state will display as
`waiting` from the Get Stats API and on the Transform UI in Kibana.
2025-01-08 21:42:00 +00:00
Tim Vernum
93100ddfa7 Merge revision 393ea618d7 into multi-project 2025-01-08 12:42:57 +11:00
Pat Whelan
7262fb3417
[Transform] Auto-migrate max_page_search_size (#119348)
`max_page_search_size` had been deprecated in Pivot and migrated to
Settings in ES 7.x.  We are removing the key in Pivot in 9.x.  It is
still possible to create Pivots with `max_page_search_size`, though a
deprecation is logged.  To prep for its removal, this change
automatically migrates `max_page_search_size` from Pivot to Settings as
if the user called `_update`.

- `PUT _transform` with `max_page_search_size` in Pivot will migrate the
  value to Settings as part of the Transform's creation.  The user will
  receive an additional deprecation warning informing of this migration.
- Existing transforms with `max_page_search_size` in Pivot will migrate
  the value to Settings as part of node assignment during start.
  Transform Messages and Elasticsearch logs will record this event so
  users will know what happened.
2025-01-07 18:18:07 +00:00
Ignacio Vera
8612080a42
Don't use #getSourceAsMap when reading TopHits in transform (#119623)
Using this method will cache the generated object which can increase the memory usage for quite a bit.
2025-01-07 15:21:18 +01:00
Tim Vernum
4ff691f066 Merge revision 7fb6ca447a into multi-project 2024-12-31 15:41:02 +11:00
Ryan Ernst
7fb6ca447a
Add ephemeral node id to shutdown metadata (#118722)
Shutdown metadata is keyed on node id. This makes sense since only one
node with a given node id can exist within a cluster. However, it is
possible that shutdown was initiated for one instance of a node, but
that node is restarted. This commit adds the ephemeral node id to
shutdown metadata so that nodes with the same id but different ephemeral
id can be distinguished.
2024-12-30 10:13:58 -08:00
Pat Whelan
e1a954a512
[Transform] Create upgrade mode (#117858)
Prevent writes to the Transform system index while it is being reindexed
during upgrade.

- Add a new REST API, `_transform/set_upgrade_mode`, similar to `_ml`,
  which will enable via `?enabled` or disable (when omitted).
- Add a new Transport action, enabling or disabling upgrade mode.  When
  enabled, all Transforms will abort and move into the `waiting` state,
  preventing Transforms from running and writing to the system index.
- Hook into the System Index upgrade action, calling the new Transform
  action to set and unset upgrade mode.

Co-authored-by: David Kyle <david.kyle@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-30 09:42:15 -05:00
Rene Groeschke
ba61f8c7f7
Update Gradle wrapper to 8.12 (#118683)
This updates the gradle wrapper to 8.12

We addressed deprecation warnings due to the update that includes:

- Fix change in TestOutputEvent api
- Fix deprecation in groovy syntax
- Use latest ospackage plugin containing our fix
- Remove project usages at execution time
- Fix deprecated project references in repository-old-versions
2024-12-30 15:34:24 +01:00
Yang Wang
fda1fa19d4 Merge main into multi-project 2024-12-13 12:15:25 +11:00
Dan Rubinstein
78488c70f4
Retry on ClusterBlockException on transform destination index (#118194)
* Retry on ClusterBlockException on transform destination index

* Update docs/changelog/118194.yaml

* Cleaning up tests

* Fixing tests

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-12 10:38:03 -05:00
Tim Vernum
e5a0739005 Merge main into multi-project 2024-12-12 17:23:24 +11:00
Dan Rubinstein
d839205135
Removing index alias creation for deprecated transforms notification index (#117583)
* Removing index alias creation for deprecated transforms notification index

* Update docs/changelog/117583.yaml

* Updating changelog

* Updating deprecation area to Transform

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-11 10:47:46 -05:00
Niels Bauman
ffe911bd3c Merge main into multi-project 2024-12-05 13:25:44 +01:00
Armin Braun
eb0020f055
Introduce more parallelism into cross cluster test bootstrapping (#117820)
We can parallelize starting the clusters and a few other things
to effectively speed up these tests by 2x which comes out to about a minute
of execution time saved for all of those in :server:internalClusterTests
on my workstation.
2024-12-04 21:04:11 +01:00