Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
2.7.9
-
None
Description
We are using Maria Driver 2.6.2 version to connect MariaDB and Aurora. For Aurora, we configured the primary DB and ReadOnly replica DB using the 'Aurora' keyword, while for MariaDB, we used the 'Replication' keyword for configuration.
Here are the connection details we used:
MariaDB:
jdbc:mariadb:replication://primary1,replica1/test
Aurora:
jdbc:mariadb:aurora://primary1,replica1/test?SocketTimeout=0
[Problem]
We are experiencing issues when replica1 DB is under heavy load, causing the CPU usage to approach 100%. Even if replica1 DB is in an abnormal state, we expected the primary1 DB to be usable. However, the jdbc driver is unable to establish a connection and gets stuck in a hang state.
[Trial 1]
Setting connectTimeout does not resolve this problem.
[Trial 2]
Setting SocketTimeout to a shorter value could resolve this issue, but we need a very long query execution time, so SocketTimeout=0 is required.
When attempting to create a connection, primary1 is successfully acquired, but replica1 gets stuck in a hang state as it does not receive a response in ReadInitialHandShakePacket(reader).
[Request]
We need a timeout for the process of establishing the connection, including the initialization settings after handshaking. This timeout should not be limited to TCP ConnectTimeout but should include the interval until the initialization settings are completed, as shown in the following section:
https://github.com/mariadb-corporation/mariadb-connector-j/blob/3021f01f1a8b28558f4083ec6b3feb6dea3ee665/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java#L598"