Re: Slow standby snapshot

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Michail Nikolaev <michail(dot)nikolaev(at)gmail(dot)com>
Cc: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Andres Freund <andres(at)anarazel(dot)de>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Slow standby snapshot
Date: 2021-11-16 02:00:08
Message-ID: CAPpHfdvwceRC3YrATakUdYqvJLiFf1tOwvvo6-Dpq==AHwvQkg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 10, 2021 at 12:16 AM Michail Nikolaev
<michail(dot)nikolaev(at)gmail(dot)com> wrote:
> I updated the patch a little. KnownAssignedXidsGetAndSetXmin now
> causes fewer cache misses because some values are stored in variables
> (registers). I think it is better to not lean on the compiler here
> because of `volatile` args.
> Also, I have added some comments.

It looks like KnownAssignedXidsNext doesn't have to be
pg_atomic_uint32. I see it only gets read with pg_atomic_read_u32()
and written with pg_atomic_write_u32(). Existing code believes that
read/write of 32-bit values is atomic. So, you can use just uint32
instead of pg_atomic_uint32.

------
Regards,
Alexander Korotkov

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2021-11-16 02:02:15 Re: Add psql command to list constraints
Previous Message houzj.fnst@fujitsu.com 2021-11-16 01:56:41 RE: Data is copied twice when specifying both child and parent table in publication