v24-0002-Add-comment-about-PD_ALL_VISIBLE-and-VM-sync.patch
text/x-patch
Filename: v24-0002-Add-comment-about-PD_ALL_VISIBLE-and-VM-sync.patch
Type: text/x-patch
Part: 1
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v24-0002
Subject: Add comment about PD_ALL_VISIBLE and VM sync
| File | + | − |
|---|---|---|
| src/backend/access/heap/heapam_xlog.c | 6 | 0 |
From 33e063761f30c23ce923ea485eb9cb86acee2d92 Mon Sep 17 00:00:00 2001 From: Melanie Plageman <melanieplageman@gmail.com> Date: Mon, 8 Dec 2025 17:32:49 -0500 Subject: [PATCH v24 02/16] Add comment about PD_ALL_VISIBLE and VM sync The comment above heap_xlog_visible() about the critical integrity requirement for PD_ALL_VISIBLE and the visibility map should also be in heap_xlog_prune_freeze() where we set PD_ALL_VISIBLE. --- src/backend/access/heap/heapam_xlog.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/backend/access/heap/heapam_xlog.c b/src/backend/access/heap/heapam_xlog.c index 11cb3f74da5..a09fb4b803a 100644 --- a/src/backend/access/heap/heapam_xlog.c +++ b/src/backend/access/heap/heapam_xlog.c @@ -157,6 +157,12 @@ heap_xlog_prune_freeze(XLogReaderState *record) /* There should be no more data */ Assert((char *) frz_offsets == dataptr + datalen); + /* + * The critical integrity requirement here is that we must never end + * up with the visibility map bit set and the page-level + * PD_ALL_VISIBLE bit unset. If that were to occur, a subsequent page + * modification would fail to clear the visibility map bit. + */ if (vmflags & VISIBILITYMAP_VALID_BITS) PageSetAllVisible(page); -- 2.43.0