From 781ec6b75d6f4e89f103f44a31465383ac13c917 Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Thu, 22 Apr 2010 02:15:45 +0000 Subject: Further reductions in Hot Standby conflict processing. These come from the realistion that HEAP2_CLEAN records don't always remove user visible data, so conflict processing for them can be skipped. Confirm validity using Assert checks, clarify circumstances under which we log heap_cleanup_info records. Tuning arises from bug fixing of earlier safety check failures. --- src/backend/access/heap/heapam.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/backend/access/heap/heapam.c') diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 1f26faa2ee0..93848942c7f 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.288 2010/02/26 02:00:33 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.289 2010/04/22 02:15:45 sriggs Exp $ * * * INTERFACE ROUTINES @@ -4106,7 +4106,7 @@ heap_xlog_cleanup_info(XLogRecPtr lsn, XLogRecord *record) } /* - * Handles HEAP_CLEAN record type + * Handles HEAP2_CLEAN record type */ static void heap_xlog_clean(XLogRecPtr lsn, XLogRecord *record) @@ -4126,8 +4126,12 @@ heap_xlog_clean(XLogRecPtr lsn, XLogRecord *record) /* * We're about to remove tuples. In Hot Standby mode, ensure that there's * no queries running for which the removed tuples are still visible. + * + * Not all HEAP2_CLEAN records remove tuples with xids, so we only want + * to conflict on the records that cause MVCC failures for user queries. + * If latestRemovedXid is invalid, skip conflict processing. */ - if (InHotStandby) + if (InHotStandby && TransactionIdIsValid(xlrec->latestRemovedXid)) ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid, xlrec->node); -- cgit v1.2.3