Failover behaviour with Aurora Postgres + Spring Boot + HikariConnectionPool #1058
-
I've been trying to make this setup work but unfortunately am not quite understanding what's happening. I am currently testing multiple failovers. Our understanding is, that you can achieve failover handling with aws-advanced-jdbc-wrapper alone without modifying code.
(I know the naming isn't good but that's not something I chose) So first failover seems to work, we get this:
After which the application has a few more errors but after 3-4 minutes all is great again and everything works.
Seemingly somewhere, it retrieves a read only connection and continues to work with that one forever after.
Are we doing something wrong? Is there something else that needs to be configured? I am a bit confused as to where the read-only connections are coming from. Is this possibly some weird behaviour with internal rds aws failover? Since in the real world, in case of an AZ failure, there would be no more connectivity to the database. In this case, the connection would still be reachable but not be a writer anymore. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The problem was that we use a R53 dns entry pointing to the cluster endpoint. As such you need to specify the clusterInstanceHostPattern to discover the other endpoints. After configuring that, the driver could detect the nodes and properly failover to the writer. |
Beta Was this translation helpful? Give feedback.
The problem was that we use a R53 dns entry pointing to the cluster endpoint. As such you need to specify the clusterInstanceHostPattern to discover the other endpoints. After configuring that, the driver could detect the nodes and properly failover to the writer.