On Wed, Aug 26, 2026 at 7:19 PM Bertrand Drouvot
<[email protected]> wrote:
>
> while reviewing [1], I hit an issue due to the fact that an inactive 
> replication
> slot is marked invalid in shared memory before its new state is persisted.
>
> If ReplicationSlotSave() errors before replacing the state file, the slot is
> invalid in shared memory but still valid on disk. That sounds problematic as 
> the
> resource horizon computations could stop accounting for the slot, remove 
> required
> WAL or rows, and then an immediate restart would restore the old valid slot 
> image.
>
> The same issue exists in synchronize_one_slot(): it copies the invalidation 
> from
> the remote slot into the local synchronized slot before saving it. In that 
> case,
> a save error also prevents a direct retry because the next synchronization 
> sees
> the local slot as already invalid and skips it.
>

Won't the drop_local_obsolete_slots() drop the locally invalidated
slot before trying to synchronize the remote_slot in the next slot?

-- 
With Regards,
Amit Kapila.


Reply via email to