Skip to content

(KBOSS) Add synchronous backup compression flag - #13901

Merged
RosiKyu merged 7 commits into
apache:mainfrom
scclouds:add-sync-compression-flag
Nov 13, 2026
Merged

RosiKyu merged 7 commits into
apache:mainfrom
scclouds:add-sync-compression-flag

Conversation

@JoaoJandre

Copy link
Copy Markdown
Contributor

Description

Currently, the backup compression process is always performed asynchronously; the existing backup is compressed into a new file, which then replaces the original. However, when using immutable storage, this behavior increases storage usage because the original backup file cannot be deleted.

To address this, the compress_async flag, defaulting to true, has been added to backup offerings. The default setting maintains the current behavior. When the flag is set to false, compression occurs during backup creation, resulting in only a single file copy. However, enabling synchronous backup compression slows down the backup creation process and makes it prone to timeouts unless the timeout settings are adjusted accordingly.

It is important to note that the flag only applies to backup offerings that have the compress flag set to true.

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?

Test description

  1. I created a new backup offering with compressasync = false, and another without specifying compressasync.
  2. I created the "sync" and "async" VMs and assigned the respective offerings to each VM.
  3. I created backups using each of the VMs. I observed that the backups created with the "async" VM maintained the previous behavior, whereas the backups created with the "sync" VM were compressed during creation.

@codecov

codecov Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 10.52632% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.80%. Comparing base (d3f0700) to head (f36aa75).
⚠️ Report is 111 commits behind head on main.

Files with missing lines Patch % Lines
...ache/cloudstack/backup/TakeKbossBackupCommand.java 4.00% 24 Missing ⚠️
...java/org/apache/cloudstack/utils/qemu/QemuImg.java 0.00% 17 Missing ⚠️
.../apache/cloudstack/backup/KbossBackupProvider.java 15.78% 14 Missing and 2 partials ⚠️
.../wrapper/LibvirtTakeKbossBackupCommandWrapper.java 33.33% 6 Missing ⚠️
...i/command/user/backup/CreateBackupOfferingCmd.java 0.00% 3 Missing ⚠️
...e/wrapper/LibvirtCompressBackupCommandWrapper.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13901      +/-   ##
============================================
+ Coverage     20.39%   20.80%   +0.40%     
- Complexity    21283    21946     +663     
============================================
  Files          6481     6496      +15     
  Lines        588040   591919    +3879     
  Branches      72021    72629     +608     
============================================
+ Hits         119957   123149    +3192     
- Misses       455052   455393     +341     
- Partials      13031    13377     +346     
Flag Coverage Δ
uitests 3.87% <ø> (+0.17%) ⬆️
unittests 22.11% <10.52%> (+0.41%) ⬆️

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.

@JoaoJandre

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@JoaoJandre a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@Damans227

Copy link
Copy Markdown
Collaborator

thanks @JoaoJandre, fix looks right. CLGTM.

@blueorangutan

Copy link
Copy Markdown

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

@JoaoJandre

Copy link
Copy Markdown
Contributor Author

@DaanHoogland could we run the tests here?

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

blueorangutan commented Oct 26, 2026 •

Copy link
Copy Markdown

[SF] Trillian test result (tid-17254)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 61095 seconds
Marvin logs: [archive removed]
Smoke tests completed. 157 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@nvazquez

Copy link
Copy Markdown
Contributor

@blueorangutan package

@nvazquez nvazquez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code LGTM

@blueorangutan

Copy link
Copy Markdown

@nvazquez a [SL] Jenkins job has been kicked to build packages. It will be bundled with no 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 20000

@RosiKyu RosiKyu self-assigned this Nov 12, 2026

@RosiKyu RosiKyu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

Tested on a KVM lab (Oracle Linux 9, KBOSS provider, NFS secondary storage), baseline 24.0 build first, then the PR packages.

  • Baseline: compressasync=false is ignored; the backup is compressed afterwards and the original and the .comp copy sit on secondary storage at the same time.
  • With the PR, compress=true compressasync=false: the backup is compressed while it is taken, it is marked Compressed straight away and only one file is written. Same for an incremental backup (compressed delta with the correct parent).
  • compressasync=true, and offerings created before the upgrade, keep the old async behaviour.
  • compressasync=false without compress=true does nothing, as described.
  • Restore from a sync-compressed full and from a sync-compressed incremental backup works, the VM starts.

@RosiKyu
RosiKyu merged commit 815a30f into apache:main Nov 13, 2026
26 of 27 checks passed
@github-project-automation github-project-automation Bot moved this from conflict/waiting to Done in CloudStack Testing Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

6 participants