Commit b1071408 authored by Alexander Korotkov's avatar Alexander Korotkov

Fix page modification outside of critical section in GIN

By oversight 52ac6cd2 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
parent 32ca32d0
......@@ -153,9 +153,6 @@ ginDeletePage(GinVacuumState *gvs, BlockNumber deleteBlkno, BlockNumber leftBlkn
page = BufferGetPage(dBuffer);
rightlink = GinPageGetOpaque(page)->rightlink;
/* For deleted page remember last xid which could knew its address */
GinPageSetDeleteXid(page, ReadNewTransactionId());
/*
* Any insert which would have gone on the leaf block will now go to its
* right sibling.
......@@ -168,6 +165,9 @@ ginDeletePage(GinVacuumState *gvs, BlockNumber deleteBlkno, BlockNumber leftBlkn
page = BufferGetPage(lBuffer);
GinPageGetOpaque(page)->rightlink = rightlink;
/* For deleted page remember last xid which could knew its address */
GinPageSetDeleteXid(page, ReadNewTransactionId());
/* Delete downlink from parent */
parentPage = BufferGetPage(pBuffer);
#ifdef USE_ASSERT_CHECKING
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment