aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2010-01-23 16:37:12 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2010-01-23 16:37:12 +0000
commit959ac58c04130d467fb05e63a3ceb8e2ded404c7 (patch)
tree314eeeea7c6c8afa7cbe35bfe5ecde04eff35f71 /src/backend/tcop/postgres.c
parent4fa69e566cf1b836ae8aa9bee24ab0c556cfe94e (diff)
downloadpostgresql-959ac58c04130d467fb05e63a3ceb8e2ded404c7.tar.gz
postgresql-959ac58c04130d467fb05e63a3ceb8e2ded404c7.zip
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.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index e034a4e6501..86d9e3c9847 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.585 2010/01/21 09:30:36 sriggs Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.586 2010/01/23 16:37:12 sriggs Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -2718,6 +2718,18 @@ RecoveryConflictInterrupt(ProcSignalReason reason)
{
switch (reason)
{
+ case PROCSIG_RECOVERY_CONFLICT_BUFFERPIN:
+ /*
+ * If we aren't blocking the Startup process there is
+ * nothing more to do.
+ */
+ if (!HoldingBufferPinThatDelaysRecovery())
+ return;
+
+ MyProc->recoveryConflictPending = true;
+
+ /* Intentional drop through to error handling */
+
case PROCSIG_RECOVERY_CONFLICT_LOCK:
case PROCSIG_RECOVERY_CONFLICT_TABLESPACE:
case PROCSIG_RECOVERY_CONFLICT_SNAPSHOT: