Re: archive status ".ready" files may be created too early - Mailing list pgsql-hackers

From alvherre@alvh.no-ip.org
Subject Re: archive status ".ready" files may be created too early
Date
Msg-id 202108301951.x66z53s4lq6p@alvherre.pgsql
Whole thread Raw
In response to Re: archive status ".ready" files may be created too early  (Andres Freund <andres@anarazel.de>)
Responses Re: archive status ".ready" files may be created too early  ("Bossart, Nathan" <bossartn@amazon.com>)
Re: archive status ".ready" files may be created too early  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 2021-Aug-28, Andres Freund wrote:

> While rebasing the aio patchset ontop of HEAD I noticed that this commit added
> another atomic operation to XLogWrite() with archiving enabled. The WAL write
> path is really quite hot, and at least some of the
> NotifySegmentsReadyForArchive() calls are done while WALWriteLock is held.
> 
> I think we should at least try to make the fast-path where no segment
> boundaries were crossed use no atomic operations.

I think the best way to achieve this is is to rely completely on
walwriter doing the segment notification, so that the WAL write done by
backend would only do a latch set.

-- 
Álvaro Herrera              Valdivia, Chile  —  https://www.EnterpriseDB.com/



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: Pg stuck at 100% cpu, for multiple days
Next
From: "Bossart, Nathan"
Date:
Subject: Re: archive status ".ready" files may be created too early