pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Prevent use of invalidated logical slot in CreateDecodingContext
Date: Sat, 08 Apr 2023 05:35:04 +0000
Message-ID: <E1pl1E7-001zUl-0r@gemulon.postgresql.org> (raw)

Prevent use of invalidated logical slot in CreateDecodingContext()

Previously we had checks for this in multiple places. Support for logical
decoding on standbys will add other forms of invalidation, making it worth
while to centralize the checks.

This slightly changes the error message for both the walsender and SQL
interface. Particularly the SQL interface error was inaccurate, as the "This
slot has never previously reserved WAL" portion was unreachable.

Reviewed-by: "Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>
Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/20230407075009.igg7be27ha2htkbt@awork3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4397abd0a2af955326c0608d63f3716ce5901004

Modified Files
--------------
src/backend/replication/logical/logical.c      | 16 ++++++++++++++++
src/backend/replication/logical/logicalfuncs.c | 13 -------------
src/backend/replication/walsender.c            |  7 -------
3 files changed, 16 insertions(+), 20 deletions(-)



Message-ID: <E1pl1E7-001zUl-0r@gemulon.postgresql.org>
Permalink:  ../E1pl1E7-001zUl-0r@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pl1E7-001zUl-0r@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Prevent use of invalidated logical slot in CreateDecodingContext
  In-Reply-To: <E1pl1E7-001zUl-0r@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox