JoaoJandre opened a new pull request, #9447:
URL: https://github.com/apache/cloudstack/pull/9447

   ### Description
   
   Using XenServer as the hypervisor, when deleting a snapshot that has a 
parent, that parent will also get erased on storage, causing data loss. This 
behavior was introduced with #7873, where the list of snapshot states that can 
be deleted was changed to add `BackedUp` snapshots. 
   
   This PR changes the states list back to the original list, and swaps the 
while loop for a do while loop to account for the changes in #7873.
   
   Fixes #9446 
   
   ### Types of changes
   
   - [X] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [X] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   - [ ] test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [X] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### How Has This Been Tested?
   
   1. Created a VM
   2. Took a volume snapshot (S1).
   3. Accessed the VM and wrote some data with: `dd if=/dev/zero of=test bs=1M 
count=1000`
   4. Used `sync` to make sure data is written to disk
   5. Took a second volume snapshot (S2).
   6. Deleted the last volume snapshot (S2).
   
   Before the change, S1 would be mistakenly deleted from storage as well, and 
an inconsistent snapshot record would remain.
   After the change, S1 is untouched and works as intended.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to