allowing VACUUM to be cancelled for conflicting locks - Mailing list pgsql-hackers

From Abhijit Menon-Sen
Subject allowing VACUUM to be cancelled for conflicting locks
Date
Msg-id 20140428101519.GA29392@toroid.org
Whole thread Raw
Responses Re: allowing VACUUM to be cancelled for conflicting locks
List 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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Decrease MAX_BACKENDS to 2^16
Next
From: Heikki Linnakangas
Date:
Subject: Re: Decrease MAX_BACKENDS to 2^16