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

   ### Description
   
   CloudStack lets you create more than one snapshot of the same volume with 
the same name. Since a snapshot's name is used to build its file name on the 
store, two snapshots of a volume with the same name map to the same file. 
Creating the second overwrites the first, and later deleting either one removes 
the shared file and leaves the other snapshot record pointing at a file that no 
longer exists.
   
   This rejects creating a snapshot when an active (non-destroyed) snapshot 
with the same name already exists for the volume. Auto-generated snapshot names 
already include a timestamp, so they are not affected.
   
   Fixes: #13051
   
   ### Types of changes
   
   - [ ] 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
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [x] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   N/A
   
   ### How Has This Been Tested?
   
   Added a unit test that creates a snapshot with a name that already exists 
for the volume and checks it is rejected with an 
InvalidParameterValueException. Before this change that test fails because the 
create proceeds; after it, it is rejected. The existing snapshot manager tests 
still pass.
   
   #### How did you try to break this feature and the system with this change?
   
   The check only compares against active snapshots (not Destroyed or Error), 
so re-using the name of a deleted snapshot still works. Auto-generated names 
carry a timestamp, so scheduled and default-named snapshots are not blocked.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to