[pgpool-committers: 4900] pgpool: Fix segfault when node 0 is in down status.

Tatsuo Ishii ishii at postgresql.org
Sun Aug 5 15:28:08 JST 2018


Fix segfault when node 0 is in down status.

MASTER_CONNECTION refers to the connection to "master"
node. "Master" means the first live backend appearing in
pgpool.conf. The master node is determined at the time of fail over.
Unfortunately with both health check and fail_over_on_backend_error
are disabled, there's no chance of failover, which means the master
node id is remained the default value 0. So the MASTER_CONNECTION
refers to the node 0, and the connection is NULL.

Fix is as follows.

If attempt to connection to backend fails, check the master node id in
the shared memory.  If the master node id is the failed node, then
look for new master node using get_next_master_node (this was a static
function, but now it's made to public) and set the node id to the
master node id in the shared memory area.

Problem reported by Muhammad Usama in [pgpool-hackers: 2905].

Branch
------
V3_4_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=5f915b345cb9a848f66ab567784256495eea2aa2

Modified Files
--------------
src/include/pool.h                  |  1 +
src/main/pgpool_main.c              |  3 +--
src/protocol/pool_connection_pool.c | 11 +++++++++++
3 files changed, 13 insertions(+), 2 deletions(-)



More information about the pgpool-committers mailing list