There's more...
At this point, the RECONNECT command and related server_fast_close parameter probably seem extremely handy. However, the process for doing this is also completely asynchronous.
Imagine we want to perform some maintenance on pgha1 and have issued the RECONNECT command. How do we know all client sessions have finally been redirected to the new target server? We could connect to the pgbouncer admin database and repeatedly issue SHOW SERVER commands, but that's highly inconvenient.
Instead, we should use the new WAIT_CLOSE command. This command will not return until all connections have cleared their close_needed flag. This makes it a perfect tool to pause until all sessions have completed a transition from one PostgreSQL server ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access