Re: nested xacts and phantom Xids - Mailing list pgsql-patches

From Tom Lane
Subject Re: nested xacts and phantom Xids
Date
Msg-id 9356.1087871339@sss.pgh.pa.us
Whole thread Raw
In response to Re: nested xacts and phantom Xids  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Responses Re: nested xacts and phantom Xids
List pgsql-patches
Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> Regarding the invalidation messages, what I'm currently looking at is to
> add a TransactionId to each message, which will be CurrentTransactionId
> for each new message.  When a subxact commits, all its messages are
> relabeled to its parent.  When a subxact aborts, all messages labeled
> with its TransactionId are locally processed and discarded.

Sounds plausible offhand.

> 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.

            regards, tom lane

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: nested xacts and phantom Xids
Next
From: Alvaro Herrera
Date:
Subject: Re: nested xacts and phantom Xids