model-writtenrun 9892 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Richard Guo reported that failure during a session's first transaction startup could leave CurrentUserId invalid, and proposed guarding user-ID restoration in both transaction and subtransaction abort paths in #1.
- Michael Paquier reproduced the resulting crashes and replaced the validity guard with transaction-state-based restoration in #2; Richard confirmed the Greenplum trigger and supported preserving TRANS_START during abort in #3.
- Michael examined subtransaction startup failures in #4 and refined the patch in #5, retaining unconditional subtransaction restoration, moving top-level security-context capture immediately before TRANS_INPROGRESS, and adding error-injection hooks for testing.
- Tom Lane argued in #6 that relying on the last action before TRANS_INPROGRESS would not scale, proposing instead to initialize TransactionState and capture the security context before any fallible operations, with an assertion replacing the initial warning.
- Michael implemented that approach and reported checking his error-injection cases in #7; Tom reviewed the result and supported applying the assertion change to back branches in #8.
- Commit b4721f3950 landed #7 unchanged, replacing the earlier abort-path approach with early startup initialization; Michael confirmed completion and backpatching in #9, leaving no outstanding work stated in the thread.