diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-08-02 15:34:21 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-08-02 15:34:21 -0400 |
commit | 7f7c93f85f5fb7fa86c525e04f3de031f3dde794 (patch) | |
tree | ec9605d8210da6d1e0c1f8d710a60d8226f243ac /src/include/access/spgist_private.h | |
parent | 87a237956860c05c6c0d64a7f443b338d99ee38e (diff) | |
download | postgresql-7f7c93f85f5fb7fa86c525e04f3de031f3dde794.tar.gz postgresql-7f7c93f85f5fb7fa86c525e04f3de031f3dde794.zip |
Fix race conditions associated with SPGiST redirection tuples.
The correct test for whether a redirection tuple is removable is whether
tuple's xid < RecentGlobalXmin, not OldestXmin; the previous coding
failed to protect index searches being done in concurrent transactions that
have no XID. This mirrors the recent fix in btree's page recycling logic
made in commit d3abbbebe52eb1e59e621c880ad57df9d40d13f2.
Also, WAL-log the newest XID of any removed redirection tuple on an index
page, and apply ResolveRecoveryConflictWithSnapshot during InHotStandby WAL
replay. This protects against concurrent Hot Standby transactions possibly
needing to see the redirection tuple(s).
Per my query of 2012-03-12 and subsequent discussion.
Diffstat (limited to 'src/include/access/spgist_private.h')
-rw-r--r-- | src/include/access/spgist_private.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/access/spgist_private.h b/src/include/access/spgist_private.h index 74267a43900..b5bc45121aa 100644 --- a/src/include/access/spgist_private.h +++ b/src/include/access/spgist_private.h @@ -591,6 +591,7 @@ typedef struct spgxlogVacuumRedirect BlockNumber blkno; /* block number to clean */ uint16 nToPlaceholder; /* number of redirects to make placeholders */ OffsetNumber firstPlaceholder; /* first placeholder tuple to remove */ + TransactionId newestRedirectXid; /* newest XID of removed redirects */ /* offsets of redirect tuples to make placeholders follow */ } spgxlogVacuumRedirect; |