Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAUSE / RESUME like functionality #67

Open
chasers opened this issue Apr 10, 2023 · 1 comment
Open

PAUSE / RESUME like functionality #67

chasers opened this issue Apr 10, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@chasers
Copy link
Contributor

chasers commented Apr 10, 2023

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 chasers added the enhancement New feature or request label Apr 10, 2023
@NikolayS
Copy link

NikolayS commented Apr 10, 2023

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.

@chasers chasers added this to the v1.0.0 milestone Apr 12, 2023
@chasers chasers removed this from the v1.0.0 milestone Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants