From: Robert Haas Date: Sat, 7 May 2011 01:53:55 +0000 (-0400) Subject: Add comment about memory reordering to PredicateLockTupleRowVersionLink. X-Git-Tag: REL9_1_BETA2~157 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=71932ecc2b6ca0d748176a7e8b11d3575bf4caf3;p=thirdparty%2Fpostgresql.git Add comment about memory reordering to PredicateLockTupleRowVersionLink. Dan Ports, per head-scratching from Simon Riggs and myself. --- diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index 48ff9cc151d..3b3158efe55 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -2283,6 +2283,9 @@ PredicateLockTupleRowVersionLink(const Relation relation, * locks. Even if a serializable transaction starts concurrently, * we know it can't take any SIREAD locks on the modified tuple * because the caller is holding the associated buffer page lock. + * Memory reordering isn't an issue; the memory barrier in the + * LWLock acquisition guarantees that this read occurs while the + * buffer page lock is held. */ if (!TransactionIdIsValid(PredXact->SxactGlobalXmin)) return;