Re: old_snapshot_threshold bottleneck on replica

From: Maxim Orlov <orlovmg(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: old_snapshot_threshold bottleneck on replica
Date: 2023-01-25 08:51:53
Message-ID: CACG=ezZonVkGivqohz-m0q=O6GeRakwg973GKk=r_6UMGdiWSA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 24 Jan 2023 at 18:46, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

>
> (1) that mutex also protects something else and the existing comment
> is wrong, or
>
> (2) the mutex should have been removed but the patch neglected to do so, or
>
> (3) the mutex is still needed for some reason, in which case either
> (3a) the patch isn't actually safe or (3b) the patch needs comments to
> explain what the new synchronization model is.
>
> Yes, you're absolutely right. And my first intention was to remove this
mutex completely.
But in TransactionIdLimitedForOldSnapshots these variable is using
conjointly. So, I'm not
sure, is it completely safe to remove mutex. Actually, removing mutex and
switch to atomics
was my first choice. I've run all the tests and no problems were found.
But, at that time I choose
to be more conservative. Anyway, here is the new variant.

--
Best regards,
Maxim Orlov.

Attachment Content-Type Size
v2-0001-Use-atomic-old_snapshot_threshold.patch application/octet-stream 4.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-01-25 08:52:23 Re: plpython vs _POSIX_C_SOURCE
Previous Message Kyotaro Horiguchi 2023-01-25 08:43:16 Re: Time delayed LR (WAS Re: logical replication restrictions)