From 959ac58c04130d467fb05e63a3ceb8e2ded404c7 Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Sat, 23 Jan 2010 16:37:12 +0000 Subject: 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. --- src/backend/tcop/postgres.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/backend/tcop/postgres.c') 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: -- cgit v1.2.3