|
24 | 24 | #include "access/xlogarchive.h"
|
25 | 25 | #include "common/archive.h"
|
26 | 26 | #include "miscadmin.h"
|
| 27 | +#include "pgstat.h" |
27 | 28 | #include "postmaster/startup.h"
|
28 | 29 | #include "postmaster/pgarch.h"
|
29 | 30 | #include "replication/walsender.h"
|
@@ -168,7 +169,9 @@ RestoreArchivedFile(char *path, const char *xlogfname,
|
168 | 169 | /*
|
169 | 170 | * Copy xlog from archival storage to XLOGDIR
|
170 | 171 | */
|
| 172 | + pgstat_report_wait_start(WAIT_EVENT_RESTORE_COMMAND); |
171 | 173 | rc = system(xlogRestoreCmd);
|
| 174 | + pgstat_report_wait_end(); |
172 | 175 |
|
173 | 176 | PostRestoreCommand();
|
174 | 177 | pfree(xlogRestoreCmd);
|
@@ -284,7 +287,8 @@ RestoreArchivedFile(char *path, const char *xlogfname,
|
284 | 287 | * This is currently used for recovery_end_command and archive_cleanup_command.
|
285 | 288 | */
|
286 | 289 | void
|
287 |
| -ExecuteRecoveryCommand(const char *command, const char *commandName, bool failOnSignal) |
| 290 | +ExecuteRecoveryCommand(const char *command, const char *commandName, |
| 291 | + bool failOnSignal, uint32 wait_event_info) |
288 | 292 | {
|
289 | 293 | char xlogRecoveryCmd[MAXPGPATH];
|
290 | 294 | char lastRestartPointFname[MAXPGPATH];
|
@@ -354,7 +358,10 @@ ExecuteRecoveryCommand(const char *command, const char *commandName, bool failOn
|
354 | 358 | /*
|
355 | 359 | * execute the constructed command
|
356 | 360 | */
|
| 361 | + pgstat_report_wait_start(wait_event_info); |
357 | 362 | rc = system(xlogRecoveryCmd);
|
| 363 | + pgstat_report_wait_end(); |
| 364 | + |
358 | 365 | if (rc != 0)
|
359 | 366 | {
|
360 | 367 | /*
|
|
0 commit comments