Change where we activate back the standby node that was failed.

We will do it where we are sending the message that says that the
standby has recovered, eliminating some complexity
This commit is contained in:
Martín Marqués
2015-12-11 09:36:48 -03:00
parent c9db7f57d2
commit aca2b9547f

View File

@@ -861,26 +861,23 @@ standby_monitor(void)
* Let's continue checking, and if the postgres server on the
* standby comes back up, we will activate it again
*/
continue;
}
break;
case 1:
/*
* There's a possible situation where the standby went down for some reason
* (maintanence for example) and is now up and maybe connected once again to
* the stream. If we set the local standby node as failed and it's now running
* and receiving replication data, we should re-enable it.
*/
set_local_node_status();
break;
}
} while (ret == -1);
if (did_retry)
{
log_info(_("standby connection recovered!\n"));
/*
* There's a possible situation where the standby went down for some reason
* (maintanence for example) and is now up and maybe connected once again to
* the stream. If we set the local standby node as failed and it's now running
* and receiving replication data, we should activate it again.
*/
set_local_node_status();
log_info(_("standby connection recovered!\n"));
}
/* Fast path for the case where no history is requested */