Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 37D9FB5DBF4 for ; Thu, 7 Jul 2011 17:49:09 -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 64605-04 for ; Thu, 7 Jul 2011 20:48:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id ABAE2B5DBF0 for ; Thu, 7 Jul 2011 17:48:58 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p67KmtDR002649; Thu, 7 Jul 2011 16:48:55 -0400 (EDT) To: Heikki Linnakangas cc: Kevin Grittner , pgsql-hackers@postgresql.org Subject: Re: SSI atomic commit In-reply-to: <4E161881.6090800@enterprisedb.com> References: <4E12FDA8020000250003EFC1@gw.wicourts.gov> <4E15D48A.7080203@enterprisedb.com> <4E159B5C020000250003F063@gw.wicourts.gov> <4E160005.1020300@enterprisedb.com> <4E161881.6090800@enterprisedb.com> Comments: In-reply-to Heikki Linnakangas message dated "Thu, 07 Jul 2011 23:35:13 +0300" Date: Thu, 07 Jul 2011 16:48:55 -0400 Message-ID: <2648.1310071735@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201107/351 X-Sequence-Number: 191450 Heikki Linnakangas writes: > Kevin and Dan also pointed out that a 2PC transaction can stay in > prepared state for a long time, and we could optimize that by setting > prepareSeqNo only at the final COMMIT PREPARED. I objected to that, for > the reason that it's currently very convenient for testing purposes that > a transaction prepared with PREPARE TRANSACTION is in the exact same > state as regular transaction that's going through regular commit processing. Seems to me there's a more fundamental reason not to do that, which is that once you've done PREPARE it is no longer legitimate to decide to roll back the transaction to get out of a "dangerous" structure --- ie, you have to target one of the other xacts involved instead. Shouldn't the assignment of a prepareSeqNo correspond to the point where the xact is no longer a target for SSI rollback? regards, tom lane