Persist slot invalidation correctly

We failed to save slot to disk after invalidating it, so the state was
lost in case of server restart or crash.  Fix by marking it dirty and
flushing.

Also, if the slot is known invalidated we don't need to reason about the
LSN at all -- it's known invalidated.  Only test the LSN if the slot is
known not invalidated.

Author: Fujii Masao <[email protected]>
Author: Kyotaro Horiguchi <[email protected]>
Reviewed-by: Álvaro Herrera <[email protected]>
Discussion: 
https://postgr.es/m/[email protected]

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3b4b541777f0b85df7626623ef78df0ea48ca5dc

Modified Files
--------------
src/backend/replication/slot.c      |  9 +++++----
src/backend/replication/slotfuncs.c | 16 ++++++++--------
2 files changed, 13 insertions(+), 12 deletions(-)

Reply via email to