Fix thinkos from commit 9989d37
authorMichael Paquier <michael@paquier.xyz>
Tue, 3 Dec 2019 09:59:09 +0000 (18:59 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 3 Dec 2019 09:59:09 +0000 (18:59 +0900)
Error messages referring to incorrect WAL segment names could have been
generated for a fsync() failure or when creating a new segment at the
end of recovery.

src/backend/access/transam/xlog.c

index ad0846842058c29963fadaa422eb604bf4f19f3b..6bc1a6b46d68f899d24afe666d8fe6efbc3498f1 100644 (file)
@@ -5528,7 +5528,7 @@ exitArchiveRecovery(TimeLineID endTLI, XLogRecPtr endOfLog)
            char        xlogfname[MAXFNAMELEN];
            int         save_errno = errno;
 
-           XLogFileName(xlogfname, ThisTimeLineID, openLogSegNo,
+           XLogFileName(xlogfname, ThisTimeLineID, startLogSegNo,
                         wal_segment_size);
            errno = save_errno;
            ereport(ERROR,
@@ -10166,7 +10166,7 @@ issue_xlog_fsync(int fd, XLogSegNo segno)
        char        xlogfname[MAXFNAMELEN];
        int         save_errno = errno;
 
-       XLogFileName(xlogfname, ThisTimeLineID, openLogSegNo,
+       XLogFileName(xlogfname, ThisTimeLineID, segno,
                     wal_segment_size);
        errno = save_errno;
        ereport(PANIC,