diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c index f286918f69..18b4abbb4c 100644 --- a/src/backend/replication/slot.c +++ b/src/backend/replication/slot.c @@ -560,6 +560,15 @@ ReplicationSlotRelease(void) ReplicationSlotDropAcquired(); } + /* + * Clear the candidate_xxx fields so we don't use the old values + * in the next time. + */ + slot->candidate_catalog_xmin = InvalidTransactionId; + slot->candidate_xmin_lsn = InvalidXLogRecPtr; + slot->candidate_restart_valid = InvalidXLogRecPtr; + slot->candidate_restart_lsn = InvalidXLogRecPtr; + /* * If slot needed to temporarily restrain both data and catalog xmin to * create the catalog snapshot, remove that temporary constraint.