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 the misuse of origin filter across multiple pg_logical_slot_
Date: Wed, 27 Sep 2023 09:15:13 +0000
Message-ID: <E1qlQdV-006FT0-Bu@gemulon.postgresql.org> (raw)

Fix the misuse of origin filter across multiple pg_logical_slot_get_changes() calls.

The pgoutput module uses a global variable (publish_no_origin) to cache
the action for the origin filter, but we didn't reset the flag when
shutting down the output plugin, so subsequent retries may access the
previous publish_no_origin value.

We fix this by storing the flag in the output plugin's private data.
Additionally, the patch removes the currently unused origin string from the
structure.

For the back branch, to avoid changing the exposed structure, we eliminated the
global variable and instead directly used the origin string for change
filtering.

Author: Hou Zhijie
Reviewed-by: Amit Kapila, Michael Paquier
Backpatch-through: 16
Discussion: http://postgr.es/m/OS0PR01MB571690EF24F51F51EFFCBB0E94FAA@OS0PR01MB5716.jpnprd01.prod.outlook.com

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8d05be93197cd37ef232bd367bb46fa932a557b9

Modified Files
--------------
contrib/test_decoding/expected/replorigin.out | 56 +++++++++++++++++++++++++++
contrib/test_decoding/sql/replorigin.sql      | 22 +++++++++++
src/backend/replication/pgoutput/pgoutput.c   | 14 +++----
3 files changed, 85 insertions(+), 7 deletions(-)



view thread (2+ messages)

Message-ID: <E1qlQdV-006FT0-Bu@gemulon.postgresql.org>
Permalink:  ../E1qlQdV-006FT0-Bu@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qlQdV-006FT0-Bu@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: akapila@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix the misuse of origin filter across multiple pg_logical_slot_
  In-Reply-To: <E1qlQdV-006FT0-Bu@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