Fix start WAL filename for concurrent backups from standby

On a standby, ThisTimelineID is always 0, so we would generate a
filename in timeline 0 even for other timelines. Instead, use starttli
which we have retreived from the controlfile.

Report by: Francesco Canovai in bug #14230
Author: Marco Nenciarini
Reviewed by: Michael Paquier and Amit Kapila
This commit is contained in:
Magnus Hagander 2016-07-11 12:02:31 +02:00
parent 96112ee7c6
commit 87d84d67bb

View File

@ -9974,7 +9974,7 @@ do_pg_start_backup(const char *backupidstr, bool fast, TimeLineID *starttli_p,
} while (!gotUniqueStartpoint);
XLByteToSeg(startpoint, _logSegNo);
XLogFileName(xlogfilename, ThisTimeLineID, _logSegNo);
XLogFileName(xlogfilename, starttli, _logSegNo);
/*
* Construct tablespace_map file