From 8c4ec236f84ad364a0f71416f871bd4871fe137f Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Mon, 11 Nov 2019 17:02:16 +1300 Subject: [PATCH v4 2/2] fixup --- src/backend/storage/lmgr/predicate.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index 812aa496f4..0c13057c19 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -4037,15 +4037,13 @@ CheckForSerializableConflictOutNeeded(Relation relation, Snapshot snapshot) /* * CheckForSerializableConflictOut - * We are reading a tuple which has been modified. If it is visible to - * us but has been deleted, that indicates a rw-conflict out. If it's - * not visible and was created by a concurrent (overlapping) - * serializable transaction, that is also a rw-conflict out. + * A table AM is reading a tuple that has been modified. After determining + * that it is visible to us, it should call this function with the top + * level xid of the writing transaction. * - * We will determine the top level xid of the writing transaction with which - * we may be in conflict, and check for overlap with our own transaction. - * If the transactions overlap (i.e., they cannot see each other's writes), - * then we have a conflict out. + * This function will check for overlap with our own transaction. If the + * transactions overlap (i.e., they cannot see each other's writes), then we + * have a conflict out. */ void CheckForSerializableConflictOut(Relation relation, TransactionId xid, Snapshot snapshot) @@ -4054,8 +4052,8 @@ CheckForSerializableConflictOut(Relation relation, TransactionId xid, Snapshot s SERIALIZABLEXID *sxid; SERIALIZABLEXACT *sxact; - if (!SerializationNeededForRead(relation, snapshot)) - return; + /* Calling code should have checked this. */ + Assert(SerializationNeededForRead(relation, snapshot)); /* Check if someone else has already decided that we need to die */ if (SxactIsDoomed(MySerializableXact)) -- 2.23.0