Skip to content

Snapshot state normalization for failure due to malformed secondary s…#13411

Open
erikbocks wants to merge 1 commit into
apache:4.22from
scclouds:normalize-snapshot-after-faulty-heuristic
Open

Snapshot state normalization for failure due to malformed secondary s…#13411
erikbocks wants to merge 1 commit into
apache:4.22from
scclouds:normalize-snapshot-after-faulty-heuristic

Conversation

@erikbocks

Copy link
Copy Markdown
Collaborator

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)
  • 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
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

First, I created a malformed secondary storage selector:

Secondary storage selector creation command
create secondarystorageselector name=a description=a type=SNAPSHOT zoneid=a9a3fc15-008f-48b1-8964-d946104b4b17 heuristicrule="if"

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.

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.67%. Comparing base (8e933b7) to head (08ff17d).

Files with missing lines Patch % Lines
...om/cloud/storage/snapshot/SnapshotManagerImpl.java 0.00% 14 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #13411      +/-   ##
============================================
- Coverage     17.67%   17.67%   -0.01%     
  Complexity    15792    15792              
============================================
  Files          5922     5922              
  Lines        533167   533178      +11     
  Branches      65210    65210              
============================================
- Hits          94246    94243       -3     
- Misses       428276   428288      +12     
- Partials      10645    10647       +2     
Flag Coverage Δ
uitests 3.69% <ø> (ø)
unittests 18.75% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@winterhazel

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 18243

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants