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

Yugo Nagata nagata at sraoss.co.jp
Fri May 17 12:10:11 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

This is reported in Bug track #54 by arshu arora



Modified Files
watchdog/wd_child.c |   37 ++++++++++++++++++++++++++++++++++---
1 files changed, 34 insertions(+), 3 deletions(-)

More information about the pgpool-committers mailing list