-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix MySQL high availability not working in native mode #8052
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not my wheelhouse, so I'll leave the review to others who know much about the topic
337e21a
to
92828c6
Compare
… in native mode Make sure that abandoned threads are cleaned up even in native mode using the same algorithm used in JVM 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
Merged, thanks. Nice work! |
Great thanks. |
I backported the second commit. |
Thanks @gsmet |
Solves my problem. |
Thanks for confirming! |
@SchulteMarkus , thanks for testing and confirming. |
Failover with mysql is not working in 1.5.0.Final, can someone help? |
Fixes #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:
And on another terminal tab, run the following command:
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:Then running
Should pass successfully which was not the case previously as it was throwing missing proxy registration errors.
@SchulteMarkus can you check if this fixes the error for you?
PS: The first commit adds connection clean up in native mode. Let me know what you think about it?
/cc @Sanne @geoand @gsmet