summaryrefslogtreecommitdiff
path: root/src/backend/storage/lmgr/lock.c
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2010-01-31 19:01:11 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2010-01-31 19:01:11 +0000
commitc85c941470efc44494fd7a5f426ee85fc65c268c (patch)
tree0f75f2e13b828e152a42cd0447f29096756e3aa0 /src/backend/storage/lmgr/lock.c
parent034fffbf31be42c789f4a5fbe2edb62e4b07fa9c (diff)
downloadpostgresql-c85c941470efc44494fd7a5f426ee85fc65c268c.tar.gz
Detect early deadlock in Hot Standby when Startup is already waiting. First
stage of required deadlock detection to allow re-enabling max_standby_delay setting of -1, which is now essential in the absence of improved relation- specific conflict resoluton. Requested by Greg Stark et al.
Diffstat (limited to 'src/backend/storage/lmgr/lock.c')
-rw-r--r--src/backend/storage/lmgr/lock.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c
index cbc2070c37..c59355cfc2 100644
--- a/src/backend/storage/lmgr/lock.c
+++ b/src/backend/storage/lmgr/lock.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/lmgr/lock.c,v 1.193 2010/01/29 19:45:12 sriggs Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/lmgr/lock.c,v 1.194 2010/01/31 19:01:11 sriggs Exp $
*
* NOTES
* A lock table is a shared memory hash table. When
@@ -815,6 +815,13 @@ LockAcquireExtended(const LOCKTAG *locktag,
}
/*
+ * 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.
*/
MyProc->heldLocks = proclock->holdMask;