model-writtenrun 5143 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Hao Wu proposed saving the next-list pointer before invoking transaction and subtransaction callbacks so that a callback could safely unregister itself #1.
- Andres Freund considered the change reasonable but questioned frequent registration and unregistration because removal is O(N); Hao explained that he wanted a callback to run once when a subtransaction ended and unregister itself in the same place #2 #3.
- Tom Lane argued that self-unregistration should work regardless of efficiency, extended the fix to ResourceOwnerReleaseInternal, and added comments in a revised patch while initially favoring backpatching #4.
- Nathan Bossart approved the revised patch and expressed no opinion on backpatching #5.
- Tom Lane committed the revised patch unchanged as 4d2a844242, crediting Hao Wu; he announced that it landed only on HEAD because backpatching could encourage extensions to rely on behavior absent from older installations, and PostgreSQL 15 was already past its first release candidate #4 #6.