pgsql: Improve server code to read files as part of a base backup. - Mailing list pgsql-committers

From Robert Haas
Subject pgsql: Improve server code to read files as part of a base backup.
Date
Msg-id E1jlaFW-0003kQ-GS@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Improve server code to read files as part of a base backup.

Don't use fread(), since that doesn't necessarily set errno. We could
use read() instead, but it's even better to use pg_pread(), which
allows us to avoid some extra calls to seek to the desired location in
the file.

Also, advertise a wait event while reading from a file, as we do for
most other places where we're reading data from files.

Patch by me, reviewed by Hamid Akhtar.

Discussion: http://postgr.es/m/CA+TgmobBw-3573vMosGj06r72ajHsYeKtksT_oTxH8XvTL7DxA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2fd2effc50824a8775a088435a13f47b7a6f3b94

Modified Files
--------------
doc/src/sgml/monitoring.sgml         |   4 +
src/backend/postmaster/pgstat.c      |   3 +
src/backend/replication/basebackup.c | 143 +++++++++++++++++++----------------
src/include/pgstat.h                 |   3 +-
4 files changed, 86 insertions(+), 67 deletions(-)


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Minor code cleanup for perform_base_backup().
Next
From: Andres Freund
Date:
Subject: pgsql: Avoid potential spinlock in a signal handler as part of global b