diff options
author | Simon Riggs <simon@2ndQuadrant.com> | 2010-01-23 16:37:12 +0000 |
---|---|---|
committer | Simon Riggs <simon@2ndQuadrant.com> | 2010-01-23 16:37:12 +0000 |
commit | 959ac58c04130d467fb05e63a3ceb8e2ded404c7 (patch) | |
tree | 314eeeea7c6c8afa7cbe35bfe5ecde04eff35f71 /src/include/storage/proc.h | |
parent | 4fa69e566cf1b836ae8aa9bee24ab0c556cfe94e (diff) | |
download | postgresql-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/include/storage/proc.h')
-rw-r--r-- | src/include/storage/proc.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 50500903245..5a4421bfa5c 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.118 2010/01/16 10:05:50 sriggs Exp $ + * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.119 2010/01/23 16:37:12 sriggs Exp $ * *------------------------------------------------------------------------- */ @@ -16,7 +16,7 @@ #include "storage/lock.h" #include "storage/pg_sema.h" - +#include "utils/timestamp.h" /* * Each backend advertises up to PGPROC_MAX_CACHED_SUBXIDS TransactionIds @@ -145,6 +145,8 @@ typedef struct PROC_HDR /* The proc of the Startup process, since not in ProcArray */ PGPROC *startupProc; int startupProcPid; + /* Buffer id of the buffer that Startup process waits for pin on */ + int startupBufferPinWaitBufId; } PROC_HDR; /* @@ -177,6 +179,8 @@ extern void InitProcessPhase2(void); extern void InitAuxiliaryProcess(void); extern void PublishStartupProcessInformation(void); +extern void SetStartupBufferPinWaitBufId(int bufid); +extern int GetStartupBufferPinWaitBufId(void); extern bool HaveNFreeProcs(int n); extern void ProcReleaseLocks(bool isCommit); @@ -194,4 +198,8 @@ extern bool enable_sig_alarm(int delayms, bool is_statement_timeout); extern bool disable_sig_alarm(bool is_statement_timeout); extern void handle_sig_alarm(SIGNAL_ARGS); +extern bool enable_standby_sig_alarm(long delay_s, int delay_us, TimestampTz fin_time); +extern bool disable_standby_sig_alarm(void); +extern void handle_standby_sig_alarm(SIGNAL_ARGS); + #endif /* PROC_H */ |