model-writtenrun 1959 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tatsuo Ishii opened the thread because Pgpool-II rejected servers that omitted BackendKeyData, asking whether the message was mandatory; Tom Lane initially considered omission a protocol violation and suggested dummy keys for servers without cancellation support #1 #2.
- Peter Eisentraut and Heikki Linnakangas read BackendKeyData as optional, while Tom argued that the documentation accurately described PostgreSQL and need not specify hypothetical third-party behavior, although clients could defer complaints until cancellation was requested #5 #7 #11.
- Jacob Champion identified a concrete PostgreSQL 18 compatibility regression: PQgetCancel() now returned NULL without a cancellation key, causing psycopg2 connection attempts to fail; Tatsuo then identified Amazon RDS Proxy as an affected server implementation #12 #14 #17.
- Jelte Fennema-Nio proposed returning an empty cancellation object and reporting failure only when cancellation was attempted, and Jacob and Tom supported that approach without preserving the old all-zero CancelRequest behavior absent evidence that servers needed it #15 #19 #20 #21.
- Jelte submitted the compatibility fix together with a separate check enforcing the documented 256-byte cancellation-key maximum #22.
- Jacob confirmed that the compatibility patch restored psycopg2 connections, but found that rejecting an oversized key hung the connection and asked how zero-length keys should behave; he also challenged documentation that treated missing keys as an established declaration of unsupported cancellation #23.
- Discussion between Jelte and Jacob expanded the validation requirements to exactly four bytes for protocol 3.0 and four through 256 bytes for newer protocols, while debating how protocol documentation should distinguish intended behavior from historical libpq behavior #24 #25 #26 #27.
- Jelte incorporated those checks and expanded documentation, then revised error cleanup to follow handleSyncLoss() after Jacob questioned whether merely setting CONNECTION_BAD was safe inside the parser #28 #29 #30.
- Heikki later supported fixing the old cancellation API but questioned changing PQcancelCreate(), whose failed connection object already carried a useful error; Jelte checked its users and agreed to drop that portion because the identified clients created cancellation objects only when needed #32 #33.
- Heikki committed the old-API portion of #30 as a4801eb691, shortened the protocol documentation, and deferred stricter missing-key semantics and improvements to psql's cancellation error presentation #34 #35.
- While reviewing the remaining validation patch, Heikki identified an unnecessary fe-connect.c check, which Jelte agreed to remove, then discovered analogous OOM hangs in notification processing and silent loss of parameter-status values #36 #37 #38.
- Jelte supported disconnecting on these allocation failures; after Tom suggested retrying later, Heikki explained that the existing retry path could wait forever for data that would never arrive, and Jelte agreed #39 #41 #42 #43.
- Heikki supplied a substantially expanded series containing a minimal hang fix, generalized disconnection on OOM, and Jelte's remaining key-length checks; he recommended combining the OOM work rather than landing the intermediate silent-discard behavior separately, while leaving some query-associated error-parsing cases outside scope #45.
- Jelte reviewed the expanded series positively and pointed out an unnecessary NULL guard before free(svname), while also suggesting a comment change that Heikki ultimately declined #46 #47.
- Heikki combined the first two patches of #45 unchanged in code as f6f0542266 and landed its third patch with clearer error wording as e411a8d25a.
- Having overlooked Jelte's NULL-guard cleanup before pushing, Heikki immediately removed that guard in 807ee417e5, implementing the review suggestion from #46.
- The thread ended with the remaining patches pushed and backpatched to PostgreSQL 18; Heikki deferred older-branch OOM backports because the code was intricate and no field complaints had been received, leaving broader backpatching available if needed #47.