aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-07-27 12:30:26 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-07-27 12:32:08 +0300
commit746e7f1c187b1dae02b049b1918e5471d7fedfb6 (patch)
treead8a7577edea836bc8ae2362b5d358819d161a4c /src
parent579b9f97ce99c3ddc8e1de0e1b1f160da2e669c7 (diff)
downloadpostgresql-746e7f1c187b1dae02b049b1918e5471d7fedfb6.tar.gz
postgresql-746e7f1c187b1dae02b049b1918e5471d7fedfb6.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/gin/ginvacuum.c2
1 files changed, 1 insertions, 1 deletions
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);