model-writtenrun 9774 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Bartosz Polnik reported that PostgreSQL 11.1 intermittently returned fewer than the expected 31 rows from a parallel join query, while disabling parallel workers restored the correct result #1.
- David Rowley supplied a synthetic reproduction attempt and investigated snapshot or concurrent-update explanations; Bartosz ruled out concurrent changes and reported that vacuuming did not help #2 #3.
- Thomas Munro guided tests separating leader and worker execution, and Bartosz confirmed correct results when either ran alone, including a two-worker plan with leader participation disabled #8 #9 #16 #17.
- Thomas reproduced the failure by extending the synthetic data and found that index-scan matches were filtered out after the leader paused to consume worker tuples, ruling out his earlier suspicion of unintended semijoin behavior #18 #19.
- David traced the failure to a changing nested-loop parameter, supplied an updated reproduction script and suggested removing a redundant equality condition as a workaround; Thomas then demonstrated that NestLoops above and below Gather overwrote the same parameter slot #21 #22.
- Andrew Gierth identified parameter reuse across Gather as unsafe, while Thomas considered saving and restoring parameters; Tom Lane explained the conflicting lifetimes and argued that separate parameter slots would avoid the corruption #24 #25 #26 #27.
- Robert Haas defended partial parallel plans and leader participation for their performance benefits, David proposed parameter contexts around Gather nodes, and Tom chose the simpler approach of preventing slot sharing between distinct NestLoopParams #31 #32 #33.
- Tom posted a proof-of-concept patch that passed check-world and eliminated his reproduction, and Thomas independently confirmed both correct results and distinct parameter slots for the affected NestLoops #34 #35.
- The thread ended with Tom working through how to consolidate parameter assignment into a new module while limiting back-branch API disruption; no revised attachment or review of that refactor appears in the supplied messages #36 #37.
- Tom subsequently committed 1db5667bac, retaining the fix from #34 with substantial restructuring into paramassign.c and backporting the change through PostgreSQL 9.6; the commit omitted a regression test because no suitably small reproducing dataset was available.