Refactor replication origin state reset helpers

Chao Li <li.evan.chao@gmail.com>

From: Chao Li <li.evan.chao@gmail.com>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-12-24T01:28:37Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Consolidate replication origin session globals into a single struct.

  2. Refactor replication origin state reset helpers.

Attachments

Hi Hacker,

While reviewing patches [1] and [2], I noticed some duplicate code of
clearing replication origin states, I am proposing a small patch that
removes the duplicate code blocks by introducing a couple helper
functions. No functional change at all.

[1]
https://postgr.es/m/TY4PR01MB169078771FB31B395AB496A6B94B4A@TY4PR01MB16907.jpnprd01.prod.outlook.com
[2] https://postgr.es/m/aUTekQTg4OYnw-Co@paquier.xyz

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/