Skip to content

Commit 055daf7

Browse files
committed
Show finished streaming WAL message correctly
1 parent 834d64b commit 055daf7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/backup.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
static int standby_message_timeout = 10 * 1000; /* 10 sec = default */
3333
static XLogRecPtr stop_backup_lsn = InvalidXLogRecPtr;
34+
static XLogRecPtr stop_stream_lsn = InvalidXLogRecPtr;
3435

3536
/*
3637
* How long we should wait for streaming end in seconds.
@@ -2579,8 +2580,7 @@ stop_streaming(XLogRecPtr xlogpos, uint32 timeline, bool segment_finished)
25792580
{
25802581
if (xlogpos > stop_backup_lsn)
25812582
{
2582-
elog(LOG, _("finished streaming WAL at %X/%X (timeline %u)"),
2583-
(uint32) (xlogpos >> 32), (uint32) xlogpos, timeline);
2583+
stop_stream_lsn = xlogpos;
25842584
return true;
25852585
}
25862586

@@ -2711,6 +2711,10 @@ StreamLog(void *arg)
27112711
elog(ERROR, "Problem in receivexlog");
27122712
#endif
27132713

2714+
Assert(XRecOffIsValid(stop_stream_lsn));
2715+
elog(LOG, _("finished streaming WAL at %X/%X (timeline %u)"),
2716+
(uint32) (stop_stream_lsn >> 32), (uint32) stop_stream_lsn, starttli);
2717+
27142718
PQfinish(conn);
27152719
conn = NULL;
27162720
}

0 commit comments

Comments
 (0)