pgpool2.git / summary / log / commit / refs
commit f9149dd4992eb6cbbbdf5d8a3f0a00ef2c0f3071
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Fri Jun 22 08:27:16 2018 +0000
Start health check process at failback.
Health check process will not start if a backend node is in down
status when Pgpool-II starts. However when the node fails back,
health check should start so that it can detects the failure of the
node.
Per bug 407.
src/main/pgpool_main.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/main/pgpool_main.c b/src/main/pgpool_main.c
index 619ae7be6..08e60c47c 100644
--- a/src/main/pgpool_main.c
+++ b/src/main/pgpool_main.c
@@ -2094,6 +2094,19 @@ static void failover(void)
BACKEND_INFO(node_id).backend_hostname,
BACKEND_INFO(node_id).backend_port)));
+ /* Fork health check process if needed */
+ for (i=0;i<NUM_BACKENDS;i++)
+ {
+ if (health_check_pids[i] == 0)
+ {
+ ereport(LOG,
+ (errmsg("start health check process for host %s(%d)",
+ BACKEND_INFO(node_id).backend_hostname,
+ BACKEND_INFO(node_id).backend_port)));
+
+ health_check_pids[i] = worker_fork_a_child(PT_HEALTH_CHECK, do_health_check_child, &i);
+ }
+ }
}
else if (reqkind == PROMOTE_NODE_REQUEST)
{
[parent: 691cc056c60f]