Skip to content

Fix Backup related upgrade failure from 4.20.1/4.20.2 to 4.21.0/4.22.0#12777

Merged
sureshanaparti merged 1 commit intoapache:4.22from
shapeblue:backup-upgrade
Apr 10, 2026
Merged

Fix Backup related upgrade failure from 4.20.1/4.20.2 to 4.21.0/4.22.0#12777
sureshanaparti merged 1 commit intoapache:4.22from
shapeblue:backup-upgrade

Conversation

@abh1sar
Copy link
Copy Markdown
Contributor

@abh1sar abh1sar commented Mar 10, 2026

Description

This PR fixes #12769

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 4 data volumes on 4.20.
  2. Took a backup
  3. Upgrade to 4.22

Also tried running the new query manually on backed-up volumes containing data of 24 volumes.

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

@abh1sar
Copy link
Copy Markdown
Contributor Author

abh1sar commented Mar 10, 2026

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

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

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.92%. Comparing base (5caf6cd) to head (fdc1e5f).
⚠️ Report is 49 commits behind head on 4.22.

Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #12777      +/-   ##
============================================
+ Coverage     17.60%   17.92%   +0.31%     
- Complexity    15659    16179     +520     
============================================
  Files          5917     5949      +32     
  Lines        531394   534058    +2664     
  Branches      64970    65301     +331     
============================================
+ Hits          93575    95752    +2177     
- Misses       427269   427550     +281     
- Partials      10550    10756     +206     
Flag Coverage Δ
uitests 3.66% <ø> (-0.04%) ⬇️
unittests 19.03% <ø> (+0.35%) ⬆️

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
Copy Markdown

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

@abh1sar abh1sar changed the base branch from main to 4.22 March 10, 2026 06:59
@abh1sar
Copy link
Copy Markdown
Contributor Author

abh1sar commented Mar 10, 2026

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@abh1sar 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 17061

@abh1sar abh1sar marked this pull request as ready for review March 10, 2026 11:33
@shwstppr shwstppr requested a review from Copilot March 26, 2026 11:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses an upgrade-time failure in the 4.20.1/4.20.2 → 4.21.0/4.22.0 database migration when the backup framework is in use, by eliminating reliance on GROUP_CONCAT() string-building that can exceed group_concat_max_len.

Changes:

  • Replaces manual JSON string concatenation using GROUP_CONCAT() with JSON_ARRAYAGG(JSON_OBJECT(...)) when backfilling backed_volumes in cloud.backups.
  • Applies the same change when backfilling backup_volumes in cloud.vm_instance, defaulting to '[]' for VMs with no volumes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

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

code lgtm

@abh1sar
Copy link
Copy Markdown
Contributor Author

abh1sar commented Apr 7, 2026

@sureshanaparti @vladimirpetrov
This is a must have for 4.22.1. Thanks

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland 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 17418

Copy link
Copy Markdown
Contributor

@rajujith rajujith left a comment

Choose a reason for hiding this comment

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

LGTM
Tested upgrade from 4.20.2 to this PR
VMs had 3 volumes and backups on NAS repo

@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
Copy link
Copy Markdown

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

Test Result Time (s) Test File

@sureshanaparti sureshanaparti merged commit 4ba4bd3 into apache:4.22 Apr 10, 2026
25 of 32 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.22.1 Apr 10, 2026
@sureshanaparti sureshanaparti deleted the backup-upgrade branch April 10, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Backup related upgrade failure from 4.20.1/4.20.2 to 4.21.0/4.22.0

7 participants