mirror of
https://github.com/postgres/postgres.git
synced 2025-12-13 14:22:43 +03:00
Add comment about keeping PD_ALL_VISIBLE and VM in 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.
Oversight in add323da40
Author: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/flat/CAAKRu_ZMw6Npd_qm2KM%2BFwQ3cMOMx1Dh3VMhp8-V7SOLxdK9-g%40mail.gmail.com
This commit is contained in:
@@ -157,6 +157,12 @@ heap_xlog_prune_freeze(XLogReaderState *record)
|
|||||||
/* There should be no more data */
|
/* There should be no more data */
|
||||||
Assert((char *) frz_offsets == dataptr + datalen);
|
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)
|
if (vmflags & VISIBILITYMAP_VALID_BITS)
|
||||||
PageSetAllVisible(page);
|
PageSetAllVisible(page);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user