Skip to content

Add Dry-Run Option to Snapshot Restore API #54940

@original-brownbear

Description

@original-brownbear

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:

  1. Add the dry run flag to make it not actually submit the cluster state update for the restore.
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions