Re: POC: make mxidoff 64 bits - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: POC: make mxidoff 64 bits
Date
Msg-id 202409121314.ilzhahahenkj@alvherre.pgsql
Whole thread Raw
In response to Re: POC: make mxidoff 64 bits  (Pavel Borisov <pashkin.elfe@gmail.com>)
List pgsql-hackers
On 2024-Sep-12, Pavel Borisov wrote:

> Hi, Maxim!
> 
> Previously we accessed offsets in shared MultiXactState without locks as
> 32-bit read is always atomic. But I'm not sure it's so when offset become
> 64-bit.
> E.g. GetNewMultiXactId():
> 
> nextOffset = MultiXactState->nextOffset;
> is outside lock.

Good though.  But fortunately I think it's not a problem.  The one you
say is with MultiXactGetLock held in shared mode -- and that works OK,
as the assignment (in line 1263 at the bottom of the same routine) is
done with exclusive lock held.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/



pgsql-hackers by date:

Previous
From: Pavel Borisov
Date:
Subject: Re: POC: make mxidoff 64 bits
Next
From: Bertrand Drouvot
Date:
Subject: Re: Switch PgStat_HashKey.objoid from Oid to uint64