@@ -223,13 +223,13 @@ visibilitymap_pin_ok(BlockNumber heapBlk, Buffer vmbuf)
223
223
* visibilitymap_set - set bit(s) on a previously pinned page
224
224
*
225
225
* recptr is the LSN of the XLOG record we're replaying, if we're in recovery,
226
- * or InvalidXLogRecPtr in normal running. The page LSN is advanced to the
226
+ * or InvalidXLogRecPtr in normal running. The VM page LSN is advanced to the
227
227
* one provided; in normal running, we generate a new XLOG record and set the
228
- * page LSN to that value. cutoff_xid is the largest xmin on the page being
229
- * marked all-visible; it is needed for Hot Standby, and can be
230
- * InvalidTransactionId if the page contains no tuples. It can also be set
231
- * to InvalidTransactionId when a page that is already all-visible is being
232
- * marked all-frozen.
228
+ * page LSN to that value (though the heap page's LSN may *not* be updated;
229
+ * see below). cutoff_xid is the largest xmin on the page being marked
230
+ * all-visible; it is needed for Hot Standby, and can be InvalidTransactionId
231
+ * if the page contains no tuples. It can also be set to InvalidTransactionId
232
+ * when a page that is already all-visible is being marked all-frozen.
233
233
*
234
234
* Caller is expected to set the heap page's PD_ALL_VISIBLE bit before calling
235
235
* this function. Except in recovery, caller should also pass the heap
@@ -289,6 +289,11 @@ visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
289
289
/*
290
290
* If data checksums are enabled (or wal_log_hints=on), we
291
291
* need to protect the heap page from being torn.
292
+ *
293
+ * If not, then we must *not* update the heap page's LSN. In
294
+ * this case, the FPI for the heap page was omitted from the
295
+ * WAL record inserted above, so it would be incorrect to
296
+ * update the heap page's LSN.
292
297
*/
293
298
if (XLogHintBitIsNeeded ())
294
299
{
0 commit comments