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

From Robert Haas
Subject Re: old_snapshot_threshold bottleneck on replica
Date
Msg-id CA+TgmoboYmfYMnqtWgyE_1Jy9DYE_VE8HYiX3f1EoO=Wpx2VOQ@mail.gmail.com
Whole thread Raw
In response to old_snapshot_threshold bottleneck on replica  (Maxim Orlov <orlovmg@gmail.com>)
Responses Re: old_snapshot_threshold bottleneck on replica
Re: old_snapshot_threshold bottleneck on replica
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgindent vs variable declaration across multiple lines
Next
From: gkokolatos@pm.me
Date:
Subject: Re: Add LZ4 compression in pg_dump