diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c index e403feeccda..843ceba840b 100644 --- a/src/backend/replication/logical/snapbuild.c +++ b/src/backend/replication/logical/snapbuild.c @@ -1955,8 +1955,12 @@ SnapBuildRestore(SnapBuild *builder, XLogRecPtr lsn) if (TransactionIdPrecedes(ondisk.builder.xmin, builder->initial_xmin_horizon)) goto snapshot_not_interesting; - /* consistent snapshots have no next phase */ + /* + * Consistent snapshots have no next phase. Reset next_phase_at as it is + * possible that an old value may remain. + */ Assert(ondisk.builder.next_phase_at == InvalidTransactionId); + builder->next_phase_at = InvalidTransactionId; /* ok, we think the snapshot is sensible, copy over everything important */ builder->xmin = ondisk.builder.xmin;