From eb54a763a856778f110832a52b19a5f42fa1db0b Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Fri, 13 Apr 2018 08:00:24 +0900 Subject: [PATCH] Fix pcp_detach_node hung when -g option is specified. "pcp_detach_node -g" had been broken since 3.7. The cause was a misuse of degenerate_backend_set_ex(). Because of this, actual failover request was not sent to the pgpool main process. As a result, pcp_worker process waited vainly for a signal arriving from the process. Per bug 391. Problem reported by Tomoyuki Sato, fix by me. --- src/pcp_con/pcp_worker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pcp_con/pcp_worker.c b/src/pcp_con/pcp_worker.c index 952904a1e..aa1a503c0 100644 --- a/src/pcp_con/pcp_worker.c +++ b/src/pcp_con/pcp_worker.c @@ -4,7 +4,7 @@ * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * - * Copyright (c) 2003-2017 PgPool Global Development Group + * Copyright (c) 2003-2018 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby @@ -528,7 +528,7 @@ static int pool_detach_node(int node_id, bool gracefully) /* * Now all frontends have gone. Let's do failover. */ - degenerate_backend_set_ex(&node_id, 1, REQ_DETAIL_SWITCHOVER | REQ_DETAIL_CONFIRMED, false, true); + degenerate_backend_set_ex(&node_id, 1, REQ_DETAIL_SWITCHOVER | REQ_DETAIL_CONFIRMED, false, false); /* * Wait for failover completed. -- 2.39.5