pgsql: Report progress of startup operations that take a long time. - Mailing list pgsql-committers

From Robert Haas
Subject pgsql: Report progress of startup operations that take a long time.
Date
Msg-id E1mf2Jj-0000l6-A9@gemulon.postgresql.org
Whole thread Raw
Responses Re: pgsql: Report progress of startup operations that take a long time.  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Add enable_timeout_every() to fire the same timeout repeatedly.
Next
From: Robert Haas
Date:
Subject: pgsql: Initialize variable to placate compiler.