Fix start WAL filename for concurrent backups from standby
authorMagnus Hagander <magnus@hagander.net>
Mon, 11 Jul 2016 10:02:31 +0000 (12:02 +0200)
committerMagnus Hagander <magnus@hagander.net>
Mon, 11 Jul 2016 10:02:31 +0000 (12:02 +0200)
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

src/backend/access/transam/xlog.c

index e4645a316918d17066d32e5bb8956c79e0f876e0..aecede149cf8852f354d5cac63ff219ed9ab2c57 100644 (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