Re: Locks release order in LogStandbySnapshot

2022-11-08 Thread Japin Li
On Wed, 09 Nov 2022 at 11:21, Andres Freund 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

Re: Locks release order in LogStandbySnapshot

2022-11-08 Thread Andres Freund
Hi, On 2022-11-09 11:03:04 +0800, Japin Li wrote: > GetRunningTransactionData requires holding both ProcArrayLock and > XidGenLock (in that order). Then LogStandbySnapshot releases those > locks in that order. However, to reduce the frequency of having to > wait for XidGenLock while holding Proc

Locks release order in LogStandbySnapshot

2022-11-08 Thread Japin Li
Hi, hackers GetRunningTransactionData requires holding both ProcArrayLock and XidGenLock (in that order). Then LogStandbySnapshot releases those locks in that order. However, to reduce the frequency of having to wait for XidGenLock while holding ProcArrayLock, ProcArrayAdd releases them in reve