Skip to content

Commit

Permalink
Add epoch information to failover auth denied logs
Browse files Browse the repository at this point in the history
When failover deny to vote, sometimes due to network or
some blocking operations, the time of FAILOVER_AUTH_REQUEST
packet arrival is very uncertain. Since there is no epoch
information in these logs, it is hard to associate the log
with other logs.

Signed-off-by: Binbin <[email protected]>
  • Loading branch information
enjoy-binbin committed Jul 23, 2024
1 parent 59aa008 commit 267673f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/cluster_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -4085,14 +4085,14 @@ void clusterSendFailoverAuthIfNeeded(clusterNode *node, clusterMsg *request) {
* with CLUSTERMSG_FLAG0_FORCEACK (manual failover). */
if (clusterNodeIsPrimary(node) || primary == NULL || (!nodeFailed(primary) && !force_ack)) {
if (clusterNodeIsPrimary(node)) {
serverLog(LL_WARNING, "Failover auth denied to %.40s (%s): it is a primary node", node->name,
node->human_nodename);
serverLog(LL_WARNING, "Failover auth denied to %.40s (%s) for epoch %llu: it is a primary node",
node->name, node->human_nodename, (unsigned long long)requestCurrentEpoch);
} else if (primary == NULL) {
serverLog(LL_WARNING, "Failover auth denied to %.40s (%s): I don't know its primary", node->name,
node->human_nodename);
serverLog(LL_WARNING, "Failover auth denied to %.40s (%s) for epoch %llu: I don't know its primary",
node->name, node->human_nodename, (unsigned long long)requestCurrentEpoch);
} else if (!nodeFailed(primary)) {
serverLog(LL_WARNING, "Failover auth denied to %.40s (%s): its primary is up", node->name,
node->human_nodename);
serverLog(LL_WARNING, "Failover auth denied to %.40s (%s) for epoch %llu: its primary is up", node->name,
node->human_nodename, (unsigned long long)requestCurrentEpoch);
}
return;
}
Expand Down

0 comments on commit 267673f

Please sign in to comment.