Teach repmgrd that if the node is promoted it should exit

This commit is contained in:
Jaime Casanova
2010-10-23 20:19:09 -05:00
parent 91276394e8
commit 4641ddcc3f

View File

@@ -197,6 +197,15 @@ MonitorExecute(void)
unsigned long long int lsn_standby_received;
unsigned long long int lsn_standby_applied;
/* Check if we still are a standby, we could be promoted */
if (!is_standby(myLocalConn))
{
fprintf(stderr, "\n%s: seems like we have been promoted, so exit from monitoring...\n",
progname);
CloseConnections();
exit(1);
}
/*
* first check if there is a command being executed,
* and if that is the case, cancel the query so i can