Re: CheckpointLock needed in CreateCheckPoint()? - Mailing list pgsql-hackers

From Dilip Kumar
Subject Re: CheckpointLock needed in CreateCheckPoint()?
Date
Msg-id CAFiTN-t731P7vqewr+Tums+uy+Rxbk9EZDqLgj2Y=q95vQ-Skg@mail.gmail.com
Whole thread Raw
In response to Re: CheckpointLock needed in CreateCheckPoint()?  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
On Thu, Jan 7, 2021 at 12:45 PM Bharath Rupireddy
<bharath.rupireddyforpostgres@gmail.com> wrote:
>
> On Thu, Jan 7, 2021 at 11:32 AM Amul Sul <sulamul@gmail.com> wrote:
> > Snip from CreateCheckPoint():
> > --
> > /*
> >  * Acquire CheckpointLock to ensure only one checkpoint happens at a time.
> >  * (This is just pro forma, since in the present system structure there is
> >  * only one process that is allowed to issue checkpoints at any given
> >  * time.)
> >  */
> > LWLockAcquire(CheckpointLock, LW_EXCLUSIVE);
> > --
> >
> > As per this comment, it seems to be that we don't really need this LW lock. We
> > could have something else instead if we are afraid of having multiple
> > checkpoints at any given time which isn't possible, btw.
>
> Looks like CheckpointLock() can also be called in standalone backends
> (RequestCheckpoint->CreateCheckPoint) along with the checkpointer
> process. Having said that, I'm not quite sure whether it can get
> called at the same time from a backend(may be with checkpoint;
> command) and the checkpointer process.

If it is a standalone backend then there will be no postmaster and no
other process i.e. no checkpoint process also.


-- 
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: A failure of standby to follow timeline switch
Next
From: Heikki Linnakangas
Date:
Subject: Re: Incorrect allocation handling for cryptohash functions with OpenSSL