supavisor
supavisor copied to clipboard
PAUSE / RESUME like functionality
For draining transactions to a tenant database.
See: https://www.pgbouncer.org/usage.html#admin-console
- optional timeout argument which disconnects database on timeout and prevents new connections from being established
optional timeout argument which disconnects database on timeout and prevents new connections from being established
It would be great to see as well a few params that would allow graceful attempts of PAUSE:
- before trying PAUSE, check pg_stat_activity and ensure that there are no long-running queries (that would block us; "long-running" means running for already M ms).
- when attempting a PAUSE, have N ms timeout – if failed, release // this thing is probably a higher level than one proxy, it should work with multiple proxies, which we supposedly have for HA purposes
- finally, make not more than X attempts. If it reached, terminate sessions that run longer than needed, to be unlocked and succeed with PAUSE.