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: Make archiver process an auxiliary process.
Date: Mon, 15 Mar 2021 04:14:16 +0000
Message-ID: <E1lLecS-0000kF-TC@gemulon.postgresql.org> (raw)

Make archiver process an auxiliary process.

This commit changes WAL archiver process so that it's treated as
an auxiliary process and can use shared memory. This is an infrastructure
patch required for upcoming shared-memory based stats collector patch
series. These patch series basically need any processes including archiver
that can report the statistics to access to shared memory. Since this patch
itself is useful to simplify the code and when users monitor the status of
archiver, it's committed separately in advance.

This commit simplifies the code for WAL archiving. For example, previously
backends need to signal to archiver via postmaster when they notify
archiver that there are some WAL files to archive. On the other hand,
this commit removes that signal to postmaster and enables backends to
notify archier directly using shared latch.

Also, as the side of this change, the information about archiver process
becomes viewable at pg_stat_activity view.

Author: Kyotaro Horiguchi
Reviewed-by: Andres Freund, Álvaro Herrera, Julien Rouhaud, Tomas Vondra, Arthur Zakirov, Fujii Masao
Discussion: https://postgr.es/m/20180629.173418.190173462.horiguchi.kyotaro@lab.ntt.co.jp

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/monitoring.sgml             |   1 +
src/backend/access/transam/xlogarchive.c |   4 +-
src/backend/bootstrap/bootstrap.c        |  22 +--
src/backend/postmaster/pgarch.c          | 239 +++++++++++++------------------
src/backend/postmaster/postmaster.c      |  81 +++++------
src/backend/storage/ipc/ipci.c           |   2 +
src/include/miscadmin.h                  |   2 +
src/include/postmaster/pgarch.h          |  14 +-
src/include/storage/pmsignal.h           |   1 -
src/include/storage/proc.h               |   8 +-
src/tools/pgindent/typedefs.list         |   1 +
11 files changed, 162 insertions(+), 213 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1lLecS-0000kF-TC@gemulon.postgresql.org>
Permalink:  ../E1lLecS-0000kF-TC@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lLecS-0000kF-TC@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: Make archiver process an auxiliary process.
  In-Reply-To: <E1lLecS-0000kF-TC@gemulon.postgresql.org>
  References: <E1lLecS-0000kF-TC@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