pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Masahiko Sawada <msawada@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor replication origin state reset helpers.
Date: Wed, 28 Jan 2026 19:45:40 +0000
Message-ID: <E1vlBTv-003Eyt-1x@gemulon.postgresql.org> (raw)

Refactor replication origin state reset helpers.

Factor out common logic for clearing replorigin_session_* variables
into a dedicated helper function, replorigin_xact_clear().

This removes duplicated assignments of these variables across multiple
call sites, and makes the intended scope of each reset explicit.

Author: Chao Li <lic@highgo.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/CAEoWx2=pYvfRthXHTzSrOsf5_FfyY4zJyK4zV2v4W=yjUij1cA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/227eb4eea20575d9ef0aac0bdae7b6c2ba261f34

Modified Files
--------------
src/backend/replication/logical/origin.c    | 21 ++++++++++++++++-----
src/backend/replication/logical/tablesync.c |  4 +---
src/backend/replication/logical/worker.c    | 14 ++++++--------
src/include/replication/origin.h            |  3 +++
4 files changed, 26 insertions(+), 16 deletions(-)



Message-ID: <E1vlBTv-003Eyt-1x@gemulon.postgresql.org>
Permalink:  ../E1vlBTv-003Eyt-1x@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vlBTv-003Eyt-1x@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: msawada@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Refactor replication origin state reset helpers.
  In-Reply-To: <E1vlBTv-003Eyt-1x@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