pgsql: Store the deletion horizon XID for a deleted GIN page on the rig

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Store the deletion horizon XID for a deleted GIN page on the rig
Date: 2020-02-09 17:03:12
Message-ID: E1j0pzE-0001O3-2x@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Store the deletion horizon XID for a deleted GIN page on the right page.

Commit b10714080 moved the GinPageSetDeleteXid() call to a spot where
the "page" variable was pointing to the wrong page, causing the XID
to be inserted on a page that's not being deleted, thus allowing later
GinPageIsRecyclable tests to recycle the deleted page too soon.

It might be a good idea to stop using the single "page" variable for
multiple purposes in this function. But for the moment I just moved
the GinPageSetDeleteXid() call down beside the GinPageSetDeleted()
call, which seems like a more logical place for it anyway.

Back-patch to v11, as the faulty patch was. (Fortunately, the bug
hasn't made it into any release yet.)

Discussion: https://postgr.es/m/21620.1581098806@sss.pgh.pa.us

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/baf487123ac5e4990cf17a67c90bc4c8adf6e8f1

Modified Files
--------------
src/backend/access/gin/ginvacuum.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-02-09 17:05:32 Re: pgsql: Fix page modification outside of critical section in GIN
Previous Message Fujii Masao 2020-02-08 03:30:48 Re: pgsql: Fix bug in Tid scan.