Skip to content

Commit b107140

Browse files
committed
Fix page modification outside of critical section in GIN
By oversight 52ac6cd makes ginDeletePage() sets pd_prune_xid of page to be deleted before entering the critical section. It appears that only versions 11 and later were affected by this oversight. Backpatch-through: 11
1 parent 32ca32d commit b107140

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/access/gin/ginvacuum.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@ ginDeletePage(GinVacuumState *gvs, BlockNumber deleteBlkno, BlockNumber leftBlkn
153153
page = BufferGetPage(dBuffer);
154154
rightlink = GinPageGetOpaque(page)->rightlink;
155155

156-
/* For deleted page remember last xid which could knew its address */
157-
GinPageSetDeleteXid(page, ReadNewTransactionId());
158-
159156
/*
160157
* Any insert which would have gone on the leaf block will now go to its
161158
* right sibling.
@@ -168,6 +165,9 @@ ginDeletePage(GinVacuumState *gvs, BlockNumber deleteBlkno, BlockNumber leftBlkn
168165
page = BufferGetPage(lBuffer);
169166
GinPageGetOpaque(page)->rightlink = rightlink;
170167

168+
/* For deleted page remember last xid which could knew its address */
169+
GinPageSetDeleteXid(page, ReadNewTransactionId());
170+
171171
/* Delete downlink from parent */
172172
parentPage = BufferGetPage(pBuffer);
173173
#ifdef USE_ASSERT_CHECKING

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy