Skip to content

Commit

Permalink
[7.17] Log a debug level message for deleting non-existing snapshot (#…
Browse files Browse the repository at this point in the history
…100479) (#100509)

* Log a debug level message for deleting non-existing snapshot (#100479)

The new message helps pairing with the "deleting snapshots" log message
at info level.

(cherry picked from commit 2cfdb7a)

# Conflicts:
#	server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java

* spotless

* compilation

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
ywangd and elasticmachine committed Oct 11, 2023
1 parent 0c431ce commit 9e7713a
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2589,7 +2589,12 @@ public ClusterState execute(ClusterState currentState) throws Exception {
if (foundId == null) {
if (snapshotEntries.stream()
.noneMatch(entry -> entry.snapshot().getSnapshotId().getName().equals(snapshotOrPattern))) {
throw new SnapshotMissingException(repositoryName, snapshotOrPattern);
final SnapshotMissingException snapshotMissingException = new SnapshotMissingException(
repositoryName,
snapshotOrPattern
);
logger.debug(snapshotMissingException.getMessage());
throw snapshotMissingException;
}
} else {
snapshotIds.add(foundId);
Expand Down Expand Up @@ -3066,7 +3071,10 @@ private void deleteSnapshotsFromRepository(
ActionListener.wrap(updatedRepoData -> {
logger.info("snapshots {} deleted", snapshotIds);
removeSnapshotDeletionFromClusterState(deleteEntry, null, updatedRepoData);
}, ex -> removeSnapshotDeletionFromClusterState(deleteEntry, ex, repositoryData))
}, ex -> {
logger.debug(() -> "failed to complete snapshot deletion [" + deleteEntry + "]", ex);
removeSnapshotDeletionFromClusterState(deleteEntry, ex, repositoryData);
})
);
}
}
Expand Down

0 comments on commit 9e7713a

Please sign in to comment.