pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix logical replication slot initialization
Date: Wed, 01 Aug 2018 22:11:15 +0000
Message-ID: <E1fkzKt-0003g9-NQ@gemulon.postgresql.org> (raw)

Fix logical replication slot initialization

This was broken in commit 9c7d06d60680, which inadvertently gave the
wrong value to fast_forward in one StartupDecodingContext call.  Fix by
flipping the value.  Add a test for the obvious error, namely trying to
initialize a replication slot with an nonexistent output plugin.

While at it, move the CreateDecodingContext call earlier, so that any
errors are reported before sending the CopyBoth message.

Author: Dave Cramer <davecramer@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CADK3HHLVkeRe1v4P02-5hj55H3_yJg3AEtpXyEY5T3wuzO2jSg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c40489e449ea08e154cd62fa055785873f7bdac8

Modified Files
--------------
contrib/test_decoding/expected/slot.out   |  2 ++
contrib/test_decoding/sql/slot.sql        |  2 ++
src/backend/replication/logical/logical.c |  2 +-
src/backend/replication/walsender.c       | 23 +++++++++++++----------
4 files changed, 18 insertions(+), 11 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1fkzKt-0003g9-NQ@gemulon.postgresql.org>
Permalink:  ../E1fkzKt-0003g9-NQ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1fkzKt-0003g9-NQ@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Fix logical replication slot initialization
  In-Reply-To: <E1fkzKt-0003g9-NQ@gemulon.postgresql.org>
  References: <E1fkzKt-0003g9-NQ@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