[pgpool-committers: 4903] 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_7_STABLE

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

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