Re: Nested transactions and tuple header info

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Manfred Koizar <mkoi-pg(at)aon(dot)at>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Nested transactions and tuple header info
Date: 2004-06-13 06:32:38
Message-ID: 20040613063238.GA26479@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I said

> One such possible caller is EvalPlanQual. It could go to sleep using
> XactLockTableWait() on the SnapshotDirty's xmax. But the tuple has
> something strange in its xmax -- it's the tuple's cmin actually.
> Leaving this would be probably a bug.
>
> However, if the tuple is new, then EvalPlanQual won't even try to see
> it. Or maybe it will. And then, maybe there are other callers (I can
> only see _bt_check_unique).

Right, this is a worse problem than I thought :-( I can't get past
initdb because _bt_check_unique calls XactLockTableWait() with it's own
Xid, which we refuse. Actually not it's own Xid, but the phantom Xid
that was just assigned to some tuple, in the same transaction.

Not sure how to fix this -- I'm not even sure what the exact problem is,
because it's trying to insert the oid of a toast table in
pg_class_oid_index during the first ALTER TABLE ... CREATE TOAST TABLE.
Why would it see an old tuple with the same value, I don't know.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Always assume the user will do much worse than the stupidest thing
you can imagine." (Julien PUYDT)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2004-06-13 07:32:10 Re: [COMMITTERS] pgsql-server: Clean up generation of
Previous Message Joe Conway 2004-06-13 05:19:08 Re: Release 7.4.3 branded