From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: maxim.boguk@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8954: Wrong text in database log during "truncate scan"
Date: Fri, 24 Jan 2014 11:29:00 -0300
Message-ID: <20140124142900.GZ10723@eldon.alvh.no-ip.org> (raw)
In-Reply-To: <20140124123717.26701.48436@wrigleys.postgresql.org>
References: <20140124123717.26701.48436@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
maxim.boguk@gmail.com escribió:
> If manual vacuum performed in the table and could not required lock for
> truncate scan it wrote a bit misleading error message:
>
> 2014-01-24 16:19:11 MSK 7134 cron.app@*** from [local] [vxid:297/14422865
> txid:2179070646] [VACUUM] LOG: automatic vacuum of table
> "hh_data.public.vacancy_response": could not (re)acquire exclusive lock for
> truncate scan
This was fixed by this commit:
Author: Kevin Grittner <kgrittn@postgresql.org>
Branch: master Release: REL9_3_BR [5fc893760] 2013-04-29 13:05:26 -0500
Branch: REL9_2_STABLE Release: REL9_2_5 [95909f3be] 2013-04-29 13:05:56 -0500
Branch: REL9_1_STABLE Release: REL9_1_10 [93641341f] 2013-04-29 13:06:28 -0500
Branch: REL9_0_STABLE Release: REL9_0_14 [2751c7f73] 2013-04-29 13:06:49 -0500
Ensure ANALYZE phase is not skipped because of canceled truncate.
Patch b19e4250b45e91c9cbdd18d35ea6391ab5961c8d attempted to
preserve existing behavior regarding statistics generation in the
case that a truncation attempt was canceled due to lock conflicts.
It failed to do this accurately in two regards: (1) autovacuum had
previously generated statistics if the truncate attempt failed to
initially get the lock rather than having started the attempt, and
(2) the VACUUM ANALYZE command had always generated statistics.
Both of these changes were unintended, and are reverted by this
patch. On review, there seems to be consensus that the previous
failure to generate statistics when the truncate was terminated
was more an unfortunate consequence of how that effort was
previously terminated than a feature we want to keep; so this
patch generates statistics even when an autovacuum truncation
attempt terminates early. Another unintended change which is kept
on the basis that it is an improvement is that when a VACUUM
command is truncating, it will the new heuristic for avoiding
blocking other processes, rather than keeping an
AccessExclusiveLock on the table for however long the truncation
takes.
Per multiple reports, with some renaming per patch by Jeff Janes.
Backpatch to 9.0, where problem was created.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
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: alvherre@2ndquadrant.com, maxim.boguk@gmail.com
Subject: Re: BUG #8954: Wrong text in database log during "truncate scan"
In-Reply-To: <20140124142900.GZ10723@eldon.alvh.no-ip.org>
References: <20140124123717.26701.48436@wrigleys.postgresql.org> <20140124142900.GZ10723@eldon.alvh.no-ip.org>
* 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