Skip site navigation (1) Skip section navigation (2)

pgsql: Only allow autovacuum to be auto-canceled by a directlyblocked

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Only allow autovacuum to be auto-canceled by a directlyblocked
Date: 2012-07-26 18:30:33
Message-ID: E1SuSpV-0004OT-1W@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Only allow autovacuum to be auto-canceled by a directly blocked process.

In the original coding of the autovacuum cancel feature, commit
acac68b2bcae818bc8803b8cb8cbb17eee8d5e2b, an autovacuum process was
considered a target for cancellation if it was found to hard-block any
process examined in the deadlock search.  This patch tightens the test so
that the autovacuum must directly hard-block the current process.  This
should make the behavior more predictable in general, and in particular
it ensures that an autovacuum will not be canceled with less than
deadlock_timeout grace period.  In the old coding, it was possible for an
autovacuum to be canceled almost instantly, given unfortunate timing of two
or more other processes' lock attempts.

This also justifies the logging methodology in the recent commit
d7318d43d891bd63e82dcfc27948113ed7b1db80; without this restriction, that
patch isn't providing enough information to see the connection of the
canceling process to the autovacuum.  Like that one, patch all the way
back.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/26b438694cc4461f41f2acf54db6bb3d9c1ea940

Modified Files
--------------
src/backend/storage/lmgr/deadlock.c |   48 ++++++++++++++++++++--------------
1 files changed, 28 insertions(+), 20 deletions(-)

pgsql-committers by date

Next:From: Bruce MomjianDate: 2012-07-26 18:32:28
Subject: pgsql: Document that the pg_upgrade user of rsync might want to skipso
Previous:From: Bruce MomjianDate: 2012-07-26 18:30:31
Subject: pgsql: Document that the pg_upgrade user of rsync might want to skipso

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group