diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c
index 824bc915b1d1b6160a9f5af1d1c47b86db76669b..7643add6d2cc3f63c9ec7b72b5c0dbe340ef6929 100644
--- a/src/backend/replication/logical/logical.c
+++ b/src/backend/replication/logical/logical.c
@@ -406,11 +406,12 @@ CreateDecodingContext(XLogRecPtr start_lsn,
 		 * decoding. Clients have to be able to do that to support synchronous
 		 * replication.
 		 */
-		start_lsn = slot->data.confirmed_flush;
 		elog(DEBUG1, "cannot stream from %X/%X, minimum is %X/%X, forwarding",
 			 (uint32) (start_lsn >> 32), (uint32) start_lsn,
 			 (uint32) (slot->data.confirmed_flush >> 32),
 			 (uint32) slot->data.confirmed_flush);
+
+		start_lsn = slot->data.confirmed_flush;
 	}
 
 	ctx = StartupDecodingContext(output_plugin_options,