Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 76be0c8

Browse files
Filter recovery conflicts based upon dboid from relfilenode of WAL
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.
1 parent 83fa037 commit 76be0c8

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

src/backend/access/heap/heapam.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.283 2010/01/20 19:43:40 heikki Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.284 2010/01/29 17:10:05 sriggs Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -4139,7 +4139,7 @@ heap_xlog_cleanup_info(XLogRecPtr lsn, XLogRecord *record)
41394139
xl_heap_cleanup_info *xlrec = (xl_heap_cleanup_info *) XLogRecGetData(record);
41404140

41414141
if (InHotStandby)
4142-
ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid);
4142+
ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid, xlrec->node);
41434143

41444144
/*
41454145
* 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)
41714171
* no queries running for which the removed tuples are still visible.
41724172
*/
41734173
if (InHotStandby)
4174-
ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid);
4174+
ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid, xlrec->node);
41754175

41764176
RestoreBkpBlocks(lsn, record, true);
41774177

@@ -4241,7 +4241,7 @@ heap_xlog_freeze(XLogRecPtr lsn, XLogRecord *record)
42414241
* consider the frozen xids as running.
42424242
*/
42434243
if (InHotStandby)
4244-
ResolveRecoveryConflictWithSnapshot(cutoff_xid);
4244+
ResolveRecoveryConflictWithSnapshot(cutoff_xid, xlrec->node);
42454245

42464246
RestoreBkpBlocks(lsn, record, false);
42474247

src/backend/access/nbtree/nbtxlog.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.58 2010/01/14 11:08:00 sriggs Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.59 2010/01/29 17:10:05 sriggs Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -833,7 +833,7 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record)
833833
* here is worth some thought and possibly some effort to
834834
* improve.
835835
*/
836-
ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid);
836+
ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid, xlrec->node);
837837
}
838838

839839
/*

src/backend/storage/ipc/standby.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1994, Regents of the University of California
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/storage/ipc/standby.c,v 1.7 2010/01/23 16:37:12 sriggs Exp $
14+
* $PostgreSQL: pgsql/src/backend/storage/ipc/standby.c,v 1.8 2010/01/29 17:10:05 sriggs Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -232,12 +232,12 @@ ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
232232
}
233233

234234
void
235-
ResolveRecoveryConflictWithSnapshot(TransactionId latestRemovedXid)
235+
ResolveRecoveryConflictWithSnapshot(TransactionId latestRemovedXid, RelFileNode node)
236236
{
237237
VirtualTransactionId *backends;
238238

239239
backends = GetConflictingVirtualXIDs(latestRemovedXid,
240-
InvalidOid);
240+
node.dbNode);
241241

242242
ResolveRecoveryConflictWithVirtualXIDs(backends,
243243
PROCSIG_RECOVERY_CONFLICT_SNAPSHOT);

src/include/storage/standby.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/storage/standby.h,v 1.5 2010/01/23 16:37:12 sriggs Exp $
10+
* $PostgreSQL: pgsql/src/include/storage/standby.h,v 1.6 2010/01/29 17:10:05 sriggs Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -16,13 +16,16 @@
1616

1717
#include "access/xlog.h"
1818
#include "storage/lock.h"
19+
#include "storage/relfilenode.h"
1920

2021
extern int vacuum_defer_cleanup_age;
2122

2223
extern void InitRecoveryTransactionEnvironment(void);
2324
extern void ShutdownRecoveryTransactionEnvironment(void);
2425

25-
extern void ResolveRecoveryConflictWithSnapshot(TransactionId latestRemovedXid);
26+
extern void ResolveRecoveryConflictWithSnapshot(TransactionId latestRemovedXid,
27+
RelFileNode node);
28+
extern void ResolveRecoveryConflictWithRemovedTransactionId(void);
2629
extern void ResolveRecoveryConflictWithTablespace(Oid tsid);
2730
extern void ResolveRecoveryConflictWithDatabase(Oid dbid);
2831

0 commit comments

Comments
 (0)