Re: USE_BARRIER_SMGRRELEASE on Linux? - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: USE_BARRIER_SMGRRELEASE on Linux?
Date
Msg-id 20220216164442.GA2935315@nathanxps13
Whole thread Raw
In response to Re: USE_BARRIER_SMGRRELEASE on Linux?  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: USE_BARRIER_SMGRRELEASE on Linux?
List pgsql-hackers
On Tue, Feb 15, 2022 at 10:57:32PM -0800, Nathan Bossart wrote:
> On Tue, Feb 15, 2022 at 10:14:04PM -0800, Nathan Bossart wrote:
>> It looks like register_unlink_segment() is called prior to the checkpoint,
>> but the checkpointer is not calling RememberSyncRequest() until after
>> SyncPreCheckpoint().  This means that the requests are registered with the
>> next checkpoint cycle count, so they aren't processed until the next
>> checkpoint.
> 
> Calling AbsorbSyncRequests() before advancing the checkpoint cycle counter
> seems to fix the issue.  However, this requires moving SyncPreCheckpoint()
> out of the critical section in CreateCheckPoint().  Patch attached.

An alternative fix might be to call AbsorbSyncRequests() after increasing
the ckpt_started counter in CheckpointerMain().  AFAICT there is a window
just before checkpointing where new requests are registered for the
checkpoint following the one about to begin.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: refactoring basebackup.c
Next
From: Masahiko Sawada
Date:
Subject: Re: do only critical work during single-user vacuum?