-
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
[jdbc-mysql extension] MySQL high availability datasource health check not supported in native Quarkus #7936
Comments
cc @Sanne |
thanks! Haven't tried yet but this should be easy to fix. |
:-) Well, maybe I can place a very similar topic here? Fresh from development, in the same setup com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface com.mysql.cj.jdbc.JdbcPreparedStatement, interface com.mysql.cj.jdbc.JdbcStatement] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles=<comma-separated-config-files> and -H:DynamicProxyConfigurationResources=<comma-separated-config-resources> options., |
@Sanne @SchulteMarkus indeed some proxies registration were missing. I have added them here machi1990@4d87443 but I am still having issues regarding which I'll look at later on:
@Sanne maybe I am missing something? |
@machi1990 Hmm, don't know. Has there anything to be added from package com.mysql.cj.jdbc.ha?! |
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_master: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
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_master: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
@SchulteMarkus I have opened #8052 to fix the issue, can you check it locally if it fixes the issue for you? Thanks. |
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_master: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
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
…tegrations` I stumbled upon this class while trying to understand the cause of an "unrelated" issue in this comment quarkusio#7936 (comment). After running some tests in my dev machine, I think the line of code can be removed.
…tegrations` I stumbled upon this class while trying to understand the cause of an "unrelated" issue in this comment quarkusio#7936 (comment). After running some tests in my dev machine, I think the line of code can be removed.
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
I will do so tomorrow probably. |
Thanks. You may need to build the PR locally, let me know if you'll need some guidance. |
To build Quarkus, just use |
No success building locally (when ext4 is not enough - w00t?!)
But you can be sure I will re-open here once I get the chance to test the updated version. Target release is v1.4.0? :-( I would love to have it in 1.3.1. Too mention an argument - in my opinion, this is more likely a bug (I would expect any jdbc-mysql URL to work) than a feature. |
|
yes I agree, we'll consider backporting. But since 1.3.0 was already released, any new issue targets the next version - that's just the process. |
The fix will be part of 1.3.1.Final. |
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
thanks @gsmet ! |
Hi guys, I have given building Quarkus another chance. Putting it all together: The latest version of Quarkus (commit 9db4713) works fine related to this issue :-) Thanks a lot guys for feedback, and even backporting! |
Yesterday I presented Quarkus including native image to my company. Would not have worked out without your fix. What a timing guys! |
great to hear, thanks @SchulteMarkus ! |
@machi1990 Mysql failover is not working with native image with 1.5.0.Final, below is my DB connectivity URL: Can someone help me here? |
…tegrations` I stumbled upon this class while trying to understand the cause of an "unrelated" issue in this comment quarkusio#7936 (comment). After running some tests in my dev machine, I think the line of code can be removed.
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
Fixes quarkusio/quarkus#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
I am using the jdbc-mysql Quarkus extension for connecting my Quarkus application to a MySQL cluster. My datatsource URL is like:
As you can see, I am using the Connector/J feature
replication
as described on https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-master-slave-replication-connection.htmlWhile this works fine running Quarkus running in JVM, a Quarkus native fails to do the datasource health check.
When running my Quarkus application as a native, the health endpoint returns:
The corresponding exception is
Adding
com.mysql.cj.jdbc.ha.StandardLoadBalanceExceptionChecker
to the reflection-config.json seems to be only the tip of the iceberg, doing so results in exceptions of kindWorkaround
Removing
replication
from the datasource URL "solves" the issue.Environment
The text was updated successfully, but these errors were encountered: