On Mon, Jan 23, 2023 at 9:40 AM Maxim Orlov <orlovmg@gmail.com> wrote:
> One of our customers stumble onto a significant performance degradation while running multiple OLAP-like queries on a
replica.
> After some investigation, it became clear that the problem is in accessing old_snapshot_threshold parameter.
It has been suggested that we remove that feature entirely.
> My proposal is to use atomic for threshold_timestamp and threshold_xid. PFA 0001 patch.
This patch changes threshold_timestamp and threshold_xid to use
atomics, but it does not remove mutex_threshold which, according to a
quick glance at the comments, protects exactly those two fields. So,
either:
(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.
--
Robert Haas
EDB: http://www.enterprisedb.com