model-writtenrun 558 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jan Nidzwetzki reported that uninitialized parallel GIN worker counters could corrupt pg_class.reltuples, that VACUUM could amplify bad density estimates to Infinity, and that non-finite counts could prevent autoanalyze indefinitely; he proposed initialization and recovery patches while raising statistics-import validation separately #1.
- Tomas Vondra accepted explicit counter initialization as the cleaner fix and promised backpatching, but questioned recovery limited to non-finite values and supported rejecting clearly invalid imported statistics #2.
- Tomas posted revisions that consolidated GIN counter initialization and extended automatic recovery to impossible tuple densities, while warning that plausible but incorrect densities would escape detection and recovery could interfere with deliberately simulated statistics #3.
- Tomas reported that his experiments consistently produced zero rather than obvious garbage and that Valgrind did not flag the uninitialized access, leaving the practical reproduction conditions uncertain #4.
- Jan accepted the revised GIN fix and agreed to abandon automatic recovery because it covered too few corruption cases, favoring manual ANALYZE guidance and import validation; he also explained why the negative unknown-count sentinel must remain accepted #5.
- Jan subsequently described debugger confirmation of the uninitialized read, but still lacked a reliable SQL reproducer that persisted random positive values because compiler initialization patterns produced negative doubles rejected before catalog updates #6.
- Jan submitted a separate import-validation patch that warns and rejects Infinity, -Infinity, and NaN while preserving the -1 sentinel, with regression coverage #7.
- Tomas committed the GIN initialization portion of #3 as 1232f7a083 and the import-validation patch from #7 with only commit-message edits as 7cb9060dcd; both fixes were backpatched through PostgreSQL 18.
- The thread ended with Tomas confirming both fixes were pushed, accepting existing handling of values between -1 and zero, and promising release-note guidance to run explicit ANALYZE on potentially affected tables; automatic recovery remained abandoned #8.