Re: nested transactions

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Manfred Koizar <mkoi-pg(at)aon(dot)at>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: nested transactions
Date: 2002-11-29 20:57:17
Message-ID: 200211292057.gATKvHf15832@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Manfred Koizar wrote:
> On Fri, 29 Nov 2002 13:33:28 -0500, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> wrote:
> >Unfortunately this discussion is wrong. User-level visibility checks
> >will usually have to fetch the parentxid in case 01 as well, because
> >even if the parent is committed, it might not be visible in our
> >snapshot.
>
> Or we don't allow a subtransaction's status to be updated from 11 to
> 01 until we know, that the main transaction is visible to all active
> transactions. Didn't check whether this is expensive to find out. At
> least it should be doable by VACCUM.
>
> >Snapshots will record only topmost-parent XIDs (because
> >that's what we can find in the PG_PROC array, and anything else would
> >create atomicity problems anyway). So we must chase to the topmost
> >parent before testing visibility.
>
> BTW, I think this *forces* us to replace the sub xid with the
> respective main xid in a tuple header, when we set
> XMIN/MAX_IS_COMMITTED. Otherwise we'd have to look for the main xid,
> whenever a tuple is touched.

Sorry, I don't follow this. As far as I know, we will set the subxid on
the tuple so we can independently mark the xact as aborted without
revisiting all the tuples. Once it is committed/rolled back, I see no
need to lookup the parent, and in fact we could clear the clog parent
xid offset so there is no way to access the parent anymore.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-11-29 21:01:00 Re: nested transactions
Previous Message Christopher Kings-Lynne 2002-11-29 20:25:07 Postgres 7.3 announcement on postgresql.org