We had a case recently, where our main DB failed, and we had a failover to the read-replica.
Kratos queries started failing because the DB was unavailable, and after the failover occurred, Kratos re-connected to the read-replica.
Obviously, write queries failed while connected to the read-replica.
But once the main DB was recovered, our Kratos instances kept calling the read-replica, because it keeps DB connections open.
Would it make sense to have a mechanism that regularly closes connections and re-open new ones?
If yes, how could it we do it? ๐ Either only on our side, or also by contributing to the Kratos codebase