Re: Vacuum full connection exhaustion

David Rowley <dgrowleyml@gmail.com>

From: David Rowley <dgrowleyml@gmail.com>
To: Christophe Pettus <xof@thebuild.com>
Cc: Costa Alexoglou <costa@dbtune.com>, pgsql-general@lists.postgresql.org
Date: 2024-08-08T23:02:19Z
Lists: pgsql-general
On Fri, 9 Aug 2024 at 02:12, Christophe Pettus <xof@thebuild.com> wrote:
> VACUUM FULL takes an exclusive lock on the table that it is operating on.  It's possible that a connection becomes blocked on that exclusive lock waiting for the VACUUM FULL to finish, the application sees the connection stopped and fires up another one (this is common in container-based applications), that one blocks... until all of the connections are full of queries waiting on that VACUUM FULL.

I also imagine this is the cause. One way to test would be to do:
BEGIN; LOCK TABLE <name of table>; and see if the connections pile up
in a similar way to when the VACUUM FULL command is used.

David