mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 18:34:36 +08:00
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.
This commit is contained in:
parent
023430abf7
commit
334445179c
@ -710,7 +710,7 @@ ginvacuumcleanup(PG_FUNCTION_ARGS)
|
||||
LockBuffer(buffer, GIN_SHARE);
|
||||
page = (Page) BufferGetPage(buffer);
|
||||
|
||||
if (GinPageIsDeleted(page))
|
||||
if (PageIsNew(page) || GinPageIsDeleted(page))
|
||||
{
|
||||
Assert(blkno != GIN_ROOT_BLKNO);
|
||||
RecordFreeIndexPage(index, blkno);
|
||||
|
Loading…
Reference in New Issue
Block a user