Skip to content

Commit f87bf84

Browse files
committed
Reuse all-zero pages in GIN.
In GIN, an all-zeros page would be leaked forever, and never reused. Just add them to the FSM in vacuum, and they will be reinitialized when grabbed from the FSM. On master and 9.5, attempting to access the page's opaque struct also caused an assertion failure, although that was otherwise harmless. Reported by Jeff Janes. Backpatch to all supported versions.
1 parent 40ad782 commit f87bf84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/access/gin/ginvacuum.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ ginvacuumcleanup(PG_FUNCTION_ARGS)
762762
LockBuffer(buffer, GIN_SHARE);
763763
page = (Page) BufferGetPage(buffer);
764764

765-
if (GinPageIsDeleted(page))
765+
if (PageIsNew(page) || GinPageIsDeleted(page))
766766
{
767767
RecordFreeIndexPage(index, blkno);
768768
totFreePages++;

0 commit comments

Comments
 (0)