diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 7dcc6015de95137092358b5c8dc49eeb6f0ae310..89697f6ff5e6d8c5cfe05fa4865564e70d5c9761 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -1472,10 +1472,10 @@ heap_fetch(Relation relation, if (valid) PredicateLockTuple(relation, tuple); - LockBuffer(buffer, BUFFER_LOCK_UNLOCK); - CheckForSerializableConflictOut(valid, relation, tuple, buffer); + LockBuffer(buffer, BUFFER_LOCK_UNLOCK); + if (valid) { /* diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index aa657fab579ea8b4c2090333a0da6a1789404d8e..700c0db9278ef1f8ffdb4e13a1af36c796929d5a 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -3366,9 +3366,10 @@ XidIsConcurrent(TransactionId xid) * If the transactions overlap (i.e., they cannot see each other's writes), * then we have a conflict out. * - * This function should be called just about anywhere in heapam.c that a - * tuple has been read. There is currently no known reason to call this - * function from an index AM. + * This function should be called just about anywhere in heapam.c where a + * tuple has been read. The caller must hold at least a shared lock on the + * buffer, because this function might set hint bits on the tuple. There is + * currently no known reason to call this function from an index AM. */ void CheckForSerializableConflictOut(const bool visible, const Relation relation,