• Tom Lane's avatar
    Fix race conditions associated with SPGiST redirection tuples. · 962e0cc7
    Tom Lane authored
    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 d3abbbeb.
    
    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.
    962e0cc7
spgutils.c 22.2 KB