From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Report progress of startup operations that take a long time.
Date: Mon, 25 Oct 2021 15:55:19 +0000
Message-ID: <E1mf2Jj-0000l6-A9@gemulon.postgresql.org> (raw)
Report progress of startup operations that take a long time.
Users sometimes get concerned whe they start the server and it
emits a few messages and then doesn't emit any more messages for
a long time. Generally, what's happening is either that the
system is taking a long time to apply WAL, or it's taking a
long time to reset unlogged relations, or it's taking a long
time to fsync the data directory, but it's not easy to tell
which is the case.
To fix that, add a new 'log_startup_progress_interval' setting,
by default 10s. When an operation that is known to be potentially
long-running takes more than this amount of time, we'll log a
status update each time this interval elapses.
To avoid undesirable log chatter, don't log anything about WAL
replay when in standby mode.
Nitin Jadhav and Robert Haas, reviewed by Amul Sul, Bharath
Rupireddy, Justin Pryzby, Michael Paquier, and Álvaro Herrera.
Discussion: https://postgr.es/m/CA+TgmoaHQrgDFOBwgY16XCoMtXxsrVGFB2jNCvb7-ubuEe1MGg@mail.gmail.com
Discussion: https://postgr.es/m/CAMm1aWaHF7VE69572_OLQ+MgpT5RUiUDgF1x5RrtkJBLdpRj3Q@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/9ce346eabf350a130bba46be3f8c50ba28506969
Modified Files
--------------
doc/src/sgml/config.sgml | 24 +++++++++
src/backend/access/transam/xlog.c | 14 ++++++
src/backend/nls.mk | 6 ++-
src/backend/postmaster/startup.c | 71 +++++++++++++++++++++++++++
src/backend/storage/file/fd.c | 21 +++++++-
src/backend/storage/file/reinit.c | 12 +++++
src/backend/utils/misc/guc.c | 13 +++++
src/backend/utils/misc/postgresql.conf.sample | 5 ++
src/include/postmaster/startup.h | 17 +++++++
src/include/utils/timeout.h | 1 +
10 files changed, 181 insertions(+), 3 deletions(-)
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: Report progress of startup operations that take a long time.
In-Reply-To: <E1mf2Jj-0000l6-A9@gemulon.postgresql.org>
References: <E1mf2Jj-0000l6-A9@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