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-27 03:10:59
Message-ID: 20040627031059.GC8513@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Sat, Jun 26, 2004 at 07:56:09PM -0400, Tom Lane wrote:
> Do we really need SubtransCutoffXid? AFAICS the reason for having it is
> only this claim in RecordTransactionCommit:
>
> * We can't mark committed subtransactions as fully committed,
> * because concurrent transactions would see them as committed
> * and not as in-progress. Leave them as "subcommitted" until
> * the parent transaction is below OldestXmin, per VACUUM.

Right, that's the only point where it's used. I don't know clearly if
some kind of mechanism will be needed to handle SUBTRANS COMMIT states
in pg_clog that were left behind by a crashed subtransaction though.

> but I think this is dead wrong. As long as we mark the parent committed
> first, there is no race condition. tqual tests that are using snapshots
> will need to recognize that the subtransaction is a member of one of the
> snapshotted main XIDs, and those that are not will think committed is
> committed. So I want to mark subtransactions fully committed in
> RecordTransactionCommit, and lose SubtransCutoffXid. Comments?

Yes, sounds good.

> BTW, it would help to know what parts of the patch you intend to work on
> over the next couple of days. I'm reviewing and editorializing right
> now with intent to commit soon, so it would be good if we can avoid
> tromping on each others' feet.

This is really excellent news.

I'll work on adding the Xid-cache to PGPROC and using that in
TransactionIdIsInProgress and the tqual routines. If you want to work
on that let me know and I'll handle things like the password file, local
bufmgr refcount, etc.

--
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 Josh Berkus 2004-06-27 03:29:51 Re: [DEFAULT] Daily digest v1.4537 (18 messages)
Previous Message Scott Marlowe 2004-06-27 01:31:59 Re: xeon processors

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-06-27 04:49:10 Re: nested xacts and phantom Xids
Previous Message Tom Lane 2004-06-26 23:56:09 Re: nested xacts and phantom Xids