aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-12-18 00:49:34 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-12-18 00:49:34 +0000
commit5335fabe8c6ccbe3535b8f87ac181632fb1c13c0 (patch)
treee0290192065eb38ea1c5758fe7ab45f79a00876a /src
parentdbc632eb37e33c88345b84aa489514d5b3bb38cf (diff)
downloadpostgresql-5335fabe8c6ccbe3535b8f87ac181632fb1c13c0.tar.gz
postgresql-5335fabe8c6ccbe3535b8f87ac181632fb1c13c0.zip
Make archiver process report its progress in PS display. Per
proposal by Simon Riggs, though not exactly his patch.
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/pgarch.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c
index 8b62fb6098c..b80fcee85fb 100644
--- a/src/backend/postmaster/pgarch.c
+++ b/src/backend/postmaster/pgarch.c
@@ -19,7 +19,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.35 2007/12/12 16:53:14 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.36 2007/12/18 00:49:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -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;
}