Im thinking of a use case where I want to survive a writer node becoming a reader. I already have connection-init-sql validating this so newly created connections are ok.
I dont want to rely on max lifetime since those are long lived connections.
connection-test-query is executed on every acquisition, and ideally i dont want all acquisitions to have that cost, for rare failover occurences.
The keepalive task is already a backgroud task, and Its my understanding it uses the connection-test-query if present or else the JDBC v4 isValid(), and that on failure will evict the connection. This seems like a good place to cleanup the pool.
Ideally, the isValid() function would be used for connection acquisitions, and the keepalive would use another statement. This implies:
Providing a keepalive-query param, falling back to connection-test-query and isValid() if not present.
Removing the 30s minimum for keep alive task (for more aggressive runs).
Maybe im over thinking this and having the 'writer node check' at every acquisition is fine. But being able to reduce the keep alive task schedule would also help in that case.
Im thinking of a use case where I want to survive a writer node becoming a reader. I already have
connection-init-sql
validating this so newly created connections are ok.I dont want to rely on max lifetime since those are long lived connections.
connection-test-query
is executed on every acquisition, and ideally i dont want all acquisitions to have that cost, for rare failover occurences.The keepalive task is already a backgroud task, and Its my understanding it uses the
connection-test-query
if present or else the JDBC v4isValid()
, and that on failure will evict the connection. This seems like a good place to cleanup the pool.Ideally, the
isValid()
function would be used for connection acquisitions, and the keepalive would use another statement. This implies:keepalive-query
param, falling back toconnection-test-query
andisValid()
if not present.Maybe im over thinking this and having the 'writer node check' at every acquisition is fine. But being able to reduce the keep alive task schedule would also help in that case.