supavisor icon indicating copy to clipboard operation
supavisor copied to clipboard

PAUSE / RESUME like functionality

Open chasers opened this issue 2 years ago • 1 comments

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

chasers avatar Apr 10 '23 22:04 chasers

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.

NikolayS avatar Apr 10 '23 22:04 NikolayS