Apply changes from Heikki's patch 001-Remove-some-dead-code... etc
authorSimon Riggs <[email protected]>
Mon, 5 Oct 2009 10:04:52 +0000 (11:04 +0100)
committerSimon Riggs <[email protected]>
Mon, 5 Oct 2009 10:04:52 +0000 (11:04 +0100)
Minor comment editing by me

src/backend/storage/ipc/procarray.c
src/backend/utils/cache/inval.c
src/include/storage/proc.h

index daee07b71fd85ac63b90cc5dc59d5d3269693de8..9d3f29e90f68d0c30f94f128284e3bf4725c5eb6 100644 (file)
@@ -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;
 
index b1d546ce8dd947a3d2f8229f963fdd67fd70bafb..6569b5fcad081bd1bce8552e9d114bd841090cd6 100644 (file)
@@ -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.
index 57294829e6bc9469128c672255c3e4d63c8636b7..c1220011c117c2b62db80690fe24cc07d673d541 100644 (file)
@@ -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. */