curator-opensearch icon indicating copy to clipboard operation
curator-opensearch copied to clipboard

Improve output when delete_snapshot is blocked by task

Open eherot opened this issue 2 years ago • 0 comments

Currently if another snapshot task is blocking delete_snapshot, the task action is logged as DEBUG only and following is logged at the INFO level:

Unable to delete snapshot(s) because a snapshot is in state "IN_PROGRESS"

If there is actually another snapshot in progress, this message is accurate, but this message is also thrown if there are any other tasks with actions containing the word "snapshot" in the tasks list.

This PR makes the following changes:

  1. In utils/find_snapshot_tasks: Return the whole task object instead of True if there is an active snapshot task
  2. In utils/safe_to_snap: Print the contents of the active snapshot task object if there is one.
  3. In actions/DeleteSnapshots/do_action: Change the wording of the error message to allow for failure due to "other snapshot activity" (and not just in progress snapshots).

eherot avatar Oct 24 '22 18:10 eherot