Skip site navigation (1) Skip section navigation (2)

Re: nested xacts and phantom Xids

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: nested xacts and phantom Xids
Date: 2004-06-22 04:36:37
Message-ID: 20040622043637.GB7871@dcc.uchile.cl (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On Mon, Jun 21, 2004 at 10:28:59PM -0400, Tom Lane wrote:
> Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> writes:

> > This is tricky because chunks are prepended to the queue, but it also
> > means we can stop processing as soon as a message belongs to another
> > transaction.
> 
> AFAIR there isn't any essential semantics to the ordering of the queue
> entries, so you can probably get away with reordering if that makes life
> any easier.
>
> Also, rather than labeling each entry individually, it might be better
> to keep a separate list for each level of transaction.  Then instead of
> relabeling, you'd just concat the subtrans list to its parent's.  Seems
> like this should be faster and less storage.

Right, but it makes harder to detect when a duplicate relcache entry is
going to be inserted.  Judging from the commentary in the file this is
an issue.

Another idea I had was:
1. at subtransaction start, add a special "boundary" message carrying
the new Xid.
2. at subtransaction abort, process the first chunk backwards until the
boundary message with the corresponding Xid is found; if it's not, jump
to the next and repeat.

At subtransaction commit nothing special needs to be done.

This avoids having to label each message and to change the message
appending scheme.

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"The eagle never lost so much time, as
when he submitted to learn of the crow." (William Blake)


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2004-06-22 04:42:30
Subject: Re: nested xacts and phantom Xids
Previous:From: Tom LaneDate: 2004-06-22 02:28:59
Subject: Re: nested xacts and phantom Xids

pgsql-patches by date

Next:From: Tom LaneDate: 2004-06-22 04:42:30
Subject: Re: nested xacts and phantom Xids
Previous:From: Tom LaneDate: 2004-06-22 02:28:59
Subject: Re: nested xacts and phantom Xids

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group