From aca2b9547fb712c8ec5cbf62b2bf41cbebe3f3c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Marqu=C3=A9s?= Date: Fri, 11 Dec 2015 09:36:48 -0300 Subject: [PATCH] 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 --- repmgrd.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/repmgrd.c b/repmgrd.c index bfbb28cc..6dee8aae 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -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 */