Re: Bogus assertion in multixact.c? - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Bogus assertion in multixact.c?
Date
Msg-id 20050503184339.GD12359@dcc.uchile.cl
Whole thread Raw
In response to Bogus assertion in multixact.c?  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
On Tue, May 03, 2005 at 09:33:30PM +0300, Heikki Linnakangas wrote:
> There's an assertion in multixact.c, MultiXactIdExpand function, line 273:
> 
>        Assert(!TransactionIdEquals(multi, xid));
> 
> where multi is a MultiXactId and xid is a TransactionId.
> 
> Isn't this bogus? If I understand the code correctly, multixactids and 
> regular xids live in completely separate id spaces. Therefore a comparison 
> between them makes no sense.

Well :-)  actually that particular MultiXactId may be a TransactionId.
(See the isMulti param, and comments at the beggining of the function.)
This ugliness is there to support the notion of locking a tuple with
either a TransactionId (non-contention case) or a MultiXactId
(concurrent case.)

We require MultiXactId to be equivalent to TransactionId anyway, because
we store Multis on a tuple's Xmax.

Congratulations for spotting that :-)  (Are you using a source checker
tool?)

-- 
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"No hay cielo posible sin hundir nuestras raícesen la profundidad de la tierra"                        (Malucha Pinto)


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bogus assertion in multixact.c?
Next
From: Stephen Frost
Date:
Subject: Re: [pgsql-advocacy] Increased company involvement