agora inbox for pgsql-committers@postgresql.orghelp / color / mirror / Atom feed
pgsql: Introduce macros for WAL block reference IDs of some heap record 4+ messages / 1 participants [nested] [flat]
* pgsql: Introduce macros for WAL block reference IDs of some heap record @ 2026-07-15 21:25 Melanie Plageman <melanieplageman@gmail.com> 0 siblings, 0 replies; 4+ messages in thread From: Melanie Plageman @ 2026-07-15 21:25 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Introduce macros for WAL block reference IDs of some heap record types When registering a buffer with the WAL machinery, the caller assigns it a block reference ID, and replay must read each block back by that same ID. Today these IDs are bare integers assigned by convention (0, 1, 2, ...), which is easy to follow when a record registers a single block, or when the blocks are handled during replay in their registration order. An upcoming bug fix registers up to two visibility map blocks in addition to the heap block(s) when clearing the VM, and these are not handled during replay in a straightforward 1:1, in-registration-order fashion. Relying on bare integers for the block IDs in that case is error-prone. Introduce macros naming the block reference IDs for the heap record types that the upcoming commit extends to register visibility map blocks, so the registration and replay sites refer to the same block by a meaningful name. Author: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Robert Haas <robertmhaas@gmail.com> Discussion: https://postgr.es/m/66mqpfyti3qhfttcsv6r2lbvqqd32rrmpn6i47ovrsnvguts46%40gou54xc; Backpatch through: 17 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/10911fde088aef9c3be511955e9be632964f7a4a Modified Files -------------- src/backend/access/heap/heapam.c | 45 ++++++++++++++++------------ src/backend/access/heap/heapam_xlog.c | 56 ++++++++++++++++++++++------------- src/include/access/heapam_xlog.h | 29 +++++++++++++----- 3 files changed, 84 insertions(+), 46 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Introduce macros for WAL block reference IDs of some heap record @ 2026-07-15 21:32 Melanie Plageman <melanieplageman@gmail.com> 0 siblings, 0 replies; 4+ messages in thread From: Melanie Plageman @ 2026-07-15 21:32 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Introduce macros for WAL block reference IDs of some heap record types When registering a buffer with the WAL machinery, the caller assigns it a block reference ID, and replay must read each block back by that same ID. Today these IDs are bare integers assigned by convention (0, 1, 2, ...), which is easy to follow when a record registers a single block, or when the blocks are handled during replay in their registration order. An upcoming bug fix registers up to two visibility map blocks in addition to the heap block(s) when clearing the VM, and these are not handled during replay in a straightforward 1:1, in-registration-order fashion. Relying on bare integers for the block IDs in that case is error-prone. Introduce macros naming the block reference IDs for the heap record types that the upcoming commit extends to register visibility map blocks, so the registration and replay sites refer to the same block by a meaningful name. Author: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Robert Haas <robertmhaas@gmail.com> Discussion: https://postgr.es/m/66mqpfyti3qhfttcsv6r2lbvqqd32rrmpn6i47ovrsnvguts46%40gou54xc; Backpatch through: 17 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/56bf5fa5d67a0cea97a8b456a3834749b3146f95 Modified Files -------------- src/backend/access/heap/heapam.c | 45 ++++++++++++++++------------ src/backend/access/heap/heapam_xlog.c | 56 ++++++++++++++++++++++------------- src/include/access/heapam_xlog.h | 29 +++++++++++++----- 3 files changed, 84 insertions(+), 46 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Introduce macros for WAL block reference IDs of some heap record @ 2026-07-15 21:38 Melanie Plageman <melanieplageman@gmail.com> 0 siblings, 0 replies; 4+ messages in thread From: Melanie Plageman @ 2026-07-15 21:38 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Introduce macros for WAL block reference IDs of some heap record types When registering a buffer with the WAL machinery, the caller assigns it a block reference ID, and replay must read each block back by that same ID. Today these IDs are bare integers assigned by convention (0, 1, 2, ...), which is easy to follow when a record registers a single block, or when the blocks are handled during replay in their registration order. An upcoming bug fix registers up to two visibility map blocks in addition to the heap block(s) when clearing the VM, and these are not handled during replay in a straightforward 1:1, in-registration-order fashion. Relying on bare integers for the block IDs in that case is error-prone. Introduce macros naming the block reference IDs for the heap record types that the upcoming commit extends to register visibility map blocks, so the registration and replay sites refer to the same block by a meaningful name. Author: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Robert Haas <robertmhaas@gmail.com> Discussion: https://postgr.es/m/66mqpfyti3qhfttcsv6r2lbvqqd32rrmpn6i47ovrsnvguts46%40gou54xc; Backpatch through: 17 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d0fb1da21bbcc7bdf13632cd080628757cd008e3 Modified Files -------------- src/backend/access/heap/heapam.c | 43 ++++++++++++++++----------- src/backend/access/heap/heapam_xlog.c | 56 ++++++++++++++++++++++------------- src/include/access/heapam_xlog.h | 28 +++++++++++++----- 3 files changed, 82 insertions(+), 45 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Introduce macros for WAL block reference IDs of some heap record @ 2026-07-15 21:44 Melanie Plageman <melanieplageman@gmail.com> 0 siblings, 0 replies; 4+ messages in thread From: Melanie Plageman @ 2026-07-15 21:44 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Introduce macros for WAL block reference IDs of some heap record types When registering a buffer with the WAL machinery, the caller assigns it a block reference ID, and replay must read each block back by that same ID. Today these IDs are bare integers assigned by convention (0, 1, 2, ...), which is easy to follow when a record registers a single block, or when the blocks are handled during replay in their registration order. An upcoming bug fix registers up to two visibility map blocks in addition to the heap block(s) when clearing the VM, and these are not handled during replay in a straightforward 1:1, in-registration-order fashion. Relying on bare integers for the block IDs in that case is error-prone. Introduce macros naming the block reference IDs for the heap record types that the upcoming commit extends to register visibility map blocks, so the registration and replay sites refer to the same block by a meaningful name. Author: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Robert Haas <robertmhaas@gmail.com> Discussion: https://postgr.es/m/66mqpfyti3qhfttcsv6r2lbvqqd32rrmpn6i47ovrsnvguts46%40gou54xc; Backpatch through: 17 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7edec8b5784130b9c175cd8f5ab4d029d4502453 Modified Files -------------- src/backend/access/heap/heapam.c | 97 +++++++++++++++++++++++----------------- src/include/access/heapam_xlog.h | 28 +++++++++--- 2 files changed, 77 insertions(+), 48 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2026-07-15 21:44 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-07-15 21:25 pgsql: Introduce macros for WAL block reference IDs of some heap record Melanie Plageman <melanieplageman@gmail.com> 2026-07-15 21:32 pgsql: Introduce macros for WAL block reference IDs of some heap record Melanie Plageman <melanieplageman@gmail.com> 2026-07-15 21:38 pgsql: Introduce macros for WAL block reference IDs of some heap record Melanie Plageman <melanieplageman@gmail.com> 2026-07-15 21:44 pgsql: Introduce macros for WAL block reference IDs of some heap record Melanie Plageman <melanieplageman@gmail.com>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox