model-writtenrun 5105 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Dmytro Astapov reported invalid allocation requests during a parallel hash join in PostgreSQL 13.8, and Thomas Munro recognized that the purported tuple length resembled tuple contents, suggesting that shared-tuplestore reading had lost synchronization #1 #2.
- Astapov traced the corruption to an exact 32760-byte write that bypassed flushing and left the write pointer unchanged, allowing the next tuple to overwrite it; he tested changing one >= comparison to > and then proposed the same correction for the other space check #3 #4 #5.
- Munro submitted the boundary fixes with a C test module that reproduced the failure, also fixing an uninitialized npages counter exposed by the test and potentially by recycled min_dynamic_shared_memory allocations; he left the test module's suitability for inclusion undecided #6.
- Tom Lane questioned whether other DSM users depended on zeroed memory, while Munro argued that the counter was a missed initialization rather than an API guarantee and reported that experimentally clobbering newly created DSM memory passed the tests #7 #8.
- Peter Geoghegan advocated Valgrind instrumentation and investigated potentially uninitialized buffer and WAL statistics, while Lane supported deliberate memory clobbering in testing builds; Geoghegan subsequently established that workers already initialized those statistics, withdrawing that suspected bug #9 #10 #12 #14 #15 #16.
- Geoghegan submitted a separate shm_toc_allocate() clobbering patch and reported that it passed current tests but reliably exposed a previously fixed parallel VACUUM bug when that fix was locally reverted; Munro explained why existing tests missed the npages issue and recommended also clobbering at the lower-level dsm_create() interface #17 #18.
- Geoghegan accepted using both allocation layers, and Masahiko Sawada proposed clobbering pooled memory on detach before submitting a revision retaining shm_toc_allocate() support and adding dsm_create() and dsm_detach() coverage; this diagnostic series remained pending at the thread's final message #19 #20 #21.
- Munro subsequently committed the shared-tuplestore fixes from #6 with identical code hunks as ffcf6f4cfc, crediting Astapov and backpatching through PostgreSQL 11; the experimental test module was omitted, with the commit referring readers to the archived test instead.