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

From Pavel Borisov
Subject Re: POC: make mxidoff 64 bits
Date
Msg-id CALT9ZEG4OoQk8OUBCNY8cT3GuUvcQ0NrphHZ9H8--VjwM5VWUw@mail.gmail.com
Whole thread Raw
In response to Re: POC: make mxidoff 64 bits  (Pavel Borisov <pashkin.elfe@gmail.com>)
List pgsql-hackers

On Thu, 12 Sept 2024 at 16:09, Pavel Borisov <pashkin.elfe@gmail.com> 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. 

There might be other places we do the same as well. 
I think the replacement of plain assignments by pg_atomic_read_u64/pg_atomic_write_u64 would be sufficient.

(The same I think is needed for the patchset [1])

Regards,
Pavel Borisov

pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN
Next
From: Alvaro Herrera
Date:
Subject: Re: POC: make mxidoff 64 bits