| From: | Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com> |
|---|---|
| To: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
| Cc: | Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, 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-12 10:16:50 |
| Message-ID: | aY2okoMGbyRcOlsU@ip-10-97-1-34.eu-west-3.compute.internal |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
On Tue, Feb 10, 2026 at 09:35:26AM +0800, Chao Li wrote:
>
>
> > 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
> >
> >
>
> while this patch just fixes one remaining omission.
I did check with the same kind of Coccinelle script used for ec317440716 and
it looks like the proposed change here for InvalidReplOriginId is the only one
to fix for the ReplOriginId type.
FWIW, I extended the exercise for other Invalid* values in [1].
[1]: https://postgr.es/m/aY2oKlSpikgO9m%2BX%40ip-10-97-1-34.eu-west-3.compute.internal
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Amit Kapila | 2026-02-12 10:18:15 | Re: Improve pg_sync_replication_slots() to wait for primary to advance |
| Previous Message | Bertrand Drouvot | 2026-02-12 10:15:06 | Replace literal 0 values with the appropriate Invalid* constants |