Skip to content

Conversation

@Pearl1594
Copy link
Contributor

Description

This PR fixes: #12517

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

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 5.17%. Comparing base (a6ccde4) to head (101e2a0).
⚠️ Report is 5 commits behind head on 4.20.

❗ There is a different number of reports uploaded between BASE (a6ccde4) and HEAD (101e2a0). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (a6ccde4) HEAD (101e2a0)
unittests 1 0
Additional details and impacted files
@@              Coverage Diff              @@
##               4.20   #12549       +/-   ##
=============================================
- Coverage     16.26%    5.17%   -11.09%     
=============================================
  Files          5660      403     -5257     
  Lines        499907    33344   -466563     
  Branches      60696     6149    -54547     
=============================================
- Hits          81316     1727    -79589     
+ Misses       409521    31416   -378105     
+ Partials       9070      201     -8869     
Flag Coverage Δ
uitests 5.07% <ø> (+0.91%) ⬆️
unittests ?

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.

List<Backup.VolumeInfo> backedVolumes = backup.getBackedUpVolumes();
List<VolumeVO> volumes = backedVolumes.stream()
.map(volume -> volumeDao.findByUuid(volume.getUuid()))
.map(volume -> volumeDao.findByUuid(volume.getPath()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the new uuid or path after migration needs to be updated in the backed-up volumes metadata if any backups existing for them? any case path might also change?

Copy link
Contributor Author

@Pearl1594 Pearl1594 Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new UUID / path for the backed up volume doesn't need to be updated as the uuid - points to the volume UUID - which is always the same on subsequent backups, and the path points to the backup path - which shouldn't vary even if volume is migrated. I don't see the path of the backup changing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.map(volume -> volumeDao.findByUuid(volume.getPath()))
.map(backedVolumeInfo -> volumeDao.findByUuid(backedVolumeInfo.getPath()))

it's better change to backedVolumeInfo to avoid confusion.

@Pearl1594 Correct, path of the backup doesn't change. I mean, the volume path after migration might change as the volume is checked by its backed up path (which is before migration). cc @abh1sar

@Pearl1594 Pearl1594 added this to the 4.20.3 milestone Jan 29, 2026
@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@Pearl1594 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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16637

@Pearl1594
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

List<Backup.VolumeInfo> backedVolumes = backup.getBackedUpVolumes();
List<VolumeVO> volumes = backedVolumes.stream()
.map(volume -> volumeDao.findByUuid(volume.getUuid()))
.map(volume -> volumeDao.findByUuid(volume.getPath()))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

volumeDao.findByUuid() should take volume.getUuid() as an argument not path.

Volume paths are actually set in restoreCommand.setVolumePaths(getVolumePaths(volumes));
which is getting the path from volume.getPath().
So, ideally it should work as is. Can you check?

The bug is obvious in Restore single volume code restoreCommand.setVolumePaths(Collections.singletonList(String.format("%s/%s", dataStore.getLocalPath(), volumeUUID)));
-- here we should use the volume path not uuid

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad - I did the test / changes and 4.22 but made the wrong change on 4.20 - I meant to change this: to getPath from getUUID() - https://github.com/apache/cloudstack/blob/4.22/plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java#L295
I'll fix it.

@blueorangutan
Copy link

[SF] Trillian test result (tid-15340)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 50996 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12549-t15340-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 2, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 40%)

See analysis details on SonarQube Cloud

}

private List<String> getVolumePaths(List<VolumeVO> volumes) {
private List<String> getVolumePaths(List<VolumeVO> volumes, List<Backup.VolumeInfo> backedVolumes) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this returns empty list when backedVolumes is empty - passed in takeBackup() above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right - fixed it.

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