forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(jdbc-mysql): MySQL high availability not working in native mode
Fixes quarkusio#7936 I was able to reproduce the error and adding the missing proxy registration fixed it. To test the fix, using the below mysql replication setup: ``` docker run \ --name mysql_primary \ -p 3306:3306 \ -e MYSQL_ROOT_PASSWORD=hibernate_orm_test \ -e MYSQL_USER=hibernate_orm_test \ -e MYSQL_PASSWORD=hibernate_orm_test \ -e MYSQL_DATABASE=hibernate_orm_test \ -e REPLICATION_USER=hibernate_orm_test \ -e REPLICATION_PASSWORD=hibernate_orm_test \ actency/docker-mysql-replication:5.7 ``` And on another terminal tab, run the following command: ``` docker run \ --name mysql_secondary \ -p 3307:3306 \ -e MYSQL_ROOT_PASSWORD=hibernate_orm_test \ -e MYSQL_USER=hibernate_orm_test \ -e MYSQL_PASSWORD=hibernate_orm_test \ -e MYSQL_DATABASE=hibernate_orm_test \ -e REPLICATION_USER=hibernate_orm_test \ -e REPLICATION_PASSWORD=hibernate_orm_test \ --link mysql_primary:master \ actency/docker-mysql-replication:5.7 ``` Open another terminal tab and launch jdbc-mysql integration tests with the following command `cd integration-tests/jpa-mysql` and then open the configuration file and edit the jdbc url so that it points to: ``` jdbc:mysql:replication://localhost:3306,localhost:3307/hibernate_orm_test?connectTimeout=5000&socketTimeout=5000&retriesAllDown=3&allowMasterDownConnections=true&allowSlaveDownConnections=true&loadBalanceBlacklistTimeout=10000&readFromMasterWhenNoSlaves=true` ``` Then running ``` mvn clean install -Dnative -Dtest-mysql ``` Should pass successfully which was not the case previously as it was throwing missing proxy registration errors
- Loading branch information
1 parent
82843ef
commit 5ac595c
Showing
2 changed files
with
78 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters