Improve server code to read files as part of a base backup.

Robert Haas <rhaas@postgresql.org>

Commit: 2fd2effc50824a8775a088435a13f47b7a6f3b94
Author: Robert Haas <rhaas@postgresql.org>
Date: 2020-06-17T15:39:17Z
Releases: 14.0
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

Files

PathChange+/−
doc/src/sgml/monitoring.sgml modified +4 −0
src/backend/postmaster/pgstat.c modified +3 −0
src/backend/replication/basebackup.c modified +77 −66
src/include/pgstat.h modified +2 −1

Documentation touched

Discussion