-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Add Dry-Run Option to Snapshot Restore API #54940
Copy link
Copy link
Open
Labels
:Distributed/Snapshot/RestoreAnything directly related to the `_snapshot/*` APIsAnything directly related to the `_snapshot/*` APIs>enhancementTeam:DistributedMeta label for distributed team.Meta label for distributed team.
Description
We should add a ?dry-run flag to snapshot restore to allow for validating that all indices in a restore will be restorable before/without actually executing the restore.
The API could return an empty org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse without any RestoreInfo if all indices are can be restored.
If there is an issue with the restore, we should throw an exception that contains the issues with restoring each failed index individually and has status 400.
We can build this on top of the existing logic in the RestoreService. What we would have to do is:
- Add the dry run flag to make it not actually submit the cluster state update for the restore.
- Make it collect all the failures for all indices individually before throwing the exception that is returned to the transport layer instead of failing fast on the first index that can't be restored (because of e.g. an index version that is too old) when using the dry run.
cc @ywelsch
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Distributed/Snapshot/RestoreAnything directly related to the `_snapshot/*` APIsAnything directly related to the `_snapshot/*` APIs>enhancementTeam:DistributedMeta label for distributed team.Meta label for distributed team.
Type
Fields
Give feedbackNo fields configured for issues without a type.