From: Nathan Bossart <nathandbossart@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: USE_BARRIER_SMGRRELEASE on Linux?
Date: Wed, 16 Feb 2022 08:44:42 -0800
Message-ID: <20220216164442.GA2935315@nathanxps13> (raw)
In-Reply-To: <20220216065732.GA2932808@nathanxps13>
References: <20220215235845.GA2665318@nathanxps13>
<CA+hUKGJxb5ug=sBL=S8WMsFg4mojccy8p1VWqXYEz4MSre_vGA@mail.gmail.com>
<CA+hUKG+Ye6kBWkm9kjMhvAvO0gyrEy=q3rm05XSmZ2ah6auQNw@mail.gmail.com>
<20220216045911.GA2791824@nathanxps13>
<20220216050645.7u3nguccykpqaw7p@alap3.anarazel.de>
<20220216061404.GA2813338@nathanxps13>
<20220216065732.GA2932808@nathanxps13>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: nathandbossart@gmail.com, andres@anarazel.de, thomas.munro@gmail.com
Subject: Re: USE_BARRIER_SMGRRELEASE on Linux?
In-Reply-To: <20220216164442.GA2935315@nathanxps13>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox