pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve performance of pgarch_readyXlog() with many status files
Date: Thu, 11 Nov 2021 20:21:54 +0000
Message-ID: <E1mlGa2-0001A1-HJ@gemulon.postgresql.org> (raw)

Improve performance of pgarch_readyXlog() with many status files.

Presently, the archive_status directory was scanned for each file to
archive.  When there are many status files, say because archive_command
has been failing for a long time, these directory scans can get very
slow.  With this change, the archiver remembers several files to archive
during each directory scan, speeding things up.

To ensure timeline history files are archived as quickly as possible,
XLogArchiveNotify() forces the archiver to do a new directory scan as
soon as the .ready file for one is created.

Nathan Bossart, per a long discussion involving many people. It is
not clear to me exactly who out of all those people reviewed this
particular patch.

Discussion: http://postgr.es/m/CA+TgmobhAbs2yabTuTRkJTq_kkC80-+jw=pfpypdOJ7+gAbQbw@mail.gmail.com
Discussion: http://postgr.es/m/620F3CE1-0255-4D66-9D87-0EADE866985A@amazon.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/beb4e9ba1652a04f66ff20261444d06f678c0b2d

Modified Files
--------------
src/backend/access/transam/xlogarchive.c |  14 +++
src/backend/postmaster/pgarch.c          | 193 ++++++++++++++++++++++++++-----
src/include/postmaster/pgarch.h          |   1 +
3 files changed, 182 insertions(+), 26 deletions(-)



Message-ID: <E1mlGa2-0001A1-HJ@gemulon.postgresql.org>
Permalink:  ../E1mlGa2-0001A1-HJ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mlGa2-0001A1-HJ@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: rhaas@postgresql.org
  Subject: Re: pgsql: Improve performance of pgarch_readyXlog() with many status files
  In-Reply-To: <E1mlGa2-0001A1-HJ@gemulon.postgresql.org>
  References: <E1mlGa2-0001A1-HJ@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