Refactor replication origin state reset helpers.
Masahiko Sawada <msawada@postgresql.org>
Author:
Masahiko Sawada <msawada@postgresql.org>
Date: 2026-01-28T19:45:26Z
Releases:
19 (unreleased)
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/replication/logical/origin.c | modified | +16 −5 |
| src/backend/replication/logical/tablesync.c | modified | +1 −3 |
| src/backend/replication/logical/worker.c | modified | +6 −8 |
| src/include/replication/origin.h | modified | +3 −0 |
Discussion
- Refactor replication origin state reset helpers 31 messages · 2025-12-24 → 2026-01-29