From 68ab982906187fba3530a01b01eb065ea9134298 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Tue, 3 Dec 2019 18:59:09 +0900 Subject: [PATCH] Fix thinkos from commit 9989d37 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index ad08468420..6bc1a6b46d 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -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,