Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 77ccbe6

Browse files
committed
Make recovery show the current input WAL segment name in the startup
process' PS display. After a suggestion by Simon (not exactly his patch though).
1 parent f6a54b8 commit 77ccbe6

File tree

1 file changed

+9
-2
lines changed
  • src/backend/access/transam

1 file changed

+9
-2
lines changed

src/backend/access/transam/xlog.c

Lines changed: 9 additions & 2 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.283 2007/09/29 01:36:10 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.284 2007/09/29 18:32:56 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -48,7 +48,7 @@
4848
#include "storage/spin.h"
4949
#include "utils/builtins.h"
5050
#include "utils/pg_locale.h"
51-
51+
#include "utils/ps_status.h"
5252

5353

5454
/* File path names (all relative to $PGDATA) */
@@ -2276,6 +2276,7 @@ XLogFileRead(uint32 log, uint32 seg, int emode)
22762276
{
22772277
char path[MAXPGPATH];
22782278
char xlogfname[MAXFNAMELEN];
2279+
char activitymsg[MAXFNAMELEN + 16];
22792280
ListCell *cell;
22802281
int fd;
22812282

@@ -2311,6 +2312,12 @@ XLogFileRead(uint32 log, uint32 seg, int emode)
23112312
{
23122313
/* Success! */
23132314
curFileTLI = tli;
2315+
2316+
/* Report recovery progress in PS display */
2317+
strcpy(activitymsg, "recovering ");
2318+
XLogFileName(activitymsg + 11, tli, log, seg);
2319+
set_ps_display(activitymsg, false);
2320+
23142321
return fd;
23152322
}
23162323
if (errno != ENOENT) /* unexpected failure? */

0 commit comments

Comments
 (0)