From 2fd2effc50824a8775a088435a13f47b7a6f3b94 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Wed, 17 Jun 2020 11:39:17 -0400 Subject: 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 --- src/backend/postmaster/pgstat.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/backend/postmaster/pgstat.c') diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index e96134dac8a..c022597bc09 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -3931,6 +3931,9 @@ pgstat_get_wait_io(WaitEventIO w) switch (w) { + case WAIT_EVENT_BASEBACKUP_READ: + event_name = "BaseBackupRead"; + break; case WAIT_EVENT_BUFFILE_READ: event_name = "BufFileRead"; break; -- cgit v1.2.3