Skip to content

Commit 4c697d8

Browse files
committed
Count locked pages that don't need vacuuming as scanned.
Previously, if VACUUM skipped vacuuming a page because it's pinned, it didn't count that page as scanned. However, that meant that relfrozenxid was not bumped up either, which prevented anti-wraparound vacuum from doing its job. Report by Миша Тюрин, analysis and patch by Sergey Burladyn and Jeff Janes. Backpatch to 9.2, where the skip-locked-pages behavior was introduced.
1 parent f901bb5 commit 4c697d8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/backend/commands/vacuumlazy.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
602602
if (!lazy_check_needs_freeze(buf))
603603
{
604604
UnlockReleaseBuffer(buf);
605+
vacrelstats->scanned_pages++;
605606
continue;
606607
}
607608
LockBuffer(buf, BUFFER_LOCK_UNLOCK);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy