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: Fix data inconsistency between publisher and subscriber.
Date: Thu, 16 Jun 2022 03:29:41 +0000
Message-ID: <E1o1gCT-000Gku-7k@gemulon.postgresql.org> (raw)

Fix data inconsistency between publisher and subscriber.

We were not updating the partition map cache in the subscriber even when
the corresponding remote rel is changed. Due to this data was getting
incorrectly replicated for partition tables after the publisher has
changed the table schema.

Fix it by resetting the required entries in the partition map cache after
receiving a new relation mapping from the publisher.

Reported-by: Shi Yu
Author: Shi Yu, Hou Zhijie
Reviewed-by: Amit Langote, Amit Kapila
Backpatch-through: 13, where it was introduced
Discussion: https://postgr.es/m/OSZPR01MB6310F46CD425A967E4AEF736FDA49@OSZPR01MB6310.jpnprd01.prod.outlook.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1f9a7738eb84f341a9b39689f33c887d1ef39487

Modified Files
--------------
src/backend/replication/logical/relation.c | 34 ++++++++++++++++++++++++++++++
src/backend/replication/logical/worker.c   |  3 +++
src/include/replication/logicalrelation.h  |  1 +
src/test/subscription/t/013_partition.pl   | 17 ++++++++++++++-
4 files changed, 54 insertions(+), 1 deletion(-)



view thread (3+ messages)

Message-ID: <E1o1gCT-000Gku-7k@gemulon.postgresql.org>
Permalink:  ../E1o1gCT-000Gku-7k@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1o1gCT-000Gku-7k@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: Fix data inconsistency between publisher and subscriber.
  In-Reply-To: <E1o1gCT-000Gku-7k@gemulon.postgresql.org>
  References: <E1o1gCT-000Gku-7k@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