diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index 9568ff1..bb8cbd7 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -2208,6 +2208,12 @@ SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid)
 	 * to one.  It will instead point to the multixact ID that will be
 	 * assigned the next time one is needed.
 	 *
+	 * Note that when this is called during xlog replay, the required files
+	 * might have already been removed, and it would be an error to try to read
+	 * them.  To work around this, we test the file for existance before trying
+	 * to read it; if the file doesn't exist, we just don't read it.  We trust
+	 * that a further call to this routine later will set things straight.
+	 *
 	 * NB: oldest_dataminmxid is the oldest multixact that might still be
 	 * referenced from a table, unlike in DetermineSafeOldestOffset, where we
 	 * do this same computation based on the oldest value that might still
@@ -2217,16 +2223,24 @@ SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid)
 	 * new multixacts, which requires the old ones to have first been
 	 * truncated away by a checkpoint.
 	 */
-	LWLockAcquire(MultiXactGenLock, LW_SHARED);
-	if (MultiXactState->nextMXact == oldest_datminmxid)
-	{
-		oldestOffset = MultiXactState->nextOffset;
-		LWLockRelease(MultiXactGenLock);
-	}
-	else
 	{
+		MultiXactId	nextMulti;
+		MultiXactOffset nextOffset;
+		int			pageno;
+
+		/* grab data that requires lock first */
+		LWLockAcquire(MultiXactGenLock, LW_SHARED);
+		nextMulti = MultiXactState->nextMXact;
+		nextOffset = MultiXactState->nextOffset;
 		LWLockRelease(MultiXactGenLock);
-		oldestOffset = find_multixact_start(oldest_datminmxid);
+
+		pageno = MultiXactIdToOffsetPage(oldest_datminmxid);
+
+		if ((nextMulti != oldest_datminmxid) &&
+			(!InRecovery || SimpleLruDoesPhysicalPageExist(pageno)))
+			oldestOffset = find_multixact_start(oldest_datminmxid);
+		else
+			oldestOffset = nextOffset;
 	}
 
 	/* Grab lock for just long enough to set the new limit values */
