upgrade: skip the upgrade paths which are not needed#12881
upgrade: skip the upgrade paths which are not needed#12881weizhouapache wants to merge 2 commits intoapache:4.20from
Conversation
|
@blueorangutan package |
|
@weizhouapache 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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.20 #12881 +/- ##
=========================================
Coverage 16.25% 16.25%
+ Complexity 13415 13413 -2
=========================================
Files 5664 5664
Lines 500465 500467 +2
Branches 60780 60780
=========================================
+ Hits 81338 81341 +3
+ Misses 410031 410030 -1
Partials 9096 9096
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17232 |
|
@blueorangutan test |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
abh1sar
left a comment
There was a problem hiding this comment.
Thanks @weizhouapache. Looks good.
It's better to fix this logic rather than adding an upgrade path which does nothing.
Do you think we should still make sure that all the queries in the upgrade path are idempotent?
INSERT IGNORE INTO cloud.configuration_group (name, description, precedence) VALUES ('Usage Server', 'Usage Server related configuration', 9);
from https://github.com/apache/cloudstack/pull/12875/changes
yes @abh1sar |
|
[SF] Trillian test result (tid-15724)
|
There was a problem hiding this comment.
Pull request overview
This PR adjusts CloudStack’s DB upgrade-path calculation so that when the current DB version is not explicitly present in the upgrade hierarchy, already-applied upgrade steps are skipped, avoiding re-running migrations that can fail on duplicate data.
Changes:
- Update
DatabaseVersionHierarchy#getPathto filter out upgrade steps whosegetUpgradedVersion()is not greater than the actual DB version when the DB version is missing from the hierarchy. - Add a unit test to validate the computed upgrade path for
4.20.1.0 -> 4.20.3.0(expecting onlyUpgrade42020to42030). - Make the
Usage Serverconfiguration group insertion idempotent inschema-42000to42010.sqlby switching toINSERT IGNORE.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| engine/schema/src/main/java/com/cloud/upgrade/DatabaseVersionHierarchy.java | Filters upgrade steps when the “from” version isn’t in the hierarchy to avoid re-running already-applied migrations. |
| engine/schema/src/test/java/com/cloud/upgrade/DatabaseUpgradeCheckerTest.java | Adds coverage for the specific 4.20.1.0 -> 4.20.3.0 upgrade-path scenario. |
| engine/schema/src/main/resources/META-INF/db/schema-42000to42010.sql | Makes the configuration group insert resilient to duplicate-key conditions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17240 |
|
@blueorangutan test |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
RosiKyu
left a comment
There was a problem hiding this comment.
LGTM
Looks great, thanks @weizhouapache !
Description
This PR provides an alternative solution as #12875
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?