[pgpool-hackers: 4083] BackendKeyData may be missing?
Tatsuo Ishii
ishii at sraoss.co.jp
Sat Jan 1 18:26:28 JST 2022
Happy new year!
In the authentication phase (I mean from reading a startup packet from
frontend before backend sends "ReadyForQuery" message to pgpool)
currently Pgpool-II always wait until "BackendKeyData" message (which
is a key to cancel queries) arrives from backend. I found that this is
not proper behavior from the frontend/backend protocol's point of view.
https://www.postgresql.org/docs/14/protocol-flow.html#id-1.10.5.7.3
"The ReadyForQuery message is the same one that the backend will issue
after each command cycle. Depending on the coding needs of the
frontend, it is reasonable to consider ReadyForQuery as starting a
command cycle, or to consider ReadyForQuery as ending the start-up
phase and each subsequent command cycle."
So the ReadyForQuery message will always arrive at pgpool but
BackendKeyData may not. Even if BackendKeyData does not arrive, the
frontend/backend can continue their communications. Just query cancel
does not work.
Attached is a patch to fix this. I am going to apply this to all
supported branches if there's no objection. But comments and
suggestions are always welcome.
Best reagards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: backend_key_data.patch
Type: text/x-patch
Size: 6561 bytes
Desc: not available
URL: <http://www.pgpool.net/pipermail/pgpool-hackers/attachments/20220101/5db0f60c/attachment.bin>
More information about the pgpool-hackers
mailing list