From: Simon Riggs Date: Mon, 5 Oct 2009 10:04:52 +0000 (+0100) Subject: Apply changes from Heikki's patch 001-Remove-some-dead-code... etc X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=9570e3e611c4ed72dde786e13391b022a422d01c;p=users%2Fsimon%2Fpostgres.git Apply changes from Heikki's patch 001-Remove-some-dead-code... etc Minor comment editing by me --- diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index daee07b71f..9d3f29e90f 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -377,7 +377,6 @@ ProcArrayClearTransaction(PGPROC *proc) proc->lxid = InvalidLocalTransactionId; proc->xmin = InvalidTransactionId; proc->recoveryConflictMode = 0; - proc->recoveryConflictLSN = InvalidXLogRecPtr; /* redundant, but just in case */ proc->vacuumFlags &= ~PROC_VACUUM_STATE_MASK; @@ -1336,14 +1335,9 @@ GetRunningTransactionData(void) numHeldLocks += proc->numHeldLocks; /* - * Save subtransaction XIDs. - * - * The other backend can add more subxids concurrently, but cannot - * remove any. Hence it's important to fetch nxids just once. Should - * be safe to use memcpy, though. (We needn't worry about missing any - * xids added concurrently, because they must postdate xmax.) - * - * Again, our own XIDs *are* included in the snapshot. + * Save subtransaction XIDs. Other backends can't remove entries while + * we are holding ProcArrayLock, nor add new entries because we hold + * hold XidGenLock. */ nxids = proc->subxids.nxids; diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c index b1d546ce8d..6569b5fcad 100644 --- a/src/backend/utils/cache/inval.c +++ b/src/backend/utils/cache/inval.c @@ -1580,13 +1580,7 @@ ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist, * Note that this is an atomic change and requires no locking. */ if (proc->recoveryConflictMode < cancel_mode) - { - if (cancel_mode == ERROR && - XLByteLT(proc->recoveryConflictLSN, conflict_lsn)) - proc->recoveryConflictLSN = conflict_lsn; - proc->recoveryConflictMode = cancel_mode; - } /* * Do we expect it to talk? No, Mr. Bond, we expect it to die. diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 57294829e6..c1220011c1 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -99,12 +99,9 @@ struct PGPROC int numHeldLocks; /* Number of AccessExclusiveLocks held by * current backend. */ /* - * InHotStandby mode, the lsn of the first conflict, if any. - * Any block seen with changes made after this lsn will trigger - * query cancelation. Always set recoveryConflictCancelMode after - * setting conflictLSN so we can check this without spin locking. + * While in Hot Standby mode, setting recoveryConflictMode instructs the + * backend to commit suicide. */ - XLogRecPtr recoveryConflictLSN; int recoveryConflictMode; /* Info about LWLock the process is currently waiting for, if any. */