Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id C14C8B5DBF0 for ; Thu, 7 Jul 2011 18:17:36 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 03613-04 for ; Thu, 7 Jul 2011 21:17:30 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from midnight-anchovy.ambulatoryclam.net (unknown [18.141.0.210]) by mail.postgresql.org (Postfix) with ESMTP id 71C5BB5DC43 for ; Thu, 7 Jul 2011 18:17:30 -0300 (ADT) Received: by midnight-anchovy.ambulatoryclam.net (Postfix, from userid 1001) id 668714ADE9; Thu, 7 Jul 2011 17:21:59 -0400 (EDT) Date: Thu, 7 Jul 2011 17:21:59 -0400 From: Dan Ports To: Heikki Linnakangas Cc: Kevin Grittner , pgsql-hackers@postgresql.org Subject: Re: SSI atomic commit Message-ID: <20110707212159.GF76634@csail.mit.edu> References: <4E12FDA8020000250003EFC1@gw.wicourts.gov> <4E15D48A.7080203@enterprisedb.com> <4E159B5C020000250003F063@gw.wicourts.gov> <4E160005.1020300@enterprisedb.com> <4E161881.6090800@enterprisedb.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="liOOAslEiF7prFVr" Content-Disposition: inline In-Reply-To: <4E161881.6090800@enterprisedb.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.107 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RDNS_NONE=0.793 X-Spam-Level: X-Archive-Number: 201107/355 X-Sequence-Number: 191454 --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline We should also apply the attached patch, which corrects a minor issue with the conditions for flagging transactions that could potentially make a snapshot unsafe. There's a small window wherein a transaction is committed but not yet 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. This is not really a related issue, but Kevin and I found it while looking into this issue, and it was included in the patch we sent out. Dan -- Dan R. K. Ports MIT CSAIL http://drkp.net/ --liOOAslEiF7prFVr Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="ssi-possibleconflict-test.patch" *** a/src/backend/storage/lmgr/predicate.c --- b/src/backend/storage/lmgr/predicate.c *************** *** 1669,1676 **** RegisterSerializableTransactionInt(Snapshot snapshot) othersxact != NULL; othersxact = NextPredXact(othersxact)) { ! if (!SxactIsOnFinishedList(othersxact) && ! !SxactIsReadOnly(othersxact)) { SetPossibleUnsafeConflict(sxact, othersxact); } --- 1676,1684 ---- othersxact != NULL; othersxact = NextPredXact(othersxact)) { ! if (!SxactIsCommitted(othersxact) ! && !SxactIsDoomed(othersxact) ! && !SxactIsReadOnly(othersxact)) { SetPossibleUnsafeConflict(sxact, othersxact); } --liOOAslEiF7prFVr--