model-writtenrun 4401 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Justin Pryzby reported an assertion failure while restoring into PostgreSQL 16 development with wal_level=minimal and a single transaction; the stack showed log_newpage_range() attempting to insert a WAL record without page images #1.
- Tom Lane initially suspected record-space allocation #2, but Matthias van de Meent identified that skipping new pages could leave the final batch empty and supplied a guard to stop before WAL insertion, mentioning forced logging of the last new page as an alternative #3.
- Tom independently reached the empty-record diagnosis #4 and endorsed Matthias's guard, while asking why this longstanding defect had only now become reproducible #5.
- Tom's bisection traced the newly reproducible failure to leaving visibility-map and free-space-map pages uninitialized, and he proposed backpatching the independently defective logging function #6; Andres Freund discussed how bulk extension and existing uninitialized extra pages might also expose the problem #7 #8.
- Tom committed Matthias's guard with only a comment revision in development-branch 3e383f9b68; the other supplied candidate, c796d72969, is the same fix on REL_11_STABLE, and the commit explanation extends backpatching to all supported branches.
- After landing, Tom left unresolved whether older bulk-extension paths could reach this logging failure without a crash #9.
- In response to Justin's request for the bisection test #10, Tom described augmenting the regression database with a thousand tables before dumping and restoring it in one transaction; the thread ended with the fix landed and no further patch pending #11.