[CONJ-1118] Aurora Single Write Cluster Endpoint can't make Read DB Connection for readonly transaction Created: 2023-10-27 Updated: 2023-11-06 Resolved: 2023-11-06 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | 2.7 compatibility |
| Affects Version/s: | 2.7.10 |
| Fix Version/s: | 2.7.11 |
| Type: | Bug | Priority: | Major |
| Reporter: | choi heesung | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
aws aurora |
||
| Description |
|
I am using AWS Aurora DB using a single write cluster endpoint. read only transaction is not executed in read db, but in write db. "listener.getUrlParser().getHostAddresses()" always returns only the write cluster endpoint defined in the jdbc url string. It seems that the code(inside if statement) below cannot be executed for the same reason as above.
|
| Comments |
| Comment by Diego Dupin [ 2023-10-27 ] | |||||||||||||||
|
Good point, the line before (https://github.com/mariadb-corporation/mariadb-connector-j/blob/32df3852336f372a4d80011b1f0ab466623906a2/src/main/java/org/mariadb/jdbc/internal/protocol/AuroraProtocol.java#L184) will update listener.hostAddresses will retreive all servers from command "select server_id, session_id from information_schema.replica_host_status where last_update_timestamp > now() - INTERVAL 3 MINUTE", but that will be used only AFTER trying to connect replica, not immediatly, using listener.getUrlParser().getHostAddresses() in place of something like listener.getHostAddresses() | |||||||||||||||
| Comment by Diego Dupin [ 2023-10-27 ] | |||||||||||||||
|
Correction is simple, but I don't have access to aurora anymore. Could you test the correction, available as SNAPSHOT ? SNAPSHOTs are available adding sonatype snapshot repo, like:
| |||||||||||||||
| Comment by choi heesung [ 2023-10-28 ] | |||||||||||||||
|
thanks for reply. I tested it. and it was working. |