From dfa09fc856c544e6edf001c66867472463d7ef96 Mon Sep 17 00:00:00 2001 From: Spaceman1984 <49917670+Spaceman1984@users.noreply.github.com> Date: Fri, 20 Nov 2020 22:50:16 +0200 Subject: [PATCH] server: Setting snapshot removed on timeout (#4425) * Setting snapshot state to error on timeout * Setting removed field so snapshot record is ignored by garbage collection * Removed explicitly setting error status, renamed method from markFailed to markRemoved * Renamed method, moved code a few lines down * Moved remove logic * Removed unused service * Moved removed logic - last time, promise --- .../apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java b/engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java index 51a2741dddb..b8788fbef98 100644 --- a/engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java +++ b/engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java @@ -323,6 +323,7 @@ public class SnapshotServiceImpl implements SnapshotService { if (result.isFailed()) { try { if (createSnapshotPayload.getAsyncBackup()) { + _snapshotDao.remove(srcSnapshot.getId()); destSnapshot.processEvent(Event.OperationFailed); throw new SnapshotBackupException("Failed in creating backup of snapshot with ID "+srcSnapshot.getId()); } else {