*
*
* 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
}
/*
- * Handles HEAP_CLEAN record type
+ * Handles HEAP2_CLEAN record type
*/
static void
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);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/heap/pruneheap.c,v 1.23 2010/04/21 17:20:56 sriggs Exp $
+ * $PostgreSQL: pgsql/src/backend/access/heap/pruneheap.c,v 1.24 2010/04/22 02:15:45 sriggs Exp $
*
*-------------------------------------------------------------------------
*/
{
XLogRecPtr recptr;
+ Assert(TransactionIdIsValid(prstate.latestRemovedXid));
recptr = log_heap_clean(relation, buffer,
prstate.redirected, prstate.nredirected,
prstate.nowdead, prstate.ndead,
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.134 2010/04/21 19:53:24 sriggs Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.135 2010/04/22 02:15:45 sriggs Exp $
*
*-------------------------------------------------------------------------
*/
if (rel->rd_istemp || !XLogIsNeeded())
return;
- if (vacrelstats->tuples_deleted > 0)
- {
- Assert(TransactionIdIsValid(vacrelstats->latestRemovedXid));
-
+ /*
+ * No need to write the record at all unless it contains a valid value
+ */
+ if (TransactionIdIsValid(vacrelstats->latestRemovedXid))
(void) log_heap_cleanup_info(rel->rd_node, vacrelstats->latestRemovedXid);
- }
}
/*
* Forget the now-vacuumed tuples, and press on, but be careful
* not to reset latestRemovedXid since we want that value to be valid.
*/
- Assert(TransactionIdIsValid(vacrelstats->latestRemovedXid));
vacrelstats->num_dead_tuples = 0;
vacuumed_pages++;
}