Re: BUG #18241: PushTransaction may cause Standby to execute ItemIdMarkDead

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: feichanghong(at)qq(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18241: PushTransaction may cause Standby to execute ItemIdMarkDead
Date: 2023-12-12 04:49:00
Message-ID: 20231212.134900.641436611909504117.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

At Mon, 11 Dec 2023 20:13:23 +0800, "feichanghong" <feichanghong(at)qq(dot)com> wrote in
> &gt; We have analyzed the cause of the problem: The value of
> &gt;&nbsp;IndexScanDesc-&gt;xactStartedInRecovery is a key condition for determining
> &gt;&nbsp;whether an index item can be marked as DEAD. And it depends on
> &gt;&nbsp;CurrentTransactionState-&gt;startedInRecovery. However, PushTransaction does
> &gt;&nbsp;not assign a value to startedInRecovery when modifying
> &gt;&nbsp;CurrentTransactionState.
> The attached patch has been verified to resolve the mentioned issue.

This appears to be a bug that has existed for a long time since commit
efc16ea520 (in 2009). Your fix looks correct to me, but as for me, the
comment is not particularly necessary, and it would be sufficient to
insert the new line in the location according to the member order
within TransactionStateData.

I have briefly checked and found no issues with other struct members
of TransactionStateData.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Guo 2023-12-12 06:41:13 Re: BUG #18187: Unexpected error: "variable not found in subplan target lists" triggered by JOIN
Previous Message Alexander Lakhin 2023-12-12 03:00:00 Re: BUG #18240: Undefined behaviour in cash_mul_flt8() and friends