Fixing a few corner cases in the failover request handling of the watchdog.
authorMuhammad Usama <m.usama@gmail.com>
Wed, 10 May 2017 16:09:44 +0000 (21:09 +0500)
committerMuhammad Usama <m.usama@gmail.com>
Wed, 10 May 2017 16:11:43 +0000 (21:11 +0500)
commitc60a96cb859593241a14ef6d4c6b380b80cde005
tree3837f38aec0ef89520cddf3538c622771342d759
parent4013483d3a3be91cab32c6210a98283de724dafa
Fixing a few corner cases in the failover request handling of the watchdog.

Watchdog keeps track of the failover requests it receives from the local and
remote Pgpool-II nodes, propagate that request to the whole cluster and trigger
the failover on local Pgpool-II. And while that failover is in progress it keep
denying the requests for similar failover (same failover kind and same
backend node) until it receives the finish failover intimation for that
failover from Pgpool-II.

But if due to some reason the failover end command is not received by watchdog,
that failover in progress status gets stuck in forever and watchdog keep
rejecting the similar failover requests until it is restarted.
To solve the failover stuck problem this commit adds the timeout to the
failover requests on watchdog side and automatically marks the failover as
finished if it does not receive the end failover intimation within
the timeout period.

Apart from above there was another issue, The functions for sending the failover
request to Pgpool-II main process had void return type and returns no indication
if the request was successfully registered or not. So that fix is also part of
the commit and now they return boolean value indicating the
request registration status.
src/include/pool.h
src/main/pgpool_main.c
src/watchdog/watchdog.c