mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
repmgrd: in BDR mode, have each repmgrd monitor each node
This will cover both the case when an entire node including repmgrd goes down, and when one PostgreSQL instance goes down but repmgrd is still up (in which case only one of the repmgrds will handle the failover).
This commit is contained in:
@@ -47,7 +47,6 @@ static PGconn *primary_conn = NULL;
|
||||
static ElectionResult do_election(void);
|
||||
static const char *_print_voting_status(NodeVotingStatus voting_status);
|
||||
static const char *_print_election_result(ElectionResult result);
|
||||
static const char *_print_monitoring_state(MonitoringState monitoring_state);
|
||||
|
||||
static FailoverState promote_self(void);
|
||||
static void notify_followers(NodeInfoList *standby_nodes, int follow_node_id);
|
||||
@@ -315,7 +314,7 @@ monitor_streaming_primary(void)
|
||||
log_info(_("monitoring primary node \"%s\" (node ID: %i) in %s state"),
|
||||
local_node_info.node_name,
|
||||
local_node_info.node_id,
|
||||
_print_monitoring_state(monitoring_state));
|
||||
print_monitoring_state(monitoring_state));
|
||||
|
||||
if (monitoring_state == MS_DEGRADED)
|
||||
{
|
||||
@@ -617,7 +616,7 @@ monitor_streaming_standby(void)
|
||||
local_node_info.node_id,
|
||||
upstream_node_info.node_name,
|
||||
upstream_node_info.node_id,
|
||||
_print_monitoring_state(monitoring_state));
|
||||
print_monitoring_state(monitoring_state));
|
||||
|
||||
if (monitoring_state == MS_DEGRADED)
|
||||
{
|
||||
@@ -1459,22 +1458,6 @@ _print_election_result(ElectionResult result)
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
static const char *
|
||||
_print_monitoring_state(MonitoringState monitoring_state)
|
||||
{
|
||||
switch(monitoring_state)
|
||||
{
|
||||
case MS_NORMAL:
|
||||
return "normal";
|
||||
|
||||
case MS_DEGRADED:
|
||||
return "degraded";
|
||||
}
|
||||
|
||||
/* should never reach here */
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
|
||||
|
||||
static ElectionResult
|
||||
|
||||
Reference in New Issue
Block a user