Re: [PATCHES] [pgsql-patches] Phantom Command IDs, updated patch

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] [pgsql-patches] Phantom Command IDs, updated patch
Date: 2007-02-08 20:27:31
Message-ID: 200702082027.l18KRVG00708@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> [ time to move this thread to -hackers ]
>
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Tom Lane wrote:
> >> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> >>> Heikki Linnakangas wrote:
> >>>> Tom Lane wrote:
> >>>>> BTW, I don't care much for the terminology "phantom cid" ... there's
> >>>>> nothing particularly "phantom" about them, seeing they get onto disk.
> >>>>> Can anyone think of a better name? The best I can do offhand is
> >>>>> "merged cid" or "cid pair", which aren't inspiring.
>
> >>>> MultiCid, like the MultiXacts? Maybe not, they're quite different beasts...
>
> >>> Dual cid? Double cid?
>
> >> "Double cid" doesn't sound too bad. Another thought that just came to
> >> mind is "cid interval" or some variant of that.
>
> > I don't like "double ctid" because it is really just one ctid, but
> > represents two. I am thinking "packed ctid" is the right wording. It
> > doesn't have the same impact as "phantom", but it is probably better.
>
> Packed doesn't seem to have quite the right connotation either --- it
> sounds like it means there are two separable fields in the CID value.
>
> Maybe "composite cid"?

At one point I was thinking "combo". but "composite" sounds good.

> Another issue that we need to think about before we go too far with this
> is the problem that we punted on before 8.2 release: how to deal with
> rolling back an upgrade of a row-level lock from shared to exclusive
> within a subtransaction. I'm a bit nervous about committing to merging
> cmin and cmax before we have an idea how we're going to solve that ---
> it might foreclose a solution. Or maybe we could piggyback on phantom/
> composite/whatever CIDs to solve it, which would be great, but let's
> try to sketch out a solution now.

Good point. Right now we put our new cid on top of the old lock cid,
making rollback impossible to the old lock. What if instead of
overwriting our old cid with a new one, we create a composite cid, and
if we roll back, we look up the composite pair and put the old cid back.
It would only work with two cids, but that seems sufficient.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc Munro 2007-02-08 20:32:05 Re: referential Integrity and SHARE locks
Previous Message Stephan Szabo 2007-02-08 20:24:19 Re: referential Integrity and SHARE locks

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2007-02-08 20:30:07 Re: patch for contrib/xml2
Previous Message Pavel Stehule 2007-02-08 20:03:09 Re: TM formating patch