Re: BackendKeyData is mandatory?
David G. Johnston <david.g.johnston@gmail.com>
From: "David G. Johnston" <david.g.johnston@gmail.com>
To: Tatsuo Ishii <ishii@postgresql.org>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2025-06-17T03:06:26Z
Lists: pgsql-hackers
On Monday, June 16, 2025, Tatsuo Ishii <ishii@postgresql.org> wrote: > > My question is, BackendKeyData is mandatory or not. Currently > Pgpool-II raises a fatal error if BackendKeyData is not sent before > ReadyForQuery arrives. This is because without the message, frontend > cannot send a CancelRequest message later on, as there's no secret > key. I wouldn’t expect a proxy to make a judgement here; but to simply forward what does show up and otherwise stay silent. If there is proxy layer code needed to deal with its absence ignoring the cancel attempt with a log warning would be sufficient. Otherwise, the user has made their choices and this is an optional feature in practice (though resorting to pg_cancel_query make be required for truly hung processes). David J.
Commits
-
Revert unnecessary check for NULL
- 5a26a3e4eeb2 18.0 landed
- 807ee417e562 19 (unreleased) landed
-
libpq: Be strict about cancel key lengths
- e7ff96853ea7 18.0 landed
- e411a8d25a4b 19 (unreleased) landed
-
libpq: Handle OOM by disconnecting instead of hanging or skipping msgs
- 8aa287c9061b 18.0 landed
- f6f0542266f0 19 (unreleased) landed
-
libpq: Complain about missing BackendKeyData later with PGgetCancel()
- 42b1480eb2c6 18.0 landed
- a4801eb691ed 19 (unreleased) landed