[pgpool-committers: 993] pgpool: Fix possible deadlock during failover with watchdog enabled

Yugo Nagata nagata at sraoss.co.jp
Fri May 17 12:09:45 JST 2013


Fix possible deadlock during failover with watchdog enabled

After backend DB failure is detected, degenerate_backend_set() sends a failover
request signal within a semaphore lock. In addition, when watchdog enabled, this
function also sends packets to other pgpools to propagate the failover request.
However, if the other pgpool does the same simultaneously , a deadlock occurs,
because the failover request have to wait for the lock of each other . Responses
of the packets never return, so both pgpools are blocked.

If there are lots of client, the deadlock will occur more frequently because a
lots of simultaneous failover requests and locks will occur.

To resolve it, return the response packet before the failover request is signaled.
Once the response is returned the semaphore is unlocked soon, and deadlock can be
avoided.

This is reported in Bug track #54 by arshu arora
ttp://www.pgpool.net/mantisbt/view.php?id=54

Branch
------
V3_2_STABLE

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

Modified Files
--------------
watchdog/wd_child.c |   39 +++++++++++++++++++++++++++++++++++----
1 files changed, 35 insertions(+), 4 deletions(-)



More information about the pgpool-committers mailing list