node-mysql2 icon indicating copy to clipboard operation
node-mysql2 copied to clipboard

read-only error on aws aurora mysql failover action

Open itjobs-levi opened this issue 2 years ago • 3 comments

When failover of aws aurora mysql occurs, "The MySQL server is running with the --read-only option so it cannot execute this statement" error occurs frequently. I think it is a temporary phenomenon caused by the promotion of the read node. However, the nodejs connection pool continuously tries to write to the read node. It could be that the previous write node was accessed by aws aurora endpoint dns caching. When aws aurora failover occurs, we have to restart the application to be called as a normal writing node. Is there any workaround for this issue?

itjobs-levi avatar Jun 07 '23 08:06 itjobs-levi

I also encountered this. Seem like the jdbc friver for Java is doing a better job at this https://github.com/awslabs/aws-mysql-jdbc#the-aws-jdbc-driver-failover-process

anton-zen avatar Jul 24 '23 00:07 anton-zen

@itjobs-levi did you find anything to get around the issue, we just faced it twice in the last couple of days

Rayyan98 avatar May 17 '24 21:05 Rayyan98

I haven't found a solution to this problem :( Since we are using nodejs, the java jdbc driver did not provide insight. We designed it so that failovers rarely occur and that when a failover occurs, the application can be recovered and run.

itjobs-levi avatar May 20 '24 01:05 itjobs-levi