Correct comment in GetConflictingVirtualXIDs()
authorSimon Riggs <simon@2ndQuadrant.com>
Sun, 24 Jan 2016 18:22:11 +0000 (10:22 -0800)
committerSimon Riggs <simon@2ndQuadrant.com>
Sun, 24 Jan 2016 18:22:11 +0000 (10:22 -0800)
We use Share lock because it is safe to do so.

src/backend/storage/ipc/procarray.c

index 813cea21a5d94cf21b4bfd4b3dffc2dcdeb9500f..bd0c96124e3c77711365333316ce18f397875d6a 100644 (file)
@@ -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)))