pgsql: Persist slot invalidation correctly

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Persist slot invalidation correctly
Date: 2020-06-27 00:42:17
Message-ID: E1joyvB-0002QJ-CS@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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 <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Author: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Reviewed-by: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Discussion: https://postgr.es/m/17a69cfe-f1c1-a416-ee25-ae15427c69eb@oss.nttdata.com

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2020-06-27 04:32:11 pgsql: Remove duplicate check added by commit b2a5545bd6.
Previous Message Bruce Momjian 2020-06-26 22:24:23 pgsql: doc: PG 13 relnotes; remove FOREIGN keyword item and clarify