[CONJ-1111] Aurora Read Replica with Cluster endpoint Kill Query Fail. Created: 2023-10-10  Updated: 2023-10-10

Status: Open
Project: MariaDB Connector/J
Component/s: 2.7 compatibility, aurora
Affects Version/s: 2.7.10
Fix Version/s: None

Type: Bug Priority: Major
Reporter: choi heesung Assignee: Diego Dupin
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I'm using Aurora. When using two or more multi replica read db, a problem occurs when sending a kill query when query timeout occurs.
The problem occurs because of Aurora's cluster endpoint policy. Aurora provides a cluster endpoint for read db load balance, and the cluster endpoint's IP connected to DNS changes sequentially.
MariaDB Driver sends a kill query using domain. As a result, a situation occurs where a kill query may be sent to a db other than the db where the actual query is performed.

To solve this problem, I request that the kill query be sent to the IP rather than the domain.

[orginal code]
https://github.com/mariadb-corporation/mariadb-connector-j/blob/28f1269b0df58cd87fbb4fa3e44021e440e34c2f/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1365C29-L1365C29

I request changes as shown below.

copiedProtocol.setHostAddress(new HostAddress(this.getSocket().getInetAddress().getCanonicalHostName(), this.getHostAddress().port, this.getHostAddress().type));



 Comments   
Comment by Diego Dupin [ 2023-10-10 ]

Not talking about unix named pipe and windows PIPE, why using socket.getInetAddress().getCanonicalHostName then in place of socket.getInetAddress().getHostAddress() ?

Comment by choi heesung [ 2023-10-10 ]

my mistake. A better approach would be to use "socket.getInetAddress().getHostAddress()" as you mentioned.

Generated at Thu Feb 08 03:20:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.