Fix KVM incremental snapshot removal when using multiple secondary storages#11180
Fix KVM incremental snapshot removal when using multiple secondary storages#11180sureshanaparti merged 1 commit intoapache:mainfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11180 +/- ##
============================================
- Coverage 16.57% 16.57% -0.01%
+ Complexity 13988 13987 -1
============================================
Files 5745 5745
Lines 510847 510848 +1
Branches 62140 62141 +1
============================================
- Hits 84696 84694 -2
- Misses 416677 416679 +2
- Partials 9474 9475 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@winterhazel @bernardodemarco can you do some testing for this? |
There was a problem hiding this comment.
Code looks good. I also tested by reproducing the steps from the description:
- Enable
kvm.incremental.snapshot - Take snapshot
s1of volumeX, which gets stored insec-1 - Mark
sec-1as read-only - Take snapshot
s2of volumeX, which gets stored insec-2 - Delete snapshot
s1
Before the changes, step 4 would remove s1 from sec-1. This resulted in an exception when attempting to restore s2.
With the patch, step 4 only marks s1 as Hidden, and the restore works as intended. s1 is removed from sec-1 after deleting s2.
|
@blueorangutan package |
|
@winterhazel a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 14235 |
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 14249 |
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 14267 |
|
@blueorangutan test |
|
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-13825)
|
…orages (apache#11180) When removing an incremental snapshot (For both KVM and XenServer), it is checked if the snapshot has a child or not. If it has, then the snapshot is not removed from the storage. For KVM incremental snapshots, snapshots in the same chain may be on different secondary storages (within the same zone). However, the child search process only considers snapshots from the same secondary storage as theirs. Therefore, if a snapshot has its parent snapshot on a different secondary storage, it will be completely removed, making the snapshot chain inconsistent.
Description
When removing an incremental snapshot (For both KVM and XenServer), it is checked if the snapshot has a child or not. If it has, then the snapshot is not removed from the storage.
For KVM incremental snapshots, snapshots in the same chain may be on different secondary storages (within the same zone).
However, the child search process only considers snapshots from the same secondary storage as theirs. Therefore, if a snapshot has its parent snapshot on a different secondary storage, it will be completely removed, making the snapshot chain inconsistent.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
I created 3 snapshots that were stored in the secondary storage
sec-nfs1. I then set the storagesec-nfs1to read-only and created 2 more snapshots, which were stored in the secondary storagesec-nfs2.Without the changes: when the third snapshot was removed, its state was set to
Destroyed, and an error was thrown when trying to restore the fourth snapshot, indicating that the file for the third snapshot no longer existed.With the changes: the third snapshot's state was set to
Hidden, and it was possible to restore the fourth snapshot.