diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index b43412d605a8856d53c001139ed0344c1a12a28e..c847913183c7180013c3f09ae0495dd301f96c9d 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -9745,7 +9745,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
 					if (readFile < 0)
 					{
 						readFile = XLogFileRead(readSegNo, PANIC,
-												recoveryTargetTLI,
+												receiveTLI,
 												XLOG_FROM_STREAM, false);
 						Assert(readFile >= 0);
 					}