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

feichanghong <feichanghong@qq.com>

From: feichanghong <feichanghong@qq.com>
To: feichanghong <feichanghong@qq.com>, pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Date: 2023-12-11T12:13:23Z
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 →
  1. Prevent tuples to be marked as dead in subtransactions on standbys

  2. Allow read only connections during recovery, known as Hot Standby.

Attachments

&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.