Re: Locks release order in LogStandbySnapshot - Mailing list pgsql-hackers

From Japin Li
Subject Re: Locks release order in LogStandbySnapshot
Date
Msg-id MEYP282MB1669EBEAB83DCCBE878B68DAB63E9@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Whole thread Raw
In response to Re: Locks release order in LogStandbySnapshot  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Wed, 09 Nov 2022 at 11:21, Andres Freund <andres@anarazel.de> wrote:
> I think it does. If we allow xid assignment before LogCurrentRunningXacts() is
> done, those new xids would not have been mentioned in the xl_running_xacts
> record, despite already running. Which I think result in corrupted snapshots
> during hot standby and logical decoding.
>
>
>> Does there any sense to release them in reversed acquisition order in
>> LogStandbySnapshot like ProcArrayRemove?
>
> I don't think it's worth optimizing for, this happens at a low frequency
> (whereas connection establishment can be very frequent). And due to the above,
> we can sometimes release ProcArrayLock earlier.
>

Thanks for the explanation!  Got it.

-- 
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.



pgsql-hackers by date:

Previous
From: Andrey Borodin
Date:
Subject: Re: An attempt to avoid locally-committed-but-not-replicated-to-standby-transactions in synchronous replication
Next
From: Michael Paquier
Date:
Subject: Re: User functions for building SCRAM secrets