From: Kevin Grittner Date: Sat, 4 Dec 2010 18:16:15 +0000 (-0600) Subject: Add a TODO comment for cleaning up READ ONLY transactions when X-Git-Url: http://git.postgresql.org/gitweb/static/developers.postgresql.org?a=commitdiff_plain;h=c238426cb305efd1bffffe1393def62b5329b124;p=users%2Fkgrittn%2Fpostgres.git Add a TODO comment for cleaning up READ ONLY transactions when WritableSxactCount decreases to zero. --- diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index 352dae5a13..3a4b52933f 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -2705,18 +2705,23 @@ PreCommit_CheckForSerializationFailure(void) failure = false; + /* + * TODO SSI: SHARED here and EXCLUSIVE below to modify? Would require new + * SerializableCommitLock for exclusive use around this method? + */ LWLockAcquire(SerializableXactHashLock, LW_EXCLUSIVE); if (!XactReadOnly) - --(PredTran->WritableSxactCount); + if (--(PredTran->WritableSxactCount) == 0) + { + /* + * TODO SSI: Release any READ ONLY transactions from predicate + * lock tracking -- active or committed. + */ + } /* TODO SSI: check whether another transaction has cancelled us? */ - /* - * TODO SSI: SHARED here and EXCLUSIVE below to modify? Would require new - * SerializableCommitLock for exclusive use around this method? - */ - nearConflict = (RWConflict) SHMQueueNext((SHM_QUEUE *) &MySerializableXact->inConflicts, (SHM_QUEUE *) &MySerializableXact->inConflicts,