Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ab051bd

Browse files
committed
Adjust recovery PS display as agreed with Simon: 'waiting for XXX'
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.
1 parent 47d2347 commit ab051bd

File tree

1 file changed

+10
-4
lines changed
  • src/backend/access/transam

1 file changed

+10
-4
lines changed

src/backend/access/transam/xlog.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.284 2007/09/29 18:32:56 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.285 2007/09/30 17:28:56 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -2297,9 +2297,15 @@ XLogFileRead(uint32 log, uint32 seg, int emode)
22972297
if (tli < curFileTLI)
22982298
break; /* don't bother looking at too-old TLIs */
22992299

2300+
XLogFileName(xlogfname, tli, log, seg);
2301+
23002302
if (InArchiveRecovery)
23012303
{
2302-
XLogFileName(xlogfname, tli, log, seg);
2304+
/* Report recovery progress in PS display */
2305+
snprintf(activitymsg, sizeof(activitymsg), "waiting for %s",
2306+
xlogfname);
2307+
set_ps_display(activitymsg, false);
2308+
23032309
restoredFromArchive = RestoreArchivedFile(path, xlogfname,
23042310
"RECOVERYXLOG",
23052311
XLogSegSize);
@@ -2314,8 +2320,8 @@ XLogFileRead(uint32 log, uint32 seg, int emode)
23142320
curFileTLI = tli;
23152321

23162322
/* Report recovery progress in PS display */
2317-
strcpy(activitymsg, "recovering ");
2318-
XLogFileName(activitymsg + 11, tli, log, seg);
2323+
snprintf(activitymsg, sizeof(activitymsg), "recovering %s",
2324+
xlogfname);
23192325
set_ps_display(activitymsg, false);
23202326

23212327
return fd;

0 commit comments

Comments
 (0)