model-writtenrun 2328 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Niek reported that GIN searches with large JSONB ?| arrays ignored cancellation and statement_timeout during expensive processing, causing repeated connections and resource exhaustion, and supplied a reproducer #1.
- Tom Lane identified quadratic deduplication and required-key probing, proposed stopping deduplication at 1000 keys, updating entryRes incrementally, and adding an interrupt check; he deferred sort-based deduplication as unnecessary complexity and broader probing improvements as requiring an opclass API change #2.
- Tom's startup patch #2 landed as 308d0d4437 with the deduplication cutoff reduced to 100; cancellation was addressed while some worst-case quadratic work remained.
- A month later, Vinod Sridharan reported that shimTriConsistentFn modified entryRes without restoring it, invalidating the optimization's assumption and potentially producing wrong results, and submitted a separate restoration fix #3.
- After Tom requested a reproducer, Vinod demonstrated a missing row using a custom tsvector opclass without a triconsistent function; Tom agreed that restoring the input was required at every call site #4 #5 #6.
- Vinod clarified his concern about extra work during ordinary tuple checks, but accepted the input-preservation contract; Tom judged the cost negligible because at most four MAYBE entries are involved and requested a regression test using existing contrib opclasses #7 #8.
- Vinod supplied an intarray test returning zero rows without the fix and the correct twelve with it, retaining the original restoration implementation #9.
- Tom committed that revision as c7597a1d36, expanded the regression coverage, and additionally fixed the first consistentFn call's ignored recheck flag; his final message confirmed the push, leaving both submitted fixes landed with no patch outstanding #9 #10.