]> granicus.if.org Git - postgresql/commitdiff
There's a small window wherein a transaction is committed but not yet
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 7 Jul 2011 21:36:30 +0000 (00:36 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 7 Jul 2011 21:39:40 +0000 (00:39 +0300)
on the finished list, and we shouldn't flag it as a potential conflict
if so. We can also skip adding a doomed transaction to the list of
possible conflicts because we know it won't commit.

Dan Ports and Kevin Grittner.

src/backend/storage/lmgr/predicate.c

index d93de7de9045de49976f8bea000117398f3947c7..3c3a6a9d9633806b0bdabe4d5c1d86b579ac9028 100644 (file)
@@ -1677,8 +1677,9 @@ RegisterSerializableTransactionInt(Snapshot snapshot)
                         othersxact != NULL;
                         othersxact = NextPredXact(othersxact))
                {
-                       if (!SxactIsOnFinishedList(othersxact) &&
-                               !SxactIsReadOnly(othersxact))
+                       if (!SxactIsCommitted(othersxact)
+                               && !SxactIsDoomed(othersxact)
+                               && !SxactIsReadOnly(othersxact))
                        {
                                SetPossibleUnsafeConflict(sxact, othersxact);
                        }