Skip to content

Commit dc1bb78

Browse files
committed
code review from viktor
Signed-off-by: Binbin <binloveplay1314@qq.com>
1 parent 2c01265 commit dc1bb78

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/cluster_legacy.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4438,10 +4438,12 @@ int clusterProcessPacket(clusterLink *link) {
44384438
if (!sender) return 1; /* We don't know that node. */
44394439

44404440
/* We consider this nack only if the sender is a primary serving
4441-
* a non zero number of slots, and its currentEpoch is greater or
4441+
* a non-zero number of slots, and its currentEpoch is greater or
44424442
* equal to epoch where this node started the election. */
4443-
if (server.cluster->failover_auth_time && server.cluster->failover_auth_sent &&
4444-
clusterNodeIsVotingPrimary(sender) && sender_claimed_current_epoch >= server.cluster->failover_auth_epoch) {
4443+
if (server.cluster->failover_auth_time &&
4444+
server.cluster->failover_auth_sent &&
4445+
clusterNodeIsVotingPrimary(sender) &&
4446+
sender_claimed_current_epoch >= server.cluster->failover_auth_epoch) {
44454447
clusterProcessFailoverAuthNack(sender, msg);
44464448
}
44474449
} else if (type == CLUSTERMSG_TYPE_MFSTART) {
@@ -5450,7 +5452,7 @@ void clusterProcessFailoverAuthNack(clusterNode *sender, clusterMsg *request) {
54505452
* for a specific cause; the trailing NACKs k/N gives at-a-glance
54515453
* progress towards the fast-fail threshold. */
54525454
server.cluster->failover_auth_nack_count++;
5453-
serverLog(LL_WARNING,
5455+
serverLog(LL_NOTICE,
54545456
"Failover auth NACK [%s] from %.40s (%s) for epoch %llu (NACKs %d/%d)",
54555457
clusterNackReasonString(request->data.failover_nack.nack.reason), sender->name,
54565458
humanNodename(sender), (unsigned long long)server.cluster->failover_auth_epoch,
@@ -5463,7 +5465,7 @@ void clusterProcessFailoverAuthNack(clusterNode *sender, clusterMsg *request) {
54635465
int needed_quorum = (server.cluster->size / 2) + 1;
54645466
int max_possible_acks = server.cluster->size - server.cluster->failover_auth_nack_count;
54655467
if (max_possible_acks < needed_quorum) {
5466-
serverLog(LL_WARNING,
5468+
serverLog(LL_NOTICE,
54675469
"Failover election for epoch %llu cannot reach quorum %d (NACKs %d/%d). "
54685470
"Resetting the election since we cannot win an election without quorum.",
54695471
(unsigned long long)server.cluster->failover_auth_epoch, needed_quorum,

0 commit comments

Comments
 (0)