Re: Fix incorrect assignment for nodeid in TransactionIdGetCommitTsData()

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: wangpeng <215722532(at)qq(dot)com>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Subject: Re: Fix incorrect assignment for nodeid in TransactionIdGetCommitTsData()
Date: 2026-02-10 01:35:26
Message-ID: B708143C-0677-4AC2-8815-86FD25A723A1@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Feb 5, 2026, at 23:00, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> wrote:
>
> On Thu, Feb 5, 2026 at 9:09 AM wangpeng <215722532(at)qq(dot)com> wrote:
>>
>> Hi hackers,
>>
>> This is my first patch
>
> Welcome to the community.
>
>> There is an incorrect assignment of nodeid = 0 in
>> TransactionIdGetCommitTsData() (commit_ts.c).
>> Elsewhere in the file, the code consistently uses InvalidReplOriginId.
>> Even though InvalidReplOriginId also evaluates to 0, it should be used
>> here for clarity and consistency.
>
> Few lines below we have a similar assignment which uses
> InvalidReplOriginId. I agree with your suggestion. Patch LGTM. It's an
> old and small commit so maybe Alvaro, who committed the change
> (4aaddf2f009821e29aea3735e44332ad9ca47aaa), may not remember it. Still
> including him in case.
>
> --
> Best Wishes,
> Ashutosh Bapat
>
>

+1. I saw a recent commit, ec317440716487753bafa4c0f8adae53e2c32446, which replaces 0 with InvalidXLogRecPtr, so this patch is similar. The main difference is that ec3174407 does a broad sweep replacing 0 wherever possible, while this patch just fixes one remaining omission.

So if this patch is considered too trivial, I think it’s still worth a place in Michael’s stack for later.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2026-02-10 02:07:16 Re: Optimize IS DISTINCT FROM with non-nullable inputs
Previous Message Peter Geoghegan 2026-02-10 01:27:10 Re: Problems with get_actual_variable_range's VISITED_PAGES_LIMIT