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

   ### Description
   
   If the environment has a malformed (wrong logic, syntax error, etc.) 
secondary storage selector heuristic rule, an exception is thrown during its 
interpretation. The snapshot creation process gets the environment's `SNAPSHOT` 
type secondary storage selectors and interprets its heuristic rule, if any was 
returned. However, this validation does not handle exceptions thrown by the 
interpreter.
   
   With that, the snapshot record that was created in the `Allocated` state is 
never normalized, even though the creation process was finished prematurely due 
to the interpretation error. Therefore, changes were made to normalize the 
snapshot state to `Error` in these cases.
   
   ### 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
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [X] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   First, I created a malformed secondary storage selector:
   
   <details><summary>Secondary storage selector creation command</summary>
   
   ```bash
   create secondarystorageselector name=a description=a type=SNAPSHOT 
zoneid=a9a3fc15-008f-48b1-8964-d946104b4b17 heuristicrule="if"
   ```
   
   </details>
   
   Then, I tried to create a volume snapshot, and validated that it was set to 
the `Allocated` state. After applying the changes, I repeated the process and 
validated that the snapshot was set to the `Error` state.


-- 
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