diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index e4645a3..b7bed9f 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -8730,18 +8730,20 @@ CreateRestartPoint(int flags)
 
 	/*
 	 * If the last checkpoint record we've replayed is already our last
-	 * restartpoint, we can't perform a new restart point. We still update
-	 * minRecoveryPoint in that case, so that if this is a shutdown restart
-	 * point, we won't start up earlier than before. That's not strictly
-	 * necessary, but when hot standby is enabled, it would be rather weird if
-	 * the database opened up for read-only connections at a point-in-time
-	 * before the last shutdown. Such time travel is still possible in case of
+	 * restartpoint, we can't perform a new restart point.  minRecoveryPoint
+	 * is updated in any case.  If the restart point cannot be created, it
+	 * would be weird when hot standby is enabled, because the database
+	 * may open up for read-only connections at a point-in-time before the
+	 * last shutdown.  Such time travel is still possible in case of
 	 * immediate shutdown, though.
 	 *
-	 * We don't explicitly advance minRecoveryPoint when we do create a
-	 * restartpoint. It's assumed that flushing the buffers will do that as a
-	 * side-effect.
+	 * When the restart point can be performed, updating minRecoveryPoint
+	 * is useful for base backups to ensure that it gets greater than the
+	 * last restart point even if no buffer flushing has occurred, something
+	 * that could happen on systems in recovery with low activity on which
+	 * base backups are taken.
 	 */
+	UpdateMinRecoveryPoint(InvalidXLogRecPtr, true);
 	if (XLogRecPtrIsInvalid(lastCheckPointRecPtr) ||
 		lastCheckPoint.redo <= ControlFile->checkPointCopy.redo)
 	{
@@ -8750,7 +8752,6 @@ CreateRestartPoint(int flags)
 						(uint32) (lastCheckPoint.redo >> 32),
 						(uint32) lastCheckPoint.redo)));
 
-		UpdateMinRecoveryPoint(InvalidXLogRecPtr, true);
 		if (flags & CHECKPOINT_IS_SHUTDOWN)
 		{
 			LWLockAcquire(ControlFileLock, LW_EXCLUSIVE);
diff --git a/src/test/recovery/t/001_stream_rep.pl b/src/test/recovery/t/001_stream_rep.pl
index 7b42f21..cee4768 100644
--- a/src/test/recovery/t/001_stream_rep.pl
+++ b/src/test/recovery/t/001_stream_rep.pl
@@ -24,6 +24,11 @@ $node_standby_1->start;
 # pg_basebackup works on a standby).
 $node_standby_1->backup($backup_name);
 
+# Take a second backup of the standby while the master is offline.
+$node_master->stop;
+$node_standby_1->backup('my_backup_2');
+$node_master->start;
+
 # Create second standby node linking to standby 1
 my $node_standby_2 = get_new_node('standby_2');
 $node_standby_2->init_from_backup($node_standby_1, $backup_name,
