[pgpool-committers: 3195] pgpool: Allow to access to pgpool while doing health checking

Tatsuo Ishii ishii at postgresql.org
Thu May 5 14:49:45 JST 2016


Allow to access to pgpool while doing health checking

Currently any attempt to connect to pgpool fails if pgpool is doing
health check against failed node even if fail_over_on_backend_error is
off because pgpool child first tries to connect to all backend
including the failed one and exits if it fails to connect to a backend
(of course it fails). This is a temporary situation and will be
resolved before pgpool executes failover. However if the health check
is retrying, the temporary situation keeps longer depending on the
setting of health_check_max_retries and health_check_retry_delay. This
is not good. Attached patch tries to mitigate the problem:

- When an attempt to connect to backend fails, give up connecting to
  the failed node and skip to other node, rather than exiting the
  process if operating in streaming replication mode and the node is
  not primary node.

- Mark the local status of the failed node to "down".

- This will let the primary node be selected as a load balance node
  and every queries will be sent to the primary node. If there's other
  healthy standby nodes, one of them will be chosen as the load
  balance node.

- After the session is over, the child process will suicide to not
  retain the local status.

Per [pgpool-hackers: 1531].

Conflicts:
	pool_connection_pool.c

Branch
------
V3_2_STABLE

Details
-------
http://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=348806c39b80b62510c137f272db3a143bbf8452

Modified Files
--------------
pool.h                   |  1 +
pool_connection_pool.c   | 28 ++++++++++++++++++++++++----
pool_process_reporting.c |  2 +-
3 files changed, 26 insertions(+), 5 deletions(-)



More information about the pgpool-committers mailing list