From: Bruce Momjian <bruce@momjian.us>
To: maciek@heroku.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13002: VACUUM to prevent wraparound blocks TRUNCATE
Date: Wed, 8 Apr 2015 15:09:54 -0400
Message-ID: <20150408190954.GC22805@momjian.us> (raw)
In-Reply-To: <20150408184155.26383.16053@wrigleys.postgresql.org>
References: <20150408184155.26383.16053@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On Wed, Apr 8, 2015 at 06:41:55PM +0000, maciek@heroku.com wrote:
> The following bug has been logged on the website:
>
> Bug reference: 13002
> Logged by: Maciek Sakrejda
> Email address: maciek@heroku.com
> PostgreSQL version: 9.3.6
> Operating system: Ubuntu 14.04
> Description:
>
> If autovacuum is running a VACUUM to prevent wraparound on a certain table,
> it looks like it blocks TRUNCATE of that table, which would obviate the need
> for the VACUUM in the first place (and could happen much more quickly). This
> seems like a usability wart at best--one has to instead kill the autovacuum
> (e.g., via pg_cancel_backend) and then TRUNCATE. This is especially
> inconvenient when the user trying to truncate does not have permission to
> kill (or even see!) the wraparound VACUUM. Would it be possible to have
> autovacuum yield to a TRUNCATE in this situation?
My guess is this would be hard to do. VACUUM and TRUNCATE request
conflicting locks, so you would have to embed in the locking code that
the _outcome_ of one should allow it to override the lock of the other.
I can't think of anywhere that we allow that. Frankly, you can't really
just ignore the lock --- you would have to cancel the vacuum by sending
a signal or something. I know we have cases where vacuum aborts if it
can't get a lock or something, but I can't remembrer any case where we
externally cancel vacuum like that.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ Everyone has their own god. +
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: bruce@momjian.us, maciek@heroku.com
Subject: Re: BUG #13002: VACUUM to prevent wraparound blocks TRUNCATE
In-Reply-To: <20150408190954.GC22805@momjian.us>
References: <20150408184155.26383.16053@wrigleys.postgresql.org> <20150408190954.GC22805@momjian.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox