Re: BUG #18241: PushTransaction may cause Standby to execute ItemIdMarkDead
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: feichanghong@qq.com
Cc: pgsql-bugs@lists.postgresql.org
Date: 2023-12-12T04:49:00Z
Lists: pgsql-bugs
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Prevent tuples to be marked as dead in subtransactions on standbys
- 4d45ecc9284a 12.18 landed
- d99294e77f1d 13.14 landed
- 0cfd3ddfe070 14.11 landed
- f5d8f59cae3e 15.6 landed
- 0e2c05af90ee 16.2 landed
- 8a7cbfce13d4 17.0 landed
-
Allow read only connections during recovery, known as Hot Standby.
- efc16ea52067 9.0.0 cited
At Mon, 11 Dec 2023 20:13:23 +0800, "feichanghong" <feichanghong@qq.com> wrote in > > We have analyzed the cause of the problem: The value of > > IndexScanDesc->xactStartedInRecovery is a key condition for determining > > whether an index item can be marked as DEAD. And it depends on > > CurrentTransactionState->startedInRecovery. However, PushTransaction does > > not assign a value to startedInRecovery when modifying > > 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