Re: pgsql: Fix handling of all-zero pages in SP-GiST vacuum.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Fix handling of all-zero pages in SP-GiST vacuum.
Date: 2015-07-27 15:36:51
Message-ID: 27183.1438011411@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi> writes:
> Fix handling of all-zero pages in SP-GiST vacuum.

I'm a little bit uncomfortable with the way that this patch presumes that
PageIsEmpty (a) is safe on an all-zeroes page and (b) will return true for
such a page. Yes, it does work at the moment; but I don't think we are
making such an assumption anyplace else, and in view of your other two
concurrent patches, it doesn't seem very future-proof here either.
I recommend that the code look more like

if (!SpGistBlockIsRoot(blkno))
{
if (PageIsNew(page) || PageIsEmpty(page))

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-07-27 15:37:01 pgsql: Fix memory leak in xlogreader facility.
Previous Message Heikki Linnakangas 2015-07-27 15:15:15 pgsql: Avoid calling PageGetSpecialPointer() on an all-zeros page.