diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 483d5c3..f1f54f1 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -4496,7 +4496,15 @@ ReadRecord(XLogReaderState *xlogreader, XLogRecPtr RecPtr, int emode,
 				ControlFile->state = DB_IN_ARCHIVE_RECOVERY;
 				if (ControlFile->minRecoveryPoint < EndRecPtr)
 				{
-					ControlFile->minRecoveryPoint = EndRecPtr;
+					/*
+					 * Altough EndRecPtr is the right value for
+					 * minRecoveryPoint in archive recovery, it is a bit too
+					 * far when the last checkpoint record is the last wal
+					 * record here. Use lastReplayedEndRecPtr as
+					 * minRecoveryPoint point to start hot stanby just after.
+					 */
+					ControlFile->minRecoveryPoint =
+						XLogCtl->lastReplayedEndRecPtr;
 					ControlFile->minRecoveryPointTLI = ThisTimeLineID;
 				}
 				/* update local copy */
