Skip to content

allow loadbalanced DB - #14279

Open
DaanHoogland wants to merge 1 commit into
4.22from
ghi14172-lodBalancedDb
Open

DaanHoogland wants to merge 1 commit into
4.22from
ghi14172-lodBalancedDb

Conversation

@DaanHoogland

Copy link
Copy Markdown
Contributor

Description

This PR...

Fixes: #14172

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?

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

@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 11.11111% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.00%. Comparing base (2e63c60) to head (86dc7a4).
⚠️ Report is 41 commits behind head on 4.22.

Files with missing lines Patch % Lines
...ain/java/com/cloud/utils/db/TransactionLegacy.java 11.11% 7 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #14279   +/-   ##
=========================================
  Coverage     18.00%   18.00%           
- Complexity    16219    16221    +2     
=========================================
  Files          5936     5936           
  Lines        535716   535716           
  Branches      65596    65597    +1     
=========================================
+ Hits          96459    96464    +5     
+ Misses       428268   428261    -7     
- Partials      10989    10991    +2     
Flag Coverage Δ
uitests 4.02% <ø> (ø)
unittests 19.08% <11.11%> (+<0.01%) ⬆️

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.

@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@DaanHoogland
DaanHoogland marked this pull request as ready for review October 20, 2026 09:12
@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@nabassa1323, @weizhouapache , can you add your comments/test results here?

@nabassa1323

Copy link
Copy Markdown

@DaanHoogland @weizhouapache — test results (also posted on #14172):

Setup: CloudStack 4.22.1.0, 2 MS, MariaDB GTID primary+replica,
db.ha.enabled=true, PR timeouts (connectTimeout/socketTimeout/loadBalanceBlocklistTimeout).
Backported TransactionLegacy from this PR into the management fat JAR on both MS.

Test: stopped primary MySQL + primary-site MS.

Results:

  • MultiHostConnectionProxy path is active
  • No more UI/API hang / Hikari createTimeoutException
  • Surviving MS uses the replica; without promote, writes fail on read_only (expected)
  • After manual promote (read_only=OFF), writes work again -> full manual failover OK

We support merging this PR for 4.22.2 on that basis.

}

private static String getDBHAParams(String dbName, Properties dbProps) {
private static String getDBHAParams(String dbName, Properties dbProps, String loadBalanceStrategy) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is the new parameter loadBalanceStrategy needed ?

String loadBalanceStrategy = dbProps.getProperty("db.ha.loadBalanceStrategy");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@nabassa1323 , @weizhouapache is right, if this is the only place it needs to be loaded, it doesn't have to be on the parameter list. Can you apply or rebuke?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sorry, never mind the apply. I'll do this.

@nvazquez nvazquez modified the milestones: 4.22.2, 4.22.3 Nov 9, 2026

This branch has not been deployed

No deployments
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.

UI extremely slow when db.ha.enabled=true after MySQL source failure (4.22.1.0)

4 participants