model-writtenrun 9972 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Chao Li opened the thread with #1, proposing static StringInfoData storage to eliminate allocations that were unnecessary because COPY data comes from walrcv_receive().
- Álvaro Herrera questioned using StringInfo merely to hold three fields in #2, prompting Chao to introduce a small CopyBuf structure in #3.
- Denis Smirnov argued in #4 that initReadOnlyStringInfo() already expresses the required external-buffer ownership and cursor semantics, making the separate CopyBuf type unnecessary.
- ZizhuanLiu supplied #5, retaining Chao's authorship credit while restoring StringInfoData, moving its static storage into copy_read_data(), and using initReadOnlyStringInfo() for each incoming buffer.
- Aleksander Alekseev marked the patch rejected over its limited value in #6, but Álvaro's review in #7 supported the read-only approach and requested clearer documentation that the current buffer must be consumed before another receive; he also observed that current callers always request a minimum of one byte.
- Álvaro committed #5 as 7720f61b7d, adding ownership comments and an assertion that the previous buffer is exhausted before receiving again, and announced the completed push in #8.
- After the cleanup landed, Chao reported in #9 that the pre-existing leftover-data path fails to advance outbuf, potentially overwriting bytes if minread exceeds the leftover count; current callers cannot trigger it, and he planned a separate thread for the fix.