Skip to content

Commit

Permalink
Run Snapshot Removal in Compensation Context
Browse files Browse the repository at this point in the history
The next-run snapshot is created in a compensation context, which causes
it to be removed if something fails.
But the previous (if exists) next-run snapshot is removed outside the
compensation context.

This causes the VM's to lose its next-run snapshot if for example an
UpdateCluster fails.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=2094729
Signed-off-by: Jean-Louis Dupond jean-louis@dupond.be
  • Loading branch information
dupondje authored and ahadas committed Jul 6, 2022
1 parent 2d8e98f commit b99c10c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@ public void createNextRunSnapshot(
// first remove existing snapshot
Snapshot runSnap = snapshotDao.get(existingVm.getId(), Snapshot.SnapshotType.NEXT_RUN);
if (runSnap != null) {
snapshotDao.remove(runSnap.getId());
CompensationUtils.removeEntity(runSnap, snapshotDao, compensationContext);
}

final VM newVm = new VM();
Expand Down

0 comments on commit b99c10c

Please sign in to comment.