On Sun, 2009-11-15 at 16:07 +0200, Heikki Linnakangas wrote:
> - When replaying b-tree deletions, we currently wait out/cancel all
> running (read-only) transactions. We take the ultra-conservative
> stance because we don't know how recent the tuples being deleted are.
> If we could store a better estimate for latestRemovedXid in the WAL
> record, we could make that less conservative.
I think I can improve on the way we do this somewhat.
When we GetConflictingVirtualXIDs() with InvalidTransactionId we include
all backends.
If a query can only see currently-running xacts then it cannot see any
data that is being cleaned up because its xmin > latestCompletedXid.
Put another way, Assert(latestRemovedXid <= latestCompletedXid)
-- Simon Riggs www.2ndQuadrant.com