postgres.git / summary / log / commit / refs

commit    746e7f1c187b1dae02b049b1918e5471d7fedfb6
Author:   Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date:     Mon Jul 27 09:30:26 2015 +0000
First released in: 9.6.0, 9.0.23, 9.1.19, 9.2.14, 9.3.10, 9.4.5, 9.5.0

    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.


src/backend/access/gin/ginvacuum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/access/gin/ginvacuum.c b/src/backend/access/gin/ginvacuum.c index 0ca6bf8d62d..cc440d93547 100644 --- a/src/backend/access/gin/ginvacuum.c +++ b/src/backend/access/gin/ginvacuum.c @@ -777,7 +777,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); [parent: 579b9f97ce99]