model-writtenrun 4431 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Matthias van de Meent opened the thread with #1, showing that WAL insertion could overflow length fields or emit records too large for recovery, and proposed checks in registration and assembly.
- Heikki Linnakangas recommended enforcing the actual uint16 block-data limit during registration and reducing redundant checks in #2, while Andres Freund supplied a pg_logical_emit_message() reproducer and performance advice in #4.
- Matthias incorporated that feedback through #5 and #7, including unsigned length arguments and a shared error helper; Andres rejected a regression test requiring roughly a gigabyte of RAM in #6.
- David Zhang's initial replication test in #11 prompted Matthias to clarify in #12 that the patch prevents new unreadable records but cannot repair previously generated WAL.
- Michael Paquier identified missing reader allocation overhead in #16, leading Matthias to add calculated size limits and reader checks in #17; David then reported passing tests and successful rejection of oversized WAL on the primary in #18.
- Michael simplified the rebased patch in #20, arguing that preventing invalid records at insertion avoided reader-side changes and proposing to land the unsigned APIs and block-data protection first.
- A side discussion about reclaiming WAL-header space for resource-manager flags developed in #21 and #22, but remained outside these overflow fixes.
- Heikki argued in #23 that a structure-dependent maximum could change incompatibly between releases and proposed a fixed 1020 MiB limit; Matthias adopted it in #26 while retaining registration-time overflow protection.
- After Michael's microbenchmark found no measurable block-registration overhead in #25, ffd1b6bb6f landed the unsigned APIs and block-data subset of #26, leaving whole-record protection for later as explained in #27.
- Matthias explained in #28 why mainrdata_len still needed protection before assembly and why the maximum record size belonged in the public format definitions.
- Following months without progress, Andres objected to closing the bug in #32, warned that errors inside critical sections would become PANICs, and proposed separating record construction from insertion; #33 also recommended uint64 accumulation.
- Alvaro Herrera revived the remaining patch with a rebase in #34, explicitly disclaiming review, and Michael subsequently posted #35 with checked uint32 additions, richer diagnostics, and initialization-time validation of the size cap.
- Matthias returned with #36, combining a broad construction/insertion split with a simpler overflow patch using uint64 accumulators; Michael preferred the simpler checks but deferred the API refactoring to possible PostgreSQL 17 work in #37.
- Michael found that widening mainrdata_len required careful uint32 serialization in #38 and supplied the corrected standalone patch in #39; Matthias acknowledged the big-endian issue and approved the revision in #40.
- 8fcb32db98 landed #39 with diagnostic wording changes and an explicit xl_tot_len cast, completing the whole-record overflow and 1020 MiB limit work, as announced in #42.
- At the thread's close, both overflow-protection stages had landed on the development branch, while Matthias planned a separate construction/insertion thread and asked about backports in #43; Michael raised ABI and newly restricted record-size compatibility concerns in #44, leaving backporting unresolved.