mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
In HS, Startup process sets SIGALRM when waiting for buffer pin. If
woken by alarm we send SIGUSR1 to all backends requesting that they check to see if they are blocking Startup process. If so, they throw ERROR/FATAL as for other conflict resolutions. Deadlock stop gap removed. max_standby_delay = -1 option removed to prevent deadlock.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lock.c,v 1.190 2010/01/02 16:57:52 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lock.c,v 1.191 2010/01/23 16:37:12 sriggs Exp $
|
||||
*
|
||||
* NOTES
|
||||
* A lock table is a shared memory hash table. When
|
||||
@@ -814,25 +814,6 @@ LockAcquireExtended(const LOCKTAG *locktag,
|
||||
return LOCKACQUIRE_NOT_AVAIL;
|
||||
}
|
||||
|
||||
/*
|
||||
* In Hot Standby we abort the lock wait if Startup process is waiting
|
||||
* since this would result in a deadlock. The deadlock occurs because
|
||||
* if we are waiting it must be behind an AccessExclusiveLock, which
|
||||
* can only clear when a transaction completion record is replayed.
|
||||
* If Startup process is waiting we never will clear that lock, so to
|
||||
* wait for it just causes a deadlock.
|
||||
*/
|
||||
if (RecoveryInProgress() && !InRecovery &&
|
||||
locktag->locktag_type == LOCKTAG_RELATION)
|
||||
{
|
||||
LWLockRelease(partitionLock);
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_T_R_DEADLOCK_DETECTED),
|
||||
errmsg("possible deadlock detected"),
|
||||
errdetail("process conflicts with recovery - please resubmit query later"),
|
||||
errdetail_log("process conflicts with recovery")));
|
||||
}
|
||||
|
||||
/*
|
||||
* Set bitmask of locks this process already holds on this object.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user