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/backend/storage/ipc/procarray.c | |
parent | 4fa69e566cf1b836ae8aa9bee24ab0c556cfe94e (diff) |
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/storage/ipc/procarray.c')
-rw-r--r-- | src/backend/storage/ipc/procarray.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index 1793783cab9..7cd57f31405 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -37,7 +37,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/ipc/procarray.c,v 1.58 2010/01/21 00:53:58 sriggs Exp $ + * $PostgreSQL: pgsql/src/backend/storage/ipc/procarray.c,v 1.59 2010/01/23 16:37:12 sriggs Exp $ * *------------------------------------------------------------------------- */ @@ -1680,15 +1680,13 @@ GetCurrentVirtualXIDs(TransactionId limitXmin, bool excludeXmin0, * latestCompletedXid since doing so would be a performance issue during * normal running, so we check it essentially for free on the standby. * - * If dbOid is valid we skip backends attached to other databases. Some - * callers choose to skipExistingConflicts. + * If dbOid is valid we skip backends attached to other databases. * * Be careful to *not* pfree the result from this function. We reuse * this array sufficiently often that we use malloc for the result. */ VirtualTransactionId * -GetConflictingVirtualXIDs(TransactionId limitXmin, Oid dbOid, - bool skipExistingConflicts) +GetConflictingVirtualXIDs(TransactionId limitXmin, Oid dbOid) { static VirtualTransactionId *vxids; ProcArrayStruct *arrayP = procArray; @@ -1727,9 +1725,6 @@ GetConflictingVirtualXIDs(TransactionId limitXmin, Oid dbOid, if (proc->pid == 0) continue; - if (skipExistingConflicts && proc->recoveryConflictPending) - continue; - if (!OidIsValid(dbOid) || proc->databaseId == dbOid) { @@ -1886,7 +1881,7 @@ CountDBBackends(Oid databaseid) * CancelDBBackends --- cancel backends that are using specified database */ void -CancelDBBackends(Oid databaseid) +CancelDBBackends(Oid databaseid, ProcSignalReason sigmode, bool conflictPending) { ProcArrayStruct *arrayP = procArray; int index; @@ -1899,13 +1894,13 @@ CancelDBBackends(Oid databaseid) { volatile PGPROC *proc = arrayP->procs[index]; - if (proc->databaseId == databaseid) + if (databaseid == InvalidOid || proc->databaseId == databaseid) { VirtualTransactionId procvxid; GET_VXID_FROM_PGPROC(procvxid, *proc); - proc->recoveryConflictPending = true; + proc->recoveryConflictPending = conflictPending; pid = proc->pid; if (pid != 0) { @@ -1913,8 +1908,7 @@ CancelDBBackends(Oid databaseid) * Kill the pid if it's still here. If not, that's what we wanted * so ignore any errors. */ - (void) SendProcSignal(pid, PROCSIG_RECOVERY_CONFLICT_DATABASE, - procvxid.backendId); + (void) SendProcSignal(pid, sigmode, procvxid.backendId); } } } |