diff options
author | Tom Lane | 2007-12-18 00:49:34 +0000 |
---|---|---|
committer | Tom Lane | 2007-12-18 00:49:34 +0000 |
commit | 260a4b6b94ce7e2d1c3d0e4d7fed72fe21d44b03 (patch) | |
tree | cf439e7aa1741966ccf15528c325c1dd3f25150c | |
parent | 45cbed70da58b18f6499e9e22de7199b3fd1beec (diff) |
Make archiver process report its progress in PS display. Per
proposal by Simon Riggs, though not exactly his patch.
-rw-r--r-- | src/backend/postmaster/pgarch.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c index c5ee1475aa..1af4df1979 100644 --- a/src/backend/postmaster/pgarch.c +++ b/src/backend/postmaster/pgarch.c @@ -414,6 +414,7 @@ pgarch_archiveXlog(char *xlog) { char xlogarchcmd[MAXPGPATH]; char pathname[MAXPGPATH]; + char activitymsg[MAXFNAMELEN + 16]; char *dp; char *endp; const char *sp; @@ -471,6 +472,11 @@ pgarch_archiveXlog(char *xlog) ereport(DEBUG3, (errmsg_internal("executing archive command \"%s\"", xlogarchcmd))); + + /* Report archive activity in PS display */ + snprintf(activitymsg, sizeof(activitymsg), "archiving %s", xlog); + set_ps_display(activitymsg, false); + rc = system(xlogarchcmd); if (rc != 0) { @@ -527,11 +533,17 @@ pgarch_archiveXlog(char *xlog) xlogarchcmd))); } + snprintf(activitymsg, sizeof(activitymsg), "failed on %s", xlog); + set_ps_display(activitymsg, false); + return false; } ereport(DEBUG1, (errmsg("archived transaction log file \"%s\"", xlog))); + snprintf(activitymsg, sizeof(activitymsg), "last was %s", xlog); + set_ps_display(activitymsg, false); + return true; } |