pgsql: Refactor replication origin state reset helpers.

From: Masahiko Sawada <msawada(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Refactor replication origin state reset helpers.
Date: 2026-01-28 19:45:40
Message-ID: E1vlBTv-003Eyt-1x@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)highgo(dot)com>
Reviewed-by: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Reviewed-by: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Reviewed-by: Álvaro Herrera <alvherre(at)kurilemu(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Masahiko Sawada 2026-01-28 20:27:02 pgsql: Consolidate replication origin session globals into a single str
Previous Message Masahiko Sawada 2026-01-28 19:04:26 pgsql: Standardize replication origin naming to use "ReplOrigin".