model-writtenrun 9172 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Hadi Moshayedi reported an ExtractReplicaIdentity assertion failure during cascading DELETE operations with wal_level=logical and supplied a reproducer in #1.
- Andres Freund identified DELETE's exemption from opening indexes as the underlying locking gap in #2; Tom Lane initially favored removing that exemption in #3, and Andres compared unconditional index setup, centralized locking, assertion removal, and per-row locking in #4, favoring unconditional setup for PostgreSQL 12.
- Tom proposed avoiding direct index access altogether by using the parent table's cached identity-column bitmap in #5, then posted a patch that fixed the reproducer and passed check-world in #6, while asking why an empty bitmap needed special handling.
- Amit Langote explained that default replica identity without a primary index legitimately produces an empty bitmap in #7; Tom confirmed that DELETE can reach this case and chose to retain the early return, remove its debug message, and document the distinction from UPDATE in #8.
- Tom committed f63a5ead9d from #6 with those logging and comment edits, retaining the bitmap-based implementation and non-null assertions; backpatching was limited to PostgreSQL 12 because the practical risk in older branches appeared low.
- After the commit, Andres questioned whether the change improved safety in #9; Tom explained in #10 that it eliminates an unlocked index relcache load and its potential future hazards, leaving the reported crash fixed while broader DELETE index-locking improvements remained outside this patch.