pgsql: Move CheckRecoveryConflictDeadlock() call to a safer place.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Move CheckRecoveryConflictDeadlock() call to a safer place.
Date: 2011-08-02 19:17:13
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Move CheckRecoveryConflictDeadlock() call to a safer place.

This kluge was inserted in a spot apparently chosen at random: the lock
manager's state is not yet fully set up for the wait, and in particular
LockWaitCancel hasn't been armed by setting lockAwaited, so the ProcLock
will not get cleaned up if the ereport is thrown. This seems to not cause
any observable problem in trivial test cases, because LockReleaseAll will
silently clean up the debris; but I was able to cause failures with tests
involving subtransactions.

Fixes breakage induced by commit c85c941470efc44494fd7a5f426ee85fc65c268c.
Back-patch to all affected branches.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/d3061f036df68d4c495f6db79994b48725936241

Modified Files
--------------
src/backend/storage/ipc/standby.c | 23 ++++++++++++-----------
src/backend/storage/lmgr/lock.c | 7 -------
src/backend/storage/lmgr/proc.c | 9 +++++++++
src/include/storage/standby.h | 2 +-
4 files changed, 22 insertions(+), 19 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-08-02 19:23:15 Re: pgsql: Fix incorrect initialization of ProcGlobal->startupBufferPinWait
Previous Message Simon Riggs 2011-08-02 19:16:06 Re: pgsql: Fix incorrect initialization of ProcGlobal->startupBufferPinWait