-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix snapshot removal when image already merged #524
fix snapshot removal when image already merged #524
Conversation
c366725
to
6cc791a
Compare
...l/src/main/java/org/ovirt/engine/core/bll/snapshots/RemoveSnapshotSingleDiskLiveCommand.java
Outdated
Show resolved
Hide resolved
6cc791a
to
37a44f2
Compare
Ended up skipping the check that the volume is not in the chain already, as Benny suggested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this approach looks good to me
...ll/src/main/java/org/ovirt/engine/core/bll/snapshots/ColdMergeSnapshotSingleDiskCommand.java
Show resolved
Hide resolved
...l/src/main/java/org/ovirt/engine/core/bll/snapshots/RemoveSnapshotSingleDiskLiveCommand.java
Outdated
Show resolved
Hide resolved
/ost |
262eafd
to
561123f
Compare
...ll/src/main/java/org/ovirt/engine/core/bll/snapshots/ColdMergeSnapshotSingleDiskCommand.java
Outdated
Show resolved
Hide resolved
...l/src/main/java/org/ovirt/engine/core/bll/snapshots/RemoveSnapshotSingleDiskLiveCommand.java
Outdated
Show resolved
Hide resolved
561123f
to
5056166
Compare
5056166
to
34b81e6
Compare
...ll/src/main/java/org/ovirt/engine/core/bll/snapshots/ColdMergeSnapshotSingleDiskCommand.java
Outdated
Show resolved
Hide resolved
34b81e6
to
b45be93
Compare
When trying to remove a snapshot which was already removed before and image merged, but not removed from the DB for some reason - the RemoveSnapshot command fails and the snapshot and images stay in the DB and cannot be removed. The reason for this is that during RemoveSnapshotSingleDiskLiveCommand the DestroyImage command fails (since the image does not not exist), thus the whole command fails, and the snapshot/image are not removed from the DB. In the ColdMerge case, the ColdMergeSnapshotSingleDiskCommand fails already at the PrepareMerge stage. In this change, for both Live and Cold merge - we first check that the Destination image (or the Top Image) exists on storage with GetVolumeInfo. If it does not, we conclude that it was already merged and removed, and proceed to finishing the command successfully and removing the snapshot and the image from the DB, skipping all the steps. Bug-Url: https://bugzilla.redhat.com/1948599
b45be93
to
fdcdcac
Compare
/ost |
When trying to remove a snapshot which was already removed before
and image merged, but not removed from the DB for some reason -
the RemoveSnapshot command fails and the snapshot and images stay in
the DB and cannot be removed.
The reason for this is that during RemoveSnapshotSingleDiskLiveCommand
the DestroyImage command fails (since the image does not not exist),
thus the whole command fails, and the snapshot/image are not removed
from the DB.
In the ColdMerge case, the ColdMergeSnapshotSingleDiskCommand fails
already at the PrepareMerge stage.
In this change, for both Live and Cold merge - we first check that the
Destination image (or the Top Image) exists on storage with
GetVolumeInfo. If it does not, we conclude that it was already merged
and removed, and proceed to finishing the command successfully and
removing the snapshot and the image from the DB, skipping all the
steps.
Bug-Url: https://bugzilla.redhat.com/1948599