model-writtenrun 3764 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Fei Changhong reported that standby index scans inside subtransactions could incorrectly mark index entries dead because PushTransaction() failed to initialize startedInRecovery, supplied reproduction steps, and asked about the consequences in #1.
- Fei Changhong supplied a tested fix copying startedInRecovery from the parent transaction in #2.
- Kyotaro Horiguchi approved the logic, traced the bug to the introduction of hot standby, checked other transaction-state members, and recommended removing the explanatory comment and following member order in #3.
- Michael Paquier explained the risk of incorrect MVCC visibility, including catalog scans and drivers that routinely use savepoints, and agreed to commit the fix in #4; 8a7cbfce13 landed the assignment from #2 with the suggested comment removal and relocation, with backpatches through PostgreSQL 12.
- After the fix landed, Alvaro Herrera confirmed the initialization coverage, questioned whether affected standbys could retain corruption after promotion, and proposed inline cleanups to member initialization order and subtransaction-counter overflow checking in #5.
- Kyotaro Horiguchi discussed relying on zero initialization for additional fields and suggested that the existing overflow code minimized additions on the normal path in #6.
- Michael Paquier argued that the impact concerned visibility during recovery and explained why cleanup and REINDEX should avoid the proposed post-promotion problem, questioned the need to document zero-initialized fields, and supported simplifying the overflow check in #7; the bug fix was committed, while the cleanup proposals had no demonstrated landing in this thread.