aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-03-11 09:28:09 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-03-11 09:28:21 +0200
commit407cb6c6589fa2b757c9f2724278ae101749d9f7 (patch)
tree4670c58a7f5676eebd7111be19f356543046ffcf /src
parent348233cb128d32fd3a61f4473eda9564efdcd29c (diff)
downloadpostgresql-407cb6c6589fa2b757c9f2724278ae101749d9f7.tar.gz
postgresql-407cb6c6589fa2b757c9f2724278ae101749d9f7.zip
Set all_visible_according_to_vm correctly with DISABLE_PAGE_SKIPPING
It's important for 'all_visible_according_to_vm' to correctly reflect whether the VM bit is set or not, even when we are not trusting the VM to skip pages, because contrary to what the comment said, lazy_scan_prune() relies on it. If it's incorrectly set to 'false', when the VM bit is in fact set, lazy_scan_prune() will try to set the VM bit again and dirty the page unnecessarily. As a result, if you used DISABLE_PAGE_SKIPPING, all heap pages were dirtied, even if there were no changes. We would also fail to clear any VM bits that were set incorrectly. This was broken in commit 980ae17310, so backpatch to v16. Backpatch-through: 16 Reviewed-by: Melanie Plageman, Peter Geoghegan Discussion: https://www.postgresql.org/message-id/3df2b582-dc1c-46b6-99b6-38eddd1b2784@iki.fi
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/heap/vacuumlazy.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c
index 4eb953f9047..a196a7fe01d 100644
--- a/src/backend/access/heap/vacuumlazy.c
+++ b/src/backend/access/heap/vacuumlazy.c
@@ -1330,11 +1330,7 @@ lazy_scan_skip(LVRelState *vacrel, Buffer *vmbuffer, BlockNumber next_block,
/* DISABLE_PAGE_SKIPPING makes all skipping unsafe */
if (!vacrel->skipwithvm)
- {
- /* Caller shouldn't rely on all_visible_according_to_vm */
- *next_unskippable_allvis = false;
break;
- }
/*
* Aggressive VACUUM caller can't skip pages just because they are