Fix for wrong backend roles on standby after the failover
authorMuhammad Usama <m.usama@gmail.com>
Thu, 14 Jun 2018 08:59:53 +0000 (13:59 +0500)
committerMuhammad Usama <m.usama@gmail.com>
Thu, 14 Jun 2018 08:59:53 +0000 (13:59 +0500)
Pgpool standby nodes were getting the "require_backend_sync" signal before the
active/master Pgpool had finish the failover. As a results the standby was
getting the wrong backend node statuses. The cause was a simple coding mistake
where failover indication function was passed with the wrong argument.

Problem reported by Bo Peng <pengbo@sraoss.co.jp>

src/watchdog/wd_commands.c

index 4b7ab6a5bbddaaf64c432d6e5c6be0d9f58b2823..2d0bee7c98a6754e67c0cc4d1e2b22a9e7b2d45a 100644 (file)
@@ -893,14 +893,14 @@ open_wd_command_sock(bool throw_error)
 WDFailoverCMDResults wd_failover_start(void)
 {
        if (pool_config->use_watchdog)
-               return wd_send_failover_func_status_command(0);
+               return wd_send_failover_func_status_command(true);
        return FAILOVER_RES_PROCEED;
 }
 
 WDFailoverCMDResults wd_failover_end(void)
 {
        if (pool_config->use_watchdog)
-               return wd_send_failover_func_status_command(1);
+               return wd_send_failover_func_status_command(false);
        return FAILOVER_RES_PROCEED;
 }