Re: USE_BARRIER_SMGRRELEASE on Linux?
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Thomas Munro <thomas.munro@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-02-16T16:44:42Z
Lists: 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
Commits
-
Fix race between DROP TABLESPACE and checkpointing.
- fe197872cfe8 10.21 landed
- ca522c60a5db 11.16 landed
- c918f07dd479 12.11 landed
- 51e760e5a667 13.7 landed
- 26e007939809 14.3 landed
- 46d9bfb0a68f 15.0 landed