Re: old_snapshot_threshold bottleneck on replica - Mailing list pgsql-hackers

From Maxim Orlov
Subject Re: old_snapshot_threshold bottleneck on replica
Date
Msg-id CACG=ezZonVkGivqohz-m0q=O6GeRakwg973GKk=r_6UMGdiWSA@mail.gmail.com
Whole thread Raw
In response to Re: old_snapshot_threshold bottleneck on replica  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: old_snapshot_threshold bottleneck on replica
List pgsql-hackers


On Tue, 24 Jan 2023 at 18:46, Robert Haas <robertmhaas@gmail.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

pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Time delayed LR (WAS Re: logical replication restrictions)
Next
From: Andres Freund
Date:
Subject: Re: plpython vs _POSIX_C_SOURCE