pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Reduce overhead of renaming archive status files.
Date: Tue, 26 Jul 2022 07:02:14 +0000
Message-ID: <E1oGEa5-001IyJ-6f@gemulon.postgresql.org> (raw)

Reduce overhead of renaming archive status files.

Presently, archive status files are durably renamed from .ready to
.done to indicate that a file has been archived.  Persisting this
rename to disk accounts for a significant amount of the overhead
associated with archiving.  While durably renaming the file
prevents re-archiving in most cases, archive commands and libraries
must already gracefully handle attempts to re-archive the last
archived file after a crash (e.g., a crash immediately after
archive_command exits but before the server renames the status
file).

This change reduces the amount of overhead associated with
archiving by using rename() instead of durable_rename() to rename
the archive status files.  As a consequence, the server is more
likely to attempt to re-archive files after a crash, but as noted
above, archive commands and modules are already expected to handle
this.  It is also possible that the server will attempt to re-
archive files that have been removed or recycled, but the archiver
already handles this, too.

Author: Nathan Bossart
Reviewed-by: Kyotaro Horiguchi, Fujii Masao
Discussion: https://postgr.es/m/20220222011948.GA3850532@nathanxps13

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/756e221db610f333649385f7fef96e7e9e23ed71

Modified Files
--------------
src/backend/postmaster/pgarch.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)



Message-ID: <E1oGEa5-001IyJ-6f@gemulon.postgresql.org>
Permalink:  ../E1oGEa5-001IyJ-6f@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oGEa5-001IyJ-6f@gemulon.postgresql.org

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org
  Subject: Re: pgsql: Reduce overhead of renaming archive status files.
  In-Reply-To: <E1oGEa5-001IyJ-6f@gemulon.postgresql.org>
  References: <E1oGEa5-001IyJ-6f@gemulon.postgresql.org>

* 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