mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 00:26:30 +00:00
repmgrd: fix priority/node_id tie-break check
This commit is contained in:
@@ -1943,14 +1943,25 @@ do_election(void)
|
|||||||
candidate_node->priority);
|
candidate_node->priority);
|
||||||
candidate_node = cell->node_info;
|
candidate_node = cell->node_info;
|
||||||
}
|
}
|
||||||
else if (cell->node_info->node_id < candidate_node->node_id)
|
else if (cell->node_info->priority == candidate_node->priority)
|
||||||
{
|
{
|
||||||
log_verbose(LOG_DEBUG, "node %i has lower node_id than current t candidate %i",
|
if (cell->node_info->node_id < candidate_node->node_id)
|
||||||
|
{
|
||||||
|
log_verbose(LOG_DEBUG, "node %i has same priority but lower node_id than current candidate %i",
|
||||||
cell->node_info->node_id,
|
cell->node_info->node_id,
|
||||||
candidate_node->node_id);
|
candidate_node->node_id);
|
||||||
candidate_node = cell->node_info;
|
candidate_node = cell->node_info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
log_verbose(LOG_DEBUG, "node %i has lower priority (%i) than current candidate %i (%i)",
|
||||||
|
cell->node_info->node_id,
|
||||||
|
cell->node_info->priority,
|
||||||
|
candidate_node->node_id,
|
||||||
|
candidate_node->priority);
|
||||||
|
}
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* see if the node is in the primary's location (but skip the check if
|
* see if the node is in the primary's location (but skip the check if
|
||||||
* we've seen a node there already)
|
* we've seen a node there already)
|
||||||
|
|||||||
Reference in New Issue
Block a user