allowing VACUUM to be cancelled for conflicting locks

From: Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: allowing VACUUM to be cancelled for conflicting locks
Date: 2014-04-28 10:15:19
Message-ID: 20140428101519.GA29392@toroid.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.

In the past, we've had situations where "everything is hung" turned out
to be because of a script that ran manual VACUUM that was holding some
lock. It's admittedly not a huge problem, but it might be useful if a
manual VACUUM could be cancelled the way autovacuum can be.

One way to do this would be to add an "allow_vacuum_cancel" GUC that, if
set, would cause VACUUM to set the (suitably renamed) PROC_IS_AUTOVACUUM
flag on its own process. Another would be to add an extra option to the
VACUUM command that enables this behaviour.

The former has the advantage of being backwards-compatible with existing
scripts that run manual VACUUM. The latter is arguably nicer.

Any thoughts?

-- Abhijit

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-04-28 10:32:45 Re: Decrease MAX_BACKENDS to 2^16
Previous Message Andres Freund 2014-04-28 09:39:09 Re: Decrease MAX_BACKENDS to 2^16