| From: | Amit Kapila <akapila(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Fix the misuse of origin filter across multiple pg_logical_slot_ |
| Date: | 2023-09-27 09:15:13 |
| Message-ID: | E1qlQdV-006FSy-BB@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
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
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/54ccfd65868c013a8c6906bc894bc5ea3640740a
Modified Files
--------------
contrib/test_decoding/expected/replorigin.out | 56 +++++++++++++++++++++++++++
contrib/test_decoding/sql/replorigin.sql | 22 +++++++++++
src/backend/replication/pgoutput/pgoutput.c | 19 +++++----
src/include/replication/pgoutput.h | 2 +-
4 files changed, 90 insertions(+), 9 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Daniel Gustafsson | 2023-09-27 11:08:38 | pgsql: llvmjit: Use explicit LLVMContextRef for inlining |
| Previous Message | Michael Paquier | 2023-09-27 05:42:17 | pgsql: unaccent: Tweak value of PYTHON when building without Python sup |