Re: Cleaning up recovery from subtransaction start failure

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Cleaning up recovery from subtransaction start failure
Date: 2004-09-14 01:15:54
Message-ID: 20040914011554.GB6312@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 13, 2004 at 08:40:46PM -0400, Tom Lane wrote:

> The remaining calls of GetCurrentTransactionId would mostly be the ones
> in heapam.c that are labeling tuples about to be written to disk.
>
> One minor point is that GetCurrentTransactionId would now become a
> routine with a nonzero prospect of failure.

Just to be sure I understand your proposal: the idea is that a
subtransaction would not have a TransactionId assigned right away, but
instead the first call to GetCurrentTransactionId in the subxact would
assign it (and call SubTransSetParent and XactLockTableInsert). Is this
right?

> Bottom line: I'm now leaning towards doing this for 8.0, since it would
> make for a useful improvement in robustness, quite aside from any
> performance gains from eliminating unnecessary XID assignments.

I agree it's a very interesting robustness improvement. Also let me
point out explicitly that it would reduce the wastage of pg_clog and
pg_subtrans space by a possibly big margin, reduce the number of locks
taken by XactLockTableInsert(), and reduce the recently talked about
problems of transaction Id wraparound. The savings could be
considerable, especially where high usage of pl/pgsql exceptions are
used. IMHO it definitely has to be in 8.0, or we risk too much in Xid
wraparound, especially when lots of people is starting to use Pg on high
volume, high update environments.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
FOO MANE PADME HUM

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-09-14 01:21:41 Re: Cleaning up recovery from subtransaction start failure
Previous Message Greg Sabino Mullane 2004-09-14 01:14:24 libpq and prepared statements progress for 8.0