Re: old_snapshot_threshold bottleneck on replica

2023-09-07 Thread Thomas Munro
On Fri, Sep 8, 2023 at 4:22 PM Peter Geoghegan wrote: > This looks right to me. Thanks, pushed.

Re: old_snapshot_threshold bottleneck on replica

2023-09-07 Thread Peter Geoghegan
On Thu, Sep 7, 2023 at 8:49 PM Thomas Munro wrote: > The code moved around quite a few times over several commits and quite > a lot since then, which is why I didn't go for straight revert, but > clearly the manual approach risked missing things. It's not a big deal, obviously. > I think the >

Re: old_snapshot_threshold bottleneck on replica

2023-09-07 Thread Thomas Munro
On Fri, Sep 8, 2023 at 2:00 PM Thomas Munro wrote: > On Fri, Sep 8, 2023 at 1:53 PM Peter Geoghegan wrote: > > Thanks for working on this. Though I wonder why you didn't do > > something closer to a straight revert of the feature. Why is nbtree > > still passing around snapshots needlessly? The

Re: old_snapshot_threshold bottleneck on replica

2023-09-07 Thread Thomas Munro
On Fri, Sep 8, 2023 at 1:53 PM Peter Geoghegan wrote: > On Tue, Sep 5, 2023 at 12:58 AM Thomas Munro wrote: > > I hope we get "snapshot too old" back one day. > > Thanks for working on this. Though I wonder why you didn't do > something closer to a straight revert of the feature. Why is nbtree >

Re: old_snapshot_threshold bottleneck on replica

2023-09-07 Thread Peter Geoghegan
On Tue, Sep 5, 2023 at 12:58 AM Thomas Munro wrote: > I hope we get "snapshot too old" back one day. Thanks for working on this. Though I wonder why you didn't do something closer to a straight revert of the feature. Why is nbtree still passing around snapshots needlessly? Also, why are there

Re: old_snapshot_threshold bottleneck on replica

2023-09-05 Thread Thomas Munro
On Wed, Jun 14, 2023 at 3:56 PM Thomas Munro wrote: > On Tue, Feb 14, 2023 at 9:45 AM Andres Freund wrote: > > Indeed. There's a lot of things wrong with it. We have reproducers for > > creating wrong query results. Nobody has shown interest in fixing the > > problems, for several years by now.

Re: old_snapshot_threshold bottleneck on replica

2023-06-13 Thread Thomas Munro
On Tue, Feb 14, 2023 at 9:45 AM Andres Freund wrote: > On 2023-01-24 10:46:28 -0500, Robert Haas wrote: > > On Mon, Jan 23, 2023 at 9:40 AM Maxim Orlov wrote: > > > One of our customers stumble onto a significant performance degradation > > > while running multiple OLAP-like queries on a

Re: old_snapshot_threshold bottleneck on replica

2023-02-13 Thread Andres Freund
Hi, On 2023-01-24 10:46:28 -0500, Robert Haas wrote: > On Mon, Jan 23, 2023 at 9:40 AM Maxim Orlov 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

Re: old_snapshot_threshold bottleneck on replica

2023-01-30 Thread Maxim Orlov
On Fri, 27 Jan 2023 at 18:18, Robert Haas wrote: > > Interesting, but it's still not entirely clear to me from reading the > comments why we should think that this is safe. > In overall, I think this is safe, because we do not change algorithm here. More specific, threshold_timestamp have only

Re: old_snapshot_threshold bottleneck on replica

2023-01-27 Thread Robert Haas
On Fri, Jan 27, 2023 at 9:30 AM Maxim Orlov wrote: > I thank you for your advices. I've dived deeper into the problem and I think > v2 patch is wrong. Cool! > Accessing threshold_timestamp and threshold_xid in > TransactionIdLimitedForOldSnapshots > without lock would lead to an improper

Re: old_snapshot_threshold bottleneck on replica

2023-01-27 Thread Maxim Orlov
On Wed, 25 Jan 2023 at 16:52, Robert Haas wrote: > On Wed, Jan 25, 2023 at 3:52 AM Maxim Orlov wrote: > > Well, that's something we - and ideally you, as the patch author - > need to analyze and figure out. We can't just take a shot and hope for > the best. > I thank you for your advices. I've

Re: old_snapshot_threshold bottleneck on replica

2023-01-25 Thread Robert Haas
On Wed, Jan 25, 2023 at 3:52 AM Maxim Orlov wrote: > But in TransactionIdLimitedForOldSnapshots these variable is using > conjointly. So, I'm not > sure, is it completely safe to remove mutex. Well, that's something we - and ideally you, as the patch author - need to analyze and figure out. We

Re: old_snapshot_threshold bottleneck on replica

2023-01-25 Thread Maxim Orlov
On Tue, 24 Jan 2023 at 18:46, Robert Haas 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)

Re: old_snapshot_threshold bottleneck on replica

2023-01-24 Thread Robert Haas
On Mon, Jan 23, 2023 at 9:40 AM Maxim Orlov 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.

Re: old_snapshot_threshold bottleneck on replica

2023-01-24 Thread Pavel Borisov
Hi, Maxim! On Mon, 23 Jan 2023 at 18:40, Maxim Orlov wrote: > > Hi! > > 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 bottleneck on replica

2023-01-23 Thread Maxim Orlov
Hi! 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. Accessing old_snapshot_threshold parameter is guarded by