Second part for [pgpool-hackers: 3295] duplicate failover request ...fix
authorMuhammad Usama <m.usama@gmail.com>
Sun, 26 May 2019 20:59:06 +0000 (01:59 +0500)
committerMuhammad Usama <m.usama@gmail.com>
Sun, 26 May 2019 21:08:58 +0000 (02:08 +0500)
commit33df0d33df1ce701f07fecaeef5b87a2707c08f2
tree0977a9b08bdd7b35d74dfab7feacf5f7bfda97d7
parentc7d359630428443775bffb57bfed25a6b6dc65e6
Second part for [pgpool-hackers: 3295] duplicate failover request ...fix

As per the discussion on the thread [pgpool-hackers: 3295] we came to the
conclusion, that the master watchdog node should resign from master
responsibilities if the primary backend node gets into quarantine state on that.

The commit implements the said behaviour by making the master/coordinator watchdog
node resign from its status if it fails to get the consensus for the quarantined
primary node failover, with in FAILOVER_COMMAND_FINISH_TIMEOUT(15) seconds.

When the watchdog master resigns, because of quarantined primary node its
wd_priority is decreased to (-1), so that it should get the least preference
in the next election for the master/coordinator node selection. And once the
election is concluded the wd_priority for the node gets restored to the
original configured value.

In case of failed consensus for standby node failover no action is taken.
src/watchdog/watchdog.c