Cluster: always add PFAIL nodes at end of gossip section.

To rely on the fact that nodes in PFAIL state will be shared around by
randomly adding them in the gossip section is a weak assumption,
especially after changes related to sending less ping/pong packets.

We want to always include gossip entries for all the nodes that are in
PFAIL state, so that the PFAIL -> FAIL state promotion can happen much
faster and reliably.

Related to #3929.
This commit is contained in:
antirez
2017-04-14 13:39:49 +02:00
parent 8c829d9e43
commit 02777bb252
2 changed files with 71 additions and 23 deletions

View File

@ -165,6 +165,8 @@ typedef struct clusterState {
/* Messages received and sent by type. */
long long stats_bus_messages_sent[CLUSTERMSG_TYPE_COUNT];
long long stats_bus_messages_received[CLUSTERMSG_TYPE_COUNT];
long long stats_pfail_nodes; /* Number of nodes in PFAIL status,
excluding nodes without address. */
} clusterState;
/* Redis cluster messages header */