pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove the unnecessary PrepareWrite in pgoutput.
Date: Tue, 16 Feb 2021 02:04:48 +0000
Message-ID: <E1lBpjM-0006Z7-Kn@gemulon.postgresql.org> (raw)

Remove the unnecessary PrepareWrite in pgoutput.

This issue exists from the inception of this code (PG-10) but got exposed
by the recent commit ce0fdbfe97 where we are using origins in tablesync
workers. The problem was that we were sometimes sending the prepare_write
('w') message but then the actual message was not being sent and on the
subscriber side, we always expect a message after prepare_write message
which led to this bug.

I refrained from backpatching this because there is no way in the core
code to hit this prior to commit ce0fdbfe97 and we haven't received any
complaints so far.

Reported-by: Erik Rijkers
Author: Amit Kapila and Vignesh C
Tested-by: Erik Rijkers
Discussion: https://postgr.es/m/1295168140.139428.1613133237154@webmailclassic.xs4all.nl

Branch
------
master

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

Modified Files
--------------
src/backend/replication/pgoutput/pgoutput.c | 19 ++++----
src/test/subscription/t/100_bugs.pl         | 69 +++++++++++++++++++++++++++++
2 files changed, 80 insertions(+), 8 deletions(-)



Message-ID: <E1lBpjM-0006Z7-Kn@gemulon.postgresql.org>
Permalink:  ../E1lBpjM-0006Z7-Kn@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lBpjM-0006Z7-Kn@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: akapila@postgresql.org
  Subject: Re: pgsql: Remove the unnecessary PrepareWrite in pgoutput.
  In-Reply-To: <E1lBpjM-0006Z7-Kn@gemulon.postgresql.org>
  References: <E1lBpjM-0006Z7-Kn@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