Re: nested transactions - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: nested transactions
Date
Msg-id 200211292057.gATKvHf15832@candle.pha.pa.us
Whole thread Raw
In response to Re: nested transactions  (Manfred Koizar <mkoi-pg@aon.at>)
Responses Re: nested transactions  (Manfred Koizar <mkoi-pg@aon.at>)
List pgsql-hackers
Manfred Koizar wrote:
> On Fri, 29 Nov 2002 13:33:28 -0500, Tom Lane <tgl@sss.pgh.pa.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@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: "Christopher Kings-Lynne"
Date:
Subject: Postgres 7.3 announcement on postgresql.org
Next
From: Tom Lane
Date:
Subject: Re: nested transactions