Skip to content

Conversation

@bernardodemarco
Copy link
Member

@bernardodemarco bernardodemarco commented Jan 9, 2026

Description

Currently, the cloud.backups table references a backup schedule through the backup_schedule_id field. It is only populated when a backup is created from a schedule. For ad hoc backups, the field's value is kept as NULL.

Additionally, when backup schedules are deleted via the deleteBackupSchedule API, their corresponding entries are expunged from the DB. However, the backups' references to the schedules are not cleaned up and, thus, these references remain indefinitely in the cloud.backups table. It is important to highlight that, although the clean up process is not performed, it does not cause any bugs/side effects.

Therefore, this PR proposes to clean up such references before deleting backup schedules from the DB. The PR also cleans up some pieces of the code related with backup schedules, removing unused methods, moving methods' definitions to appropriate layers of the project and dropping the unused backup_interval_type column from the cloud.backups table (see #11223).

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?

  1. Created a backup schedule and waited for some backups to be created from it
  2. Deleted the backup schedule
  3. Verified that the schedule's backups did not have references pointing to the schedule anymore

@bernardodemarco bernardodemarco added this to the 4.22.1 milestone Jan 9, 2026
@bernardodemarco
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

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

@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

❌ Patch coverage is 0% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.59%. Comparing base (04875f1) to head (020f31a).

Files with missing lines Patch % Lines
...src/main/java/com/cloud/api/ApiResponseHelper.java 0.00% 14 Missing ⚠️
...e/cloudstack/backup/dao/BackupScheduleDaoImpl.java 0.00% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #12401   +/-   ##
=========================================
  Coverage     17.59%   17.59%           
- Complexity    15599    15600    +1     
=========================================
  Files          5910     5910           
  Lines        529733   529734    +1     
  Branches      64719    64720    +1     
=========================================
+ Hits          93215    93218    +3     
+ Misses       426025   426024    -1     
+ Partials      10493    10492    -1     
Flag Coverage Δ
uitests 3.57% <ø> (ø)
unittests 18.66% <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.

@blueorangutan
Copy link

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants