Re: Refactor replication origin state reset helpers

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Refactor replication origin state reset helpers
Date: 2026-01-08 02:07:21
Message-ID: 12089A8D-AB3C-4152-B8DF-C1073CEEE080@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Jan 8, 2026, at 09:46, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> On Wed, Jan 7, 2026 at 5:15 PM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>>
>>
>> On Wed, Jan 7, 2026 at 4:49 PM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>>>
>>>
>>> <v5-0001-Refactor-replication-origin-state-reset-helpers.patch><v5-0002-Consolidate-replication-origin-session-globals-in.patch>
>>>
>>> The CF CI failed a test case, but I don’t think that’s mine. I just did a self-review for v5 and couldn’t find any logic change. So I would guess the CI failure was intermittent. I don’t know how to rerun the CI test other than bumping the patch version and re-posting.
>>
>>
>> V6 is only a rebase, nothing new.
>
> Thank you for updating the patches.
>
> I've made some cosmetic changes to both patches (comments and the
> commit messages). Please review them and let me know what you think.
>
> Regards,
>
> --
> Masahiko Sawada
> Amazon Web Services: https://aws.amazon.com
> <v7-0002-Consolidate-replication-origin-session-globals-in.patch><v7-0001-Refactor-replication-origin-state-reset-helpers.patch>

Only issue:
```
-/* external variables */
-RepOriginId replorigin_session_origin = InvalidRepOriginId; /* assumed identity */
-XLogRecPtr replorigin_session_origin_lsn = InvalidXLogRecPtr;
-TimestampTz replorigin_session_origin_timestamp = 0;
+/* Global variable for per-transaction replication origin state */
+RepOriginXactState replorigin_xact_state = {
+ .origin = InvalidRepOriginId, /* assumed identify */
+ .origin_lsn = InvalidXLogRecPtr,
+ .origin_timestamp = 0
+};
```

“identify" should be “identity".

And a nitpick:
```
+/* Global variable for per-transaction replication origin state */
```

Maybe change “for” to “holding”. But this is really a nitpick, it’s up to you.

Otherwise v7 looks good. Commit messages are now neater.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Jackson 2026-01-08 02:18:12 Re: Proposal: Add a UNIQUE NOT ENFORCED constraint
Previous Message Jacob Jackson 2026-01-08 02:00:43 Re: Proposal: Add a UNIQUE NOT ENFORCED constraint