Re: Null commitTS bug

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, kingsboa(at)amazon(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Null commitTS bug
Date: 2022-01-17 04:01:25
Message-ID: 3917423.1642392085@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier <michael(at)paquier(dot)xyz> writes:
> On Mon, Jan 17, 2022 at 11:17:24AM +0900, Kyotaro Horiguchi wrote:
>> I found some confusing lines around but they need not a fix
>> considering back-patching conflict?
>>> i += j - i + 1;

> I am not sure. Do you have anything specific in mind? Perhaps
> something that would help in making the code logic easier to follow?

Isn't that a very bad way to write "i = j + 1"?

I agree with Horiguchi-san that

for (i = 0, headxid = xid;;)

is not great style either. A for-loop ought to be used to control the
number of iterations, not as a confusing variable initialization.
I think more idiomatic would be

headxid = xid;
i = 0;
for (;;)

which makes it clear that this is not where the loop control is.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2022-01-17 04:18:49 Re: Skipping logical replication transactions on subscriber side
Previous Message Dilip Kumar 2022-01-17 03:59:33 Re: Add sub-transaction overflow status in pg_stat_activity