Consolidate replication origin session globals into a single struct.
Masahiko Sawada <msawada@postgresql.org>
Author:
Masahiko Sawada <msawada@postgresql.org>
Date: 2026-01-28T20:26:22Z
Releases:
19 (unreleased)
Consolidate replication origin session globals into a single struct. This commit moves the separate global variables for replication origin state into a single ReplOriginXactState struct. This groups logically related variables, which improves code readability and simplifies state management (e.g., resetting the state) by handling them as a unit. Author: Chao Li <lic@highgo.com> Suggested-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> Discussion: https://postgr.es/m/CAEoWx2=pYvfRthXHTzSrOsf5_FfyY4zJyK4zV2v4W=yjUij1cA@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/twophase.c | modified | +16 −16 |
| src/backend/access/transam/xact.c | modified | +18 −18 |
| src/backend/access/transam/xloginsert.c | modified | +3 −3 |
| src/backend/replication/logical/applyparallelworker.c | modified | +3 −3 |
| src/backend/replication/logical/origin.c | modified | +14 −12 |
| src/backend/replication/logical/tablesync.c | modified | +2 −2 |
| src/backend/replication/logical/worker.c | modified | +14 −14 |
| src/include/replication/origin.h | modified | +8 −3 |
| src/tools/pgindent/typedefs.list | modified | +1 −0 |
Discussion
- Refactor replication origin state reset helpers 31 messages · 2025-12-24 → 2026-01-29