summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Riggs2016-01-24 18:22:11 +0000
committerSimon Riggs2016-01-24 18:22:11 +0000
commit1129c2b0ad2732f301f696ae2cf98fb063a4c1f8 (patch)
treec18f03a26044a771d29e4e27d64615491c139efa /src
parent00347575e2754b1aaacd357776560803564d3f35 (diff)
Correct comment in GetConflictingVirtualXIDs()
We use Share lock because it is safe to do so.
Diffstat (limited to 'src')
-rw-r--r--src/backend/storage/ipc/procarray.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index 813cea21a5d..bd0c96124e3 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -2540,8 +2540,11 @@ GetConflictingVirtualXIDs(TransactionId limitXmin, Oid dbOid)
/*
* We ignore an invalid pxmin because this means that backend has
- * no snapshot and cannot get another one while we hold exclusive
- * lock.
+ * no snapshot currently. We hold a Share lock to avoid contention
+ * with users taking snapshots. That is not a problem because
+ * the current xmin is always at least one higher than the latest
+ * removed xid, so any new snapshot would never conflict with the
+ * test here.
*/
if (!TransactionIdIsValid(limitXmin) ||
(TransactionIdIsValid(pxmin) && !TransactionIdFollows(pxmin, limitXmin)))