From 38e9f90a227d1e60e7b4691d1a71fefaba6059e5 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Wed, 15 Jun 2016 14:23:39 -0400 Subject: Fix lazy_scan_heap so that it won't mark pages all-frozen too soon. Commit a892234f830e832110f63fc0a2afce2fb21d1584 added a new bit per page to the visibility map fork indicating whether the page is all-frozen, but incorrectly assumed that if lazy_scan_heap chose to freeze a tuple then that tuple would not need to later be frozen again. This turns out to be false, because xmin and xmax (and conceivably xvac, if dealing with tuples from very old releases) could be frozen at separate times. Thanks to Andres Freund for help in uncovering and tracking down this issue. --- src/include/access/heapam_xlog.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/include/access') diff --git a/src/include/access/heapam_xlog.h b/src/include/access/heapam_xlog.h index ad30217cfbf..a822d0b82dc 100644 --- a/src/include/access/heapam_xlog.h +++ b/src/include/access/heapam_xlog.h @@ -386,7 +386,8 @@ extern XLogRecPtr log_heap_freeze(Relation reln, Buffer buffer, extern bool heap_prepare_freeze_tuple(HeapTupleHeader tuple, TransactionId cutoff_xid, TransactionId cutoff_multi, - xl_heap_freeze_tuple *frz); + xl_heap_freeze_tuple *frz, + bool *totally_frozen); extern void heap_execute_freeze_tuple(HeapTupleHeader tuple, xl_heap_freeze_tuple *xlrec_tp); extern XLogRecPtr log_heap_visible(RelFileNode rnode, Buffer heap_buffer, -- cgit v1.2.3