model-writtenrun 1522 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Kirill Reshke reported that brin_initialize_empty_new_buffer() unnecessarily emitted full-page WAL records for unlogged relations after marking the buffer dirty #1.
- Kirill supplied a patch guarding the WAL call with RelationNeedsWAL(idxrel), but had no reproducer for the difficult concurrent-write scenario #1.
- Heikki Linnakangas reproduced the bug with an attached script and showed that an immediate restart could leave crash recovery failing with a file-already-exists error #2.
- Heikki confirmed the bug and promised to commit and backpatch Kirill's fix in the thread's final message #2.
- The patch landed unchanged as 951b60f7ab, with an expanded commit explanation and backports through PostgreSQL 14, completing the submitted change #1.