Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 2031964FD1B for ; Tue, 16 Sep 2008 11:40:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 53648-01 for ; Tue, 16 Sep 2008 11:40:19 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail137161.authsmtp.com (outmail137161.authsmtp.com [62.13.137.161]) by postgresql.org (Postfix) with ESMTP id CD72D64FD09 for ; Tue, 16 Sep 2008 11:40:18 -0300 (ADT) Received: from mail-c187.authsmtp.com (mail-c187.authsmtp.com [62.13.128.33]) by punt6.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m8GEdgFH042536; Tue, 16 Sep 2008 15:39:42 +0100 (BST) Received: from [192.168.0.3] (85-211-98-178.dyn.gotadsl.co.uk [85.211.98.178]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m8GEdfYg076527; Tue, 16 Sep 2008 15:39:41 +0100 (BST) Subject: Re: Subtransaction commits and Hot Standby From: Simon Riggs To: Alvaro Herrera Cc: Heikki Linnakangas , pgsql-hackers In-Reply-To: <20080916141148.GA9229@alvh.no-ip.org> References: <1221566023.3913.1823.camel@ebony.2ndQuadrant> <48CFBC34.5010802@enterprisedb.com> <20080916141148.GA9229@alvh.no-ip.org> Content-Type: text/plain Date: Tue, 16 Sep 2008 15:40:09 +0100 Message-Id: <1221576009.3913.1876.camel@ebony.2ndQuadrant> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Server-Quench: 4c1e5ac6-83fd-11dd-8155-001185d377ca X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksadRtFaQNbflxB HGQLW1xEUVh7Wmp/ bwsfZQBDYEtPQQxi TklOSk1QEQdtHhxP WxZpJ00kHlJGf3h1 Z0EsX3lYWwp+Jkco Rx8HE3AOZjE0dWEe BBRFfwJRdR5Kfh5E YlUrV3QKMjRJBC9q VzwTFhsSEA9kHWxu XwsRN1sUWk8AAj87 QVgJGjAqHFEeDyw1 I1QGLUJUJ1oYNEk4 IDNh X-Authentic-SMTP: 61633235383639.squirrel.dmpriest.net.uk:1186/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system! X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/1039 X-Sequence-Number: 124168 On Tue, 2008-09-16 at 10:11 -0400, Alvaro Herrera wrote: > Heikki Linnakangas wrote: > > Simon Riggs wrote: > >> Subtransactions cause a couple of problems for Hot Standby: > > > > Do we need to treat subtransactions any differently from normal > > transactions? Just treat all subtransactions as top-level transactions > > until commit, and mark them all as committed when you see the commit > > record for the top-level transaction. > > This could lead to inconsistent results -- some of the subtransactions > could be marked as committed while others are still in progress. Unless > we want to be able to atomically mark them all as committed, but I don't > think that's really an option because it could mean holding the clog > lock for a long time, possibly involving I/O of clog pages. If we did that we would need to mark them all subcomitted and then mark them all committed. So its possible, but not desirable. > I wonder if the improved clog API required to mark multiple > transactions > as committed at once would be also useful to TransactionIdCommitTree > which is used in regular transaction commit. Yes, I think its an improvement for regular commits/subcommits also. -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support