Skip to content

Fix snapshot physical size listing #11448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 4.20
Choose a base branch
from

Conversation

JoaoJandre
Copy link
Contributor

@JoaoJandre JoaoJandre commented Aug 14, 2025

Description

This PR fixes the snapshot physical size listing. Since #7873, the snapshot physical size has only been fetched from the secondary storage. This has two issues:

  1. It is possible for the snapshot to be on the primary storage, and thus these snapshots always return size 0.
  2. Up until KVM incremental snapshot feature #9270, at least in KVM, every snapshot that was copied to secondary storage also had a reference to the primary storage. As the SnapshotObject has the ID for the primary storage reference, when searching for the reference to get the size, we search for a reference that is in the storage with role Image, but the ID of a primary storage; thus, no reference is returned.

This PR fixes this behavior. Fixes #11442

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

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Using KVM, created two volume snapshots, one on secondary storage and one on primary storage. Verified that in version 4.20.1 both returned 0 for physical size. After applying this patch, both return what is stored in the DB for their respective physical sizes.

Copy link

codecov bot commented Aug 14, 2025

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.17%. Comparing base (f5b4858) to head (6110eef).

Files with missing lines Patch % Lines
...he/cloudstack/storage/snapshot/SnapshotObject.java 0.00% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #11448      +/-   ##
============================================
- Coverage     16.17%   16.17%   -0.01%     
  Complexity    13284    13284              
============================================
  Files          5656     5656              
  Lines        497990   497995       +5     
  Branches      60399    60400       +1     
============================================
  Hits          80529    80529              
- Misses       408499   408504       +5     
  Partials       8962     8962              
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.02% <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 Sentry.
📢 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.

@JoaoJandre JoaoJandre added this to the 4.20.2 milestone Aug 14, 2025
@sureshanaparti
Copy link
Contributor

@blueorangutan package

@sureshanaparti sureshanaparti requested a review from abh1sar August 14, 2025 21:57
@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

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.

4 participants