elasticsearch runtime_error ai_generated true

SnapshotDeleteException: [my_repo:snapshot_2025] cannot delete snapshot - a snapshot is currently in progress

ID: elasticsearch/snapshot-in-progress-delete-failed

Also available as: JSON · Markdown · 中文
90%Fix Rate
86%Confidence
1Evidence
2025-01-12First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
elasticsearch 7.17 active
elasticsearch 8.11 active
elasticsearch 8.12 active

Root Cause

A delete operation on a snapshot fails because another snapshot in the same repository is currently being created or restored.

generic

中文

删除快照操作失败,因为同一仓库中的另一个快照当前正在创建或恢复中。

Official Documentation

https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-snapshot-api.html

Workarounds

  1. 95% success Wait for the in-progress snapshot to complete by monitoring snapshot status: GET _snapshot/my_repo/_all and check for 'IN_PROGRESS' state, then retry the delete.
    Wait for the in-progress snapshot to complete by monitoring snapshot status: GET _snapshot/my_repo/_all and check for 'IN_PROGRESS' state, then retry the delete.
  2. 85% success Abort the in-progress snapshot if it is stuck: DELETE _snapshot/my_repo/snapshot_in_progress_name (if the snapshot name is known).
    Abort the in-progress snapshot if it is stuck: DELETE _snapshot/my_repo/snapshot_in_progress_name (if the snapshot name is known).
  3. 80% success Increase snapshot timeout settings to avoid long-running snapshots: PUT _cluster/settings { "transient": { "snapshot.max_concurrent_operations": 1 } } to serialize operations.
    Increase snapshot timeout settings to avoid long-running snapshots: PUT _cluster/settings { "transient": { "snapshot.max_concurrent_operations": 1 } } to serialize operations.

中文步骤

  1. 等待正在进行的快照完成,通过监控快照状态:GET _snapshot/my_repo/_all 并检查 'IN_PROGRESS' 状态,然后重试删除。
  2. 如果正在进行的快照卡住,则中止它:DELETE _snapshot/my_repo/snapshot_in_progress_name(如果快照名称已知)。
  3. 增加快照超时设置以避免长时间运行的快照:PUT _cluster/settings { "transient": { "snapshot.max_concurrent_operations": 1 } } 以序列化操作。

Dead Ends

Common approaches that don't work:

  1. 85% fail

    Direct file deletion can corrupt the repository metadata, making all snapshots in the repository unusable.

  2. 70% fail

    Restarting may leave the snapshot in an inconsistent state, requiring manual cleanup and potentially losing data.

  3. 65% fail

    Creating a new snapshot while another is in progress can also fail with a ConcurrentSnapshotExecutionException.