node-mysql2
node-mysql2 copied to clipboard
read-only error on aws aurora mysql failover action
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?
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
@itjobs-levi did you find anything to get around the issue, we just faced it twice in the last couple of days
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.