Adjust recovery PS display as agreed with Simon: 'waiting for XXX'
authorTom Lane
Sun, 30 Sep 2007 17:28:56 +0000 (17:28 +0000)
committerTom Lane
Sun, 30 Sep 2007 17:28:56 +0000 (17:28 +0000)
while the restore_command does its thing, then 'recovering XXX' while
processing the segment file.  These operations are heavyweight enough
that an extra PS display set shouldn't bother anyone.

src/backend/access/transam/xlog.c

index 400bf82be3aa861e8b071cfa7ded2230d9819092..7f518e0ba1be3a06107038023854771a5ff288af 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.284 2007/09/29 18:32:56 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.285 2007/09/30 17:28:56 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -2297,9 +2297,15 @@ XLogFileRead(uint32 log, uint32 seg, int emode)
        if (tli < curFileTLI)
            break;              /* don't bother looking at too-old TLIs */
 
+       XLogFileName(xlogfname, tli, log, seg);
+
        if (InArchiveRecovery)
        {
-           XLogFileName(xlogfname, tli, log, seg);
+           /* Report recovery progress in PS display */
+           snprintf(activitymsg, sizeof(activitymsg), "waiting for %s",
+                    xlogfname);
+           set_ps_display(activitymsg, false);
+
            restoredFromArchive = RestoreArchivedFile(path, xlogfname,
                                                      "RECOVERYXLOG",
                                                      XLogSegSize);
@@ -2314,8 +2320,8 @@ XLogFileRead(uint32 log, uint32 seg, int emode)
            curFileTLI = tli;
 
            /* Report recovery progress in PS display */
-           strcpy(activitymsg, "recovering ");
-           XLogFileName(activitymsg + 11, tli, log, seg);
+           snprintf(activitymsg, sizeof(activitymsg), "recovering %s",
+                    xlogfname);
            set_ps_display(activitymsg, false);
 
            return fd;