What this usually means
Split-brain arises when a network partition isolates a subset of nodes, causing them to form a separate quorum and elect a new master for a slot already served by the original master. After partition heals, both sides believe they are authoritative, leading to conflicting slot assignments. The cluster's gossip protocol and epoch-based conflict resolution may not resolve this automatically if the partition causes a tie in node majority.
The first ten minutes — establish facts before touching code.
- 1Run `redis-cli -h <node> -p <port> cluster info` on multiple nodes and compare cluster_state and cluster_slots_assigned
- 2Execute `redis-cli -h <node> cluster nodes | grep master` to list all master nodes and check for duplicate slot coverage
- 3Check each node's log for 'Failover author denied' or 'I am the new master' messages around the time of the partition
- 4Inspect `redis-cli cluster slots` output for overlapping slot ranges assigned to different nodes
- 5Verify network connectivity between all nodes using `ping` or `redis-cli -h <node> ping` from each node
- 6Compare config epochs across masters with `redis-cli cluster nodes | awk '{print $1, $7}'` to find inconsistencies
The specific files, logs, configs, and dashboards that usually own this bug.
- search`/var/log/redis/redis-cluster.log` — node-specific logs for failover events and epoch changes
- search`redis-cli cluster info` output — cluster_state, cluster_slots_assigned, cluster_known_nodes
- search`redis-cli cluster nodes` output — node roles, epochs, and slot assignments (column 7 is configEpoch)
- search`/etc/redis/redis.conf` — cluster-node-timeout, cluster-slave-validity-factor, cluster-require-full-coverage
- searchRedis Sentinel logs if used alongside cluster (rare but possible)
- searchNetwork monitoring dashboards (e.g., Grafana) for packet loss, latency spikes between cluster nodes
- searchApplication logs showing MOVED/ASK errors and retry counts
Practical causes, not theory. These are the things you will actually find.
- warning`cluster-node-timeout` set too high, delaying failure detection and allowing stale masters to serve reads
- warningNetwork partition with asymmetric connectivity (e.g., one direction drops but not the other)
- warning`cluster-require-full-coverage yes` causing cluster to reject writes after minority partition loses quorum
- warningManual `CLUSTER FAILOVER` during an unstable network window, creating conflicting epochs
- warningLarge cluster with slow gossip propagation due to `cluster-announce-ip` misconfiguration
- warningIncorrect `cluster-replica-validity-factor` (default 10) allowing stale replicas to become masters
Concrete fix directions. Pick the one that matches your root cause.
- buildIdentify the partition's majority side and force the minority side to forget conflicting nodes using `CLUSTER FORGET <node-id>` on all majority nodes
- buildOn the minority side, `CLUSTER RESET HARD` to clear all cluster state and rejoin as replicas
- buildAdjust `cluster-node-timeout` to a balanced value (e.g., 5000 ms) to ensure timely failover without false positives
- buildSet `cluster-require-full-coverage no` to allow partial service during partitions, then manually reconcile slots
- buildUse `CLUSTER SETSLOT <slot> NODE <node-id>` to reassign slots to the correct master after partition heals
- buildImplement application-level retry with backoff and cross-check slot maps from a majority of nodes
A fix you cannot prove is a guess. Close the loop.
- verifiedRun `redis-cli cluster info` on all nodes and confirm cluster_state:ok with consistent known_nodes count
- verifiedExecute `redis-cli cluster slots` and verify each slot appears exactly once across all nodes
- verifiedWrite a test key on each master and read it from the replica to confirm replication is intact
- verifiedSimulate a partition by blocking network traffic between two nodes (e.g., `iptables -A INPUT -s <ip> -j DROP`) and verify no split-brain occurs after recovery
- verifiedCheck logs for absence of 'epoch conflict' or 'split-brain' warnings after fix
- verifiedMonitor application error rates for MOVED/ASK redirections dropping to zero
Things that make this bug worse or harder to find.
- warningUsing `CLUSTER FAILOVER` manually without ensuring network is stable — prefer automatic failover tuning
- warningResetting only one side (e.g., minority) without coordinating with the majority — leads to persistent conflicts
- warningIgnoring `cluster-require-full-coverage` setting — if yes, minority nodes will reject all writes, making split-brain harder to detect
- warningBlindly lowering `cluster-node-timeout` too much — causes false failovers and increases split-brain probability
- warningNot verifying replica data consistency before promoting — stale replicas can cause permanent data loss
E-commerce Inventory Cluster Split-Brain After Network Blip
Timeline
- 14:02AWS us-east-1a AZ experiences transient network latency spike (150ms) between AZs
- 14:03Master node A (10.0.1.10) and its replica A' (10.0.1.11) become isolated from rest
- 14:05Remaining 4 nodes (masters B, C and replicas B', C') form quorum and elect new master for slot 0-5460 (originally on A)
- 14:06Isolated side (A, A') also elects A as master for same slot after cluster-node-timeout expires
- 14:08Network recovers; both sides see each other but conflict exists for slot 0-5460
- 14:10Client applications start receiving MOVED redirections to both 10.0.1.10 and 10.0.2.10 (new master)
- 14:12Inventory update writes succeed on new master but are lost on old master A; partial writes visible
- 14:15On-call engineer runs `redis-cli cluster info` on node B, sees cluster_state:fail, slots assigned twice
- 14:20Engineer identifies split-brain via duplicate nodes in `cluster nodes` output
- 14:25Forces A and A' to rejoin as replicas of new master using CLUSTER FORGET and CLUSTER REPLICATE
I was paged at 14:15 for a spike in 5xx errors from our inventory service. The application logs showed constant MOVED redirections to two different IPs for the same keys. My first instinct was to check cluster health via `redis-cli cluster info`. Node B reported cluster_state:fail and cluster_slots_assigned:16384, but I knew we had 16384 slots, so that was normal. Then I ran `cluster nodes` and saw two masters claiming slot 0-5460 with different config epochs — classic split-brain.
I checked the timeline: a network blip at 14:02 between AZs. Our cluster-node-timeout was set to 15 seconds, meaning both sides independently declared the other dead after 15 seconds. The majority side (4 nodes) elected a new master for the slot, while the isolated side (2 nodes) kept the original master. When the partition healed, neither side had enough nodes to force a conflict resolution via gossip.
I decided to sacrifice the minority side's data (which was stale anyway) and reset node A and its replica. On the majority side, I ran `CLUSTER FORGET <node-id>` for both A and A' on all four nodes. Then on A and A', I executed `CLUSTER RESET HARD`, which cleared their cluster state. Finally, I re-added them as replicas of the new master using `CLUSTER MEET` and `CLUSTER REPLICATE`. The cluster stabilized within a minute, and we restored service. Post-incident, we lowered cluster-node-timeout to 5000ms and set cluster-require-full-coverage to no.
Root cause
Network partition lasting longer than cluster-node-timeout, causing both sides to independently promote masters for the same slot, combined with cluster-require-full-coverage=yes which prevented the minority from serving reads and masked the split-brain.
The fix
Reset the minority side nodes (CLUSTER RESET HARD) and rejoin as replicas, after forgetting them from the majority side. Adjusted cluster-node-timeout from 15000ms to 5000ms and set cluster-require-full-coverage no.
The lesson
Split-brain in Redis Cluster is often a tuning problem: cluster-node-timeout must balance false positives vs. detection speed. Also, cluster-require-full-coverage=yes can turn a minor partition into a full outage. Always test partition scenarios in staging.
Redis Cluster uses a gossip protocol to propagate node state. Each node maintains a configuration epoch (configEpoch) that is incremented during failovers. When a master fails, replicas attempt to get a majority of votes from other masters to become the new master. During a network partition, both sides may independently achieve a majority within their partition if the partition splits the cluster into two groups that each have a majority of masters (e.g., 2+2 in a 4-master cluster, but Redis Cluster requires odd number of masters? Actually, it requires at least 3 masters for quorum; a 3-master cluster split 2-1 gives majority on one side; but if split 1-1-1? Not possible; typical split-brain occurs with 3 masters and 3 replicas, where a partition isolates 1 master and its replica, leaving 2 masters and 2 replicas on the other side. The majority side (2 masters) can elect a new master for the isolated master's slots because they have quorum (2 > 1). However, the isolated side also has a master (the original) and its replica; they cannot elect a new master because they lack a majority of masters, but the original master remains active and can still serve slots. This creates a conflict: the majority side has a new master with a higher configEpoch, while the isolated side has the old master with a lower configEpoch. When the partition heals, the cluster should ideally resolve this via conflict resolution: nodes with higher epochs are preferred. However, if the partition causes asymmetric connectivity or if the epochs are equal (unlikely), the cluster may not resolve automatically.
In practice, split-brain is rare but occurs when the partition is long enough that both sides consider each other dead, and the minority side still has enough nodes to maintain quorum? Actually, in a 6-node cluster (3 masters, 3 replicas), if 1 master and its replica are isolated, the remaining 2 masters and 2 replicas have a majority of masters (2 out of 3). They can elect a new master for the missing master's slots. The isolated side has 1 master and 1 replica — the master is still alive, so it continues to serve its slots. No new election happens on that side because the original master is still up. But the problem is that the other side has elected a new master for the same slots. So we have two masters claiming the same slots. The cluster's gossip will eventually propagate the higher epoch, but if the partition healed quickly, there might be a tie-breaking issue. Redis uses a deterministic algorithm: when a node learns about two conflicting masters for the same slot, it keeps the one with the higher configEpoch. If epochs are equal, it keeps the one with the lower node ID (lexicographically). This usually resolves split-brain within a few gossip rounds. However, if the partition causes complete isolation where no gossip messages get through for an extended period, the cluster may remain in a split-brain state until manual intervention.
The first sign is often application errors: MOVED redirections to multiple IPs for the same key. Use `redis-cli -h <any-node> cluster slots` to dump the slot-to-node mapping. If you see a slot range appearing under two different master entries, that's definitive. Also, `cluster nodes` output includes flags and epochs. Look for duplicate 'master' entries with the same slot range but different node IDs and configEpochs. Another indicator: `cluster info` shows cluster_state:fail when the cluster detects inconsistency. But note, cluster_state can be fail for other reasons like minority partition.
To quantify, you can write a script that collects `cluster nodes` from all nodes and compares slot assignments. Use `redis-cli --cluster call <host:port> cluster nodes` to run on all nodes. Parse the output to find slots with multiple owners. Also check configEpoch values: if two masters for the same slot have similar epochs (difference < 2), it's likely split-brain. If one epoch is much higher, the lower one should step down automatically, but if that didn't happen, there's a propagation delay or a network issue.
Preventing split-brain starts with network reliability: use redundant networking, multiple AZs, and avoid single points of failure. But at the config level, the most critical parameter is `cluster-node-timeout`. A common mistake is setting it too high (e.g., 30 seconds) to avoid false failovers, but this increases the window for split-brain. A value between 5 and 10 seconds is a reasonable trade-off. Also, set `cluster-slave-validity-factor` to a low value (e.g., 5) to prevent replicas with stale data from becoming masters. Another important setting: `cluster-require-full-coverage no` — with this set to yes, the minority partition will reject all writes, which can cause data loss but also makes the split-brain more apparent? Actually, it prevents writes on the minority side, reducing the chance of inconsistent data. However, it also means the minority side is completely unavailable. I recommend setting it to no in production to allow partial service, but then you must have a strategy to reconcile data after partition.
Additionally, implement client-side slot caching with fallback: clients should periodically refresh the cluster slots map from a known healthy node, and if they get conflicting maps, they should contact a majority of nodes to determine the canonical mapping. Tools like redis-cli's `--cluster check` can also validate cluster consistency.
Frequently asked questions
What is the exact condition that causes split-brain in Redis Cluster?
Split-brain occurs when a network partition isolates a subset of nodes for longer than cluster-node-timeout, causing both sides to independently elect masters for the same hash slot. This typically happens when the partition creates a majority on both sides, which is possible when the cluster has an even number of masters and the partition splits them equally. For example, in a 3-master cluster, a partition isolating 1 master and its replica leaves 2 masters on the other side (majority). That majority can elect a new master for the isolated master's slots, while the isolated master continues to serve those slots. When the partition heals, two masters claim the same slots.
Can Redis Cluster automatically recover from split-brain?
In theory, yes: Redis uses configEpoch-based conflict resolution. When a node learns about two masters for the same slot, it keeps the one with the higher configEpoch. If epochs are equal, it keeps the one with the lower node ID. However, this requires gossip messages to propagate. If the partition was long and both sides have had time to increment epochs independently, the conflict may persist if the epochs are close or if network issues prevent gossip sync. In practice, automatic recovery is unreliable, and manual intervention is often needed.
What is the safest way to resolve split-brain?
The safest method is to identify the majority side (the one with the highest configEpochs or the most consistent data) and force the minority side to rejoin as replicas. On the majority side, use `CLUSTER FORGET <node-id>` for each minority node. Then on each minority node, run `CLUSTER RESET HARD` to clear cluster state, then use `CLUSTER MEET` to rejoin and `CLUSTER REPLICATE <master-id>` to become a replica. This sacrifices any data written to the minority side after the split, but ensures consistency.
How can I monitor for split-brain conditions proactively?
Set up alerts on cluster_state:fail from `redis-cli cluster info`. Also watch for duplicate slot assignments by running a cron job that compares `cluster slots` across all nodes. Use Redis's built-in `--cluster check` tool (e.g., `redis-cli --cluster check <any-node>:6379`) which reports if the cluster is consistent. Additionally, monitor log patterns like 'Possible node split-brain detected' (though this message may not appear in all versions) and track configEpoch changes across masters.
Does Redis Sentinel have split-brain issues?
Redis Sentinel can also experience split-brain, but the mechanism is different: Sentinel uses a quorum of sentinel instances to decide failovers. If the master is reachable from a minority of sentinels, they may trigger a failover while another part of the network still sees the original master as alive. This can lead to two masters. Sentinel's configuration includes `down-after-milliseconds` and `failover-timeout` which should be tuned to minimize this risk. The recovery approach is similar: manually demote the incorrect master and promote the correct one.