Bug #104799 | Support failover on readonly error | ||
---|---|---|---|
Submitted: | 2 Sep 2021 4:09 | Modified: | 2 Mar 2022 17:39 |
Reporter: | Karthik Appigatla (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | Connector / J | Severity: | S4 (Feature request) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[2 Sep 2021 4:09]
Karthik Appigatla
[2 Sep 2021 5:59]
MySQL Verification Team
Hello Karthik, Thank you for the reasonable feature request! regards, Umesh
[29 Sep 2021 11:32]
Filipe Silva
Hi Karthik, Thanks for your interest in MySQL Connector/J. This fail over mechanism was not designed having in mind read/write traffic splitting. For that you have "replication" connections. They too have fail over support and are also highly configurable regarding host switching. Please consult the following documentation: - https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-source-replica-replication-connec... - https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-usagenotes-j2ee-concepts-managing... - https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-usagenotes-j2ee-concepts-load-bal... The feature you want should be possible with this type of connections. Please try it out and let us know if it worked for you.
[30 Oct 2021 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[3 Dec 2021 5:23]
Sundar Ganesh
We tried and tested all the configurations mentioned. However, the problem which we are trying to solve is quite different from the configurations proposed. The configurations mentioned in https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-source-replica-replication-connec... we will need to manually set the connection to RW/ Read-only using conn.setReadOnly(true) before every transaction. The only support for failover is the function promoteReplicaToSource() which needs to called in client application on failover. Our intention is to have the driver perform the failover once it detects that the connection is read only. This will hold true for all the connections. Our proposal is that we are trying to catch the SQL state exception that occurs on read-only and failover irrespective of the transaction state. We could not find any options to do that in the Loadbalancer configuration either. The changes we have proposed FailoverConnectionProxy connection class.
[2 Mar 2022 17:00]
Karthik Appigatla
any update?