From: Robert Haas Date: Fri, 29 Oct 2021 17:23:11 +0000 (-0400) Subject: xlogfuncs.c: Use GetCurrentTimeLineID() instead of ThisTimeLineID. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=cb412b73629e798e92df40f92d396f04aa3234e3;p=users%2Frhaas%2Fpostgres.git xlogfuncs.c: Use GetCurrentTimeLineID() instead of ThisTimeLineID. The value can't be changing concurrently, because these functions can't be run during recovery. So there's no problem. --- diff --git a/src/backend/access/transam/xlogfuncs.c b/src/backend/access/transam/xlogfuncs.c index 5bebcc50dd..2b1c598bc6 100644 --- a/src/backend/access/transam/xlogfuncs.c +++ b/src/backend/access/transam/xlogfuncs.c @@ -469,7 +469,8 @@ pg_walfile_name_offset(PG_FUNCTION_ARGS) * xlogfilename */ XLByteToPrevSeg(locationpoint, xlogsegno, wal_segment_size); - XLogFileName(xlogfilename, ThisTimeLineID, xlogsegno, wal_segment_size); + XLogFileName(xlogfilename, GetCurrentTimeLineID(), xlogsegno, + wal_segment_size); values[0] = CStringGetTextDatum(xlogfilename); isnull[0] = false; @@ -511,7 +512,8 @@ pg_walfile_name(PG_FUNCTION_ARGS) "pg_walfile_name()"))); XLByteToPrevSeg(locationpoint, xlogsegno, wal_segment_size); - XLogFileName(xlogfilename, ThisTimeLineID, xlogsegno, wal_segment_size); + XLogFileName(xlogfilename, GetCurrentTimeLineID(), xlogsegno, + wal_segment_size); PG_RETURN_TEXT_P(cstring_to_text(xlogfilename)); }