model-writtenrun 3326 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Thomas Munro discovered that configurable relation segment sizes could make an incremental-backup stack array enormous and proposed moving it to the heap, while noting that very large heap allocations would remain problematic #1.
- Álvaro Herrera suggested a radix tree #2, but Robert Haas explained that the backup protocol soon needs a materialized array #4; Robert supported heap allocation and suggested sizing arrays to actual file sizes for large segments #3.
- Thomas deferred initdb-time segment-size configuration beyond PostgreSQL 17 because incremental backup relies on segments to bound memory and checksumming work, and said filesystem limits had also undermined eliminating segmentation #5.
- Thomas replaced the heap-allocation proposal with direct use of the caller's output array, sorting and converting block numbers in place #6; Robert endorsed the approach despite the temporarily misleading relative_block_numbers name #7.
- Thomas committed #6 as d8f5acbdb9 with only comment and commit-message edits, then confirmed the stack fix and proposed dynamically sizing the remaining heap buffer to actual file sizes #8.
- Robert supported dynamic sizing and outlined a more ambitious chunked approach, explaining that unordered block enumeration and pg_combinebackup's reconstruction map would need further work; he also cautioned about ecosystem problems with extremely large files #9.
- Thomas submitted a separate dynamic-buffer patch that grows allocations as needed and falls back to full backup when allocation limits intervene #10; the stack fix is landed, while this follow-up remains unresolved, including whether oversized cases should trigger errors, logging, full backup, or huge allocations.