[pgpool-committers: 7331] pgpool: Fix segfault when ALWAYS_PRIMARY is set but DISALLOW_TO_FAILOVE

Tatsuo Ishii ishii at sraoss.co.jp
Tue Dec 15 19:59:42 JST 2020


Fix segfault when ALWAYS_PRIMARY is set but DISALLOW_TO_FAILOVER.

If a primary node (for example node 0) has ALWAYS_PRIMARY but does
have DISALLOW_TO_FAILOVER, segfault happens in following step:

1) node 0 stops

2) failover happens. all children restart. The primary node is still 0
because ALWAYS_PRIMARY is set.

2) node 0 starts and it becomes online by using pcp_attach_node.

3) failback process is executed but child process do not restart.

4) child process accesses node 0 because Req_info->primary_node_id is
0 but connection to node 0 does not exist and this causes segfault.

To fix this, do additional check to make sure that failback node is
not former primary node. If it is, do full restart of child process.

Per bug 672.

Branch
------
V4_2_STABLE

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

Modified Files
--------------
src/main/pgpool_main.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)



More information about the pgpool-committers mailing list