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

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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:36:11
Message-ID: 20070208203611.GF24069@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:
> Tom Lane wrote:
> >
> > 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.

This starts to look awfully similar to MultiXactIds. And probably using
such a mechanism would allow you to "rollback" any number of row locks:
take the current membersoof the "multicid", substract the one that
rolled back and use that as new multicid. The main difference is that
you'd need to store both the locker Cid and the mode (shared/exclusive).

The other difference is that multicids can be stored locally to a
backend, no need to have SLRUs etc.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2007-02-08 20:40:01 Re: [PATCHES] [pgsql-patches] Phantom Command IDs, updated patch
Previous Message Tom Lane 2007-02-08 20:32:52 Re: [PATCHES] [pgsql-patches] Phantom Command IDs, updated patch

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2007-02-08 20:40:01 Re: [PATCHES] [pgsql-patches] Phantom Command IDs, updated patch
Previous Message Bruce Momjian 2007-02-08 20:34:02 Re: TM formating patch