Skip to content

Commit 3379263

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 b18882a commit 3379263

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
@@ -589,6 +589,7 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
589589
if (!lazy_check_needs_freeze(buf))
590590
{
591591
UnlockReleaseBuffer(buf);
592+
vacrelstats->scanned_pages++;
592593
continue;
593594
}
594595
LockBuffer(buf, BUFFER_LOCK_UNLOCK);

0 commit comments

Comments
 (0)