Re: [COMMITTERS] pgsql: Rework subtransaction commit protocol for hot standby.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [COMMITTERS] pgsql: Rework subtransaction commit protocol for hot standby.
Date: 2008-10-22 21:16:37
Message-ID: 24089.1224710197@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> On Wed, 2008-10-22 at 16:41 -0400, Tom Lane wrote:
>> Hmm, but then why did we not see the same thing before?

> The failure definitely came from trying to set SUBCOMMITTED on a
> transaction already committed.

Ah, I see: prior versions did not bother to make a WAL entry for a
subcommit, so there was no case where a replay would try to reverse
the later state change to committed.

I see from a quick look in xact.c that CommitSubTransaction no longer
marks the subxact as subcommitted at all, which makes me wonder what is
the point of even having the state. If you intend that we are going to
rely 100% on in-memory state to detect our own subcommitted
transactions, then why isn't it sufficient to mark the parent committed
and then mark the subtransactions committed? An onlooker would see a
subtransaction go directly from IN_PROGRESS to COMMITTED, but if the
onlooker is too slow to catch the now-very-transient SUBCOMMITTED
state, that's what he'd see anyway.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2008-10-22 21:48:10 Re: [COMMITTERS] pgsql: Rework subtransaction commit protocol for hot standby.
Previous Message Simon Riggs 2008-10-22 20:58:03 Re: [COMMITTERS] pgsql: Rework subtransaction commit protocol for hot standby.

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2008-10-22 21:24:30 Re: minimal update
Previous Message Simon Riggs 2008-10-22 20:58:03 Re: [COMMITTERS] pgsql: Rework subtransaction commit protocol for hot standby.