Re: POC: make mxidoff 64 bits

From: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
To: Maxim Orlov <orlovmg(at)gmail(dot)com>
Cc: Alexander Korotkov <aekorotkov(at)gmail(dot)com>, wenhui qiu <qiuwenhuifx(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: POC: make mxidoff 64 bits
Date: 2024-09-12 12:25:53
Message-ID: CALT9ZEG4OoQk8OUBCNY8cT3GuUvcQ0NrphHZ9H8--VjwM5VWUw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 12 Sept 2024 at 16:09, Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)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])
[1]
https://www.postgresql.org/message-id/flat/CAJ7c6TMvPz8q+nC=JoKniy7yxPzQYcCTnNFYmsDP-nnWsAOJ2g(at)mail(dot)gmail(dot)com

Regards,
Pavel Borisov

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2024-09-12 13:14:08 Re: POC: make mxidoff 64 bits
Previous Message Tatsuo Ishii 2024-09-12 12:12:06 Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN