mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
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 c85c941470.
Back-patch to all affected branches.
This commit is contained in:
@@ -844,13 +844,6 @@ LockAcquireExtended(const LOCKTAG *locktag,
|
||||
return LOCKACQUIRE_NOT_AVAIL;
|
||||
}
|
||||
|
||||
/*
|
||||
* In Hot Standby perform early deadlock detection in normal backends.
|
||||
* If deadlock found we release partition lock but do not return.
|
||||
*/
|
||||
if (RecoveryInProgress() && !InRecovery)
|
||||
CheckRecoveryConflictDeadlock(partitionLock);
|
||||
|
||||
/*
|
||||
* Set bitmask of locks this process already holds on this object.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user