Re: Decouple last important WAL record LSN from WAL insert locks

2022-11-28 Thread Bharath Rupireddy
On Mon, Nov 28, 2022 at 11:55 PM Andres Freund wrote: > > > Is tracking lastImportantPos as pg_atomic_uint64 in XLogCtlInsert any > > better than an explicit spinlock? I think it's better on platforms > > where atomics are supported, however, it boils down to using a spin > > lock on the

Re: Decouple last important WAL record LSN from WAL insert locks

2022-11-28 Thread Andres Freund
Hi, On 2022-11-28 11:42:19 +0530, Bharath Rupireddy wrote: > On Sun, Nov 27, 2022 at 2:43 AM Andres Freund wrote: > > On 2022-11-23 19:12:07 +0530, Bharath Rupireddy wrote: > > > While working on something else, I noticed that each WAL insert lock > > > tracks its own last important WAL record's

Re: Decouple last important WAL record LSN from WAL insert locks

2022-11-27 Thread Bharath Rupireddy
On Sun, Nov 27, 2022 at 2:43 AM Andres Freund wrote: > > Hi, > > On 2022-11-23 19:12:07 +0530, Bharath Rupireddy wrote: > > While working on something else, I noticed that each WAL insert lock > > tracks its own last important WAL record's LSN (lastImportantAt) and > > both the bgwriter and

Re: Decouple last important WAL record LSN from WAL insert locks

2022-11-26 Thread Andres Freund
Hi, On 2022-11-23 19:12:07 +0530, Bharath Rupireddy wrote: > While working on something else, I noticed that each WAL insert lock > tracks its own last important WAL record's LSN (lastImportantAt) and > both the bgwriter and checkpointer later computes the max > value/server-wide last important

Decouple last important WAL record LSN from WAL insert locks

2022-11-23 Thread Bharath Rupireddy
Hi, While working on something else, I noticed that each WAL insert lock tracks its own last important WAL record's LSN (lastImportantAt) and both the bgwriter and checkpointer later computes the max value/server-wide last important WAL record's LSN via GetLastImportantRecPtr(). While doing so,