]> granicus.if.org Git - postgresql/commit
Move CheckRecoveryConflictDeadlock() call to a safer place.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 2 Aug 2011 19:16:44 +0000 (15:16 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 2 Aug 2011 19:16:44 +0000 (15:16 -0400)
commitd3061f036df68d4c495f6db79994b48725936241
tree9e1eaa9363d949a62aa95faf655ef05e7d4d20db
parent0f904c95a4000caa717868d9bfaf5a423eefdb0b
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.
src/backend/storage/ipc/standby.c
src/backend/storage/lmgr/lock.c
src/backend/storage/lmgr/proc.c
src/include/storage/standby.h