aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/lmgr/predicate.c
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2020-06-12 10:44:32 +1200
committerThomas Munro <tmunro@postgresql.org>2020-06-12 10:55:38 +1200
commit7aa4fb592530b74bf05f62c52b736ee3910691b9 (patch)
tree632d5211cf648a4af8805386975e26301009cf3f /src/backend/storage/lmgr/predicate.c
parent59fa7eb60364b8e71fe0f515d6ad87c274af839b (diff)
downloadpostgresql-7aa4fb592530b74bf05f62c52b736ee3910691b9.tar.gz
postgresql-7aa4fb592530b74bf05f62c52b736ee3910691b9.zip
Improve comments for [Heap]CheckForSerializableConflictOut().
Rewrite the documentation of these functions, in light of recent bug fix commit 5940ffb2. Back-patch to 13 where the check-for-conflict-out code was split up into AM-specific and generic parts, and new documentation was added that now looked wrong. Reviewed-by: Peter Geoghegan <pg@bowt.ie> Discussion: https://postgr.es/m/db7b729d-0226-d162-a126-8a8ab2dc4443%40jepsen.io
Diffstat (limited to 'src/backend/storage/lmgr/predicate.c')
-rw-r--r--src/backend/storage/lmgr/predicate.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c
index ba93fb199d4..d24919f76b6 100644
--- a/src/backend/storage/lmgr/predicate.c
+++ b/src/backend/storage/lmgr/predicate.c
@@ -4037,13 +4037,16 @@ CheckForSerializableConflictOutNeeded(Relation relation, Snapshot snapshot)
/*
* CheckForSerializableConflictOut
- * 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.
+ * A table AM is reading a tuple that has been modified. If it determines
+ * that the tuple version it is reading is not visible to us, it should
+ * pass in the top level xid of the transaction that created it.
+ * Otherwise, if it determines that it is visible to us but it has been
+ * deleted or there is a newer version available due to an update, it
+ * should pass in the top level xid of the modifying transaction.
*
- * 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.
+ * This function will check for overlap with our own transaction. If the given
+ * xid is also serializable and 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)