aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/heap/heapam.c
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2010-04-22 02:15:45 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2010-04-22 02:15:45 +0000
commit781ec6b75d6f4e89f103f44a31465383ac13c917 (patch)
tree3cd2cd1fcb4ef00cf31c4a00c4293eae77eeb1f2 /src/backend/access/heap/heapam.c
parent95a777c612c6dcebe2f17c57c35f7e7c93714484 (diff)
downloadpostgresql-781ec6b75d6f4e89f103f44a31465383ac13c917.tar.gz
postgresql-781ec6b75d6f4e89f103f44a31465383ac13c917.zip
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.
Diffstat (limited to 'src/backend/access/heap/heapam.c')
-rw-r--r--src/backend/access/heap/heapam.c10
1 files changed, 7 insertions, 3 deletions
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);