]> granicus.if.org Git - postgresql/commitdiff
Filter recovery conflicts based upon dboid from relfilenode of WAL
authorSimon Riggs <simon@2ndQuadrant.com>
Fri, 29 Jan 2010 17:10:05 +0000 (17:10 +0000)
committerSimon Riggs <simon@2ndQuadrant.com>
Fri, 29 Jan 2010 17:10:05 +0000 (17:10 +0000)
records for heap and btree. Minor change, mostly API changes to
pass through the required values. This is a simple change though
also provides the refactoring required for further enhancements
to conflict processing using the relOid. Changes only have effect
during Hot Standby.

src/backend/access/heap/heapam.c
src/backend/access/nbtree/nbtxlog.c
src/backend/storage/ipc/standby.c
src/include/storage/standby.h

index ce661a8d1b37dd2620f0added470e600e422439d..45912825a123fb0cf0b6bb40231fcceed03923d1 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.283 2010/01/20 19:43:40 heikki Exp $
+ *       $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.284 2010/01/29 17:10:05 sriggs Exp $
  *
  *
  * INTERFACE ROUTINES
@@ -4139,7 +4139,7 @@ heap_xlog_cleanup_info(XLogRecPtr lsn, XLogRecord *record)
        xl_heap_cleanup_info *xlrec = (xl_heap_cleanup_info *) XLogRecGetData(record);
 
        if (InHotStandby)
-               ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid);
+               ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid, xlrec->node);
 
        /*
         * Actual operation is a no-op. Record type exists to provide a means
@@ -4171,7 +4171,7 @@ heap_xlog_clean(XLogRecPtr lsn, XLogRecord *record, bool clean_move)
         * no queries running for which the removed tuples are still visible.
         */
        if (InHotStandby)
-               ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid);
+               ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid, xlrec->node);
 
        RestoreBkpBlocks(lsn, record, true);
 
@@ -4241,7 +4241,7 @@ heap_xlog_freeze(XLogRecPtr lsn, XLogRecord *record)
         * consider the frozen xids as running.
         */
        if (InHotStandby)
-               ResolveRecoveryConflictWithSnapshot(cutoff_xid);
+               ResolveRecoveryConflictWithSnapshot(cutoff_xid, xlrec->node);
 
        RestoreBkpBlocks(lsn, record, false);
 
index 9e2ebd9a9f5fd70e3da06ebb515d9c2328c39cc9..f83b3188125ec5b47320b385c5c6bcb0a9b122fe 100644 (file)
@@ -8,7 +8,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.58 2010/01/14 11:08:00 sriggs Exp $
+ *       $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.59 2010/01/29 17:10:05 sriggs Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -833,7 +833,7 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record)
                 * here is worth some thought and possibly some effort to
                 * improve.
                 */
-               ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid);
+               ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid, xlrec->node);
        }
 
        /*
index f079dba8dcf4fe885c1d9ac202bce0ba26ad7b3b..54d3520f85256d03a344cb64d663d24c49f00672 100644 (file)
@@ -11,7 +11,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/storage/ipc/standby.c,v 1.7 2010/01/23 16:37:12 sriggs Exp $
+ *       $PostgreSQL: pgsql/src/backend/storage/ipc/standby.c,v 1.8 2010/01/29 17:10:05 sriggs Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -232,12 +232,12 @@ ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
 }
 
 void
-ResolveRecoveryConflictWithSnapshot(TransactionId latestRemovedXid)
+ResolveRecoveryConflictWithSnapshot(TransactionId latestRemovedXid, RelFileNode node)
 {
        VirtualTransactionId *backends;
 
        backends = GetConflictingVirtualXIDs(latestRemovedXid,
-                                                                                InvalidOid);
+                                                                                node.dbNode);
 
        ResolveRecoveryConflictWithVirtualXIDs(backends,
                                                                                   PROCSIG_RECOVERY_CONFLICT_SNAPSHOT);
index e12798045ae0047b3f1a836c89b69536097d687c..b8bdb26b9bd7e8ba14e334c89a85c8d4aa6da32c 100644 (file)
@@ -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/standby.h,v 1.5 2010/01/23 16:37:12 sriggs Exp $
+ * $PostgreSQL: pgsql/src/include/storage/standby.h,v 1.6 2010/01/29 17:10:05 sriggs Exp $
  *
  *-------------------------------------------------------------------------
  */
 
 #include "access/xlog.h"
 #include "storage/lock.h"
+#include "storage/relfilenode.h"
 
 extern int     vacuum_defer_cleanup_age;
 
 extern void InitRecoveryTransactionEnvironment(void);
 extern void ShutdownRecoveryTransactionEnvironment(void);
 
-extern void ResolveRecoveryConflictWithSnapshot(TransactionId latestRemovedXid);
+extern void ResolveRecoveryConflictWithSnapshot(TransactionId latestRemovedXid,
+                                                                                               RelFileNode node);
+extern void ResolveRecoveryConflictWithRemovedTransactionId(void);
 extern void ResolveRecoveryConflictWithTablespace(Oid tsid);
 extern void ResolveRecoveryConflictWithDatabase(Oid dbid);