Remove unused check in heap_xlog_insert()
authorMelanie Plageman <[email protected]>
Thu, 26 Jun 2025 19:03:48 +0000 (15:03 -0400)
committerMelanie Plageman <[email protected]>
Thu, 26 Jun 2025 19:03:48 +0000 (15:03 -0400)
8e03eb92e9a reverted the commit 39b66a91bd which allowed freezing
in the heap_insert() code path but forgot to remove the corresponding
check in heap_xlog_insert(). This code is extraneous but not harmful.
However, cleaning it up makes it very clear that, as of now, we do not
support any freezing of pages in the heap_insert() path.

Author: Melanie Plageman <[email protected]>
Reviewed-by: Tomas Vondra <[email protected]>
Discussion: https://postgr.es/m/flat/CAAKRu_Zp4Pi-t51OFWm1YZ-cctDfBhHCMZ%3DEx6PKxv0o8y2GvA%40mail.gmail.com
Backpatch-through: 14

src/backend/access/heap/heapam_xlog.c

index 30f4c2d3c671937bd1ddb85baead1ec13103c09e..eb4bd3d6ae3a3cd4281a1e4c03326b4b2403c37e 100644 (file)
@@ -438,6 +438,9 @@ heap_xlog_insert(XLogReaderState *record)
    ItemPointerSetBlockNumber(&target_tid, blkno);
    ItemPointerSetOffsetNumber(&target_tid, xlrec->offnum);
 
+   /* No freezing in the heap_insert() code path */
+   Assert(!(xlrec->flags & XLH_INSERT_ALL_FROZEN_SET));
+
    /*
     * The visibility map may need to be fixed even if the heap page is
     * already up-to-date.
@@ -508,10 +511,6 @@ heap_xlog_insert(XLogReaderState *record)
        if (xlrec->flags & XLH_INSERT_ALL_VISIBLE_CLEARED)
            PageClearAllVisible(page);
 
-       /* XLH_INSERT_ALL_FROZEN_SET implies that all tuples are visible */
-       if (xlrec->flags & XLH_INSERT_ALL_FROZEN_SET)
-           PageSetAllVisible(page);
-
        MarkBufferDirty(buffer);
    }
    if (BufferIsValid(buffer))