Deal with idle_session_timeout.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 26 Oct 2022 23:45:17 +0000 (08:45 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Thu, 27 Oct 2022 00:02:20 +0000 (09:02 +0900)
commitae7e163040336808170b83e20f1a99f243a752d8
treea133f3c8d09f64485b81da86a05f9dbbeec084af
parent7de9635ab738cd45418d9b781aedad74f76639fe
Deal with idle_session_timeout.

If idle_session_timeout (added in PostgreSQL 14) is enabled and the
timeout fires, followings happen:

- If failover_on_backend_error is on (the default), Pgpool-II will
  trigger failover.

- If only one of PostgreSQL servers enables idle_session_timeout,
  Pgpool-II could hang.

To deal with idle_session_timeout detect_idle_session_timeout_error()
is added to detect the error code for idle_session_timeout. If the
error is detected, Pgpool-II returns the error code to frondend as a
fatal error and disconnects the session.  This is a similar fix
implemented for idle_in_transaction_session_timeout.

https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=3f5986eee360f12e6a0bb77aa46f95abf5f6bc10

Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2022-October/004209.html
Back-path-through: 4.0
src/include/protocol/pool_proto_modules.h
src/protocol/pool_process_query.c