Re: Subtransaction commits and Hot Standby

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Subtransaction commits and Hot Standby
Date: 2008-09-16 14:40:09
Message-ID: 1221576009.3913.1876.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2008-09-16 14:43:52 Re: proposal - GROUPING SETS
Previous Message Simon Riggs 2008-09-16 14:38:45 Re: Subtransaction commits and Hot Standby

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2008-09-16 15:08:51 Re: Subtransaction commits and Hot Standby
Previous Message Simon Riggs 2008-09-16 14:38:45 Re: Subtransaction commits and Hot Standby