0
0
Redisquery~10 mins

Sentinel quorum concept in Redis - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Sentinel quorum concept
Sentinel nodes monitor master
Detect master failure?
Continue monitoring
Votes >= quorum?
Wait and retry
Sentinel nodes watch the master. If failure is detected, they vote. If votes reach quorum, failover starts.
Execution Sample
Redis
SENTINEL MONITOR master 127.0.0.1 6379 2
SENTINEL SET master quorum 2
-- Master fails
Sentinels vote
Votes reach quorum
Failover starts
Sentinels monitor a master with quorum 2; when master fails, votes are counted and failover starts if quorum reached.
Execution Table
StepEventSentinel VotesQuorumAction
1Master is healthy02Continue monitoring
2Master failure detected by Sentinel 112Wait for more votes
3Master failure detected by Sentinel 222Wait for more votes
4Votes reach quorum22Start failover process
5Failover completed22New master elected
💡 Failover starts after quorum (2 votes) is reached.
Variable Tracker
VariableStartAfter Step 2After Step 3Final
Sentinel Votes0122
Quorum2222
ActionContinue monitoringWait for more votesWait for more votesStart failover process
Key Moments - 2 Insights
Why does Sentinel wait after only one vote?
Because quorum is 2, one vote is not enough to start failover (see execution_table step 2).
What happens if quorum is not reached?
Sentinels keep monitoring and retry voting until quorum is reached or master recovers (implied by step 2 and 3).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the Sentinel Votes count at step 3?
A2
B0
C1
D3
💡 Hint
Check the 'Sentinel Votes' column at step 3 in execution_table.
At which step does the failover process start?
AStep 3
BStep 4
CStep 2
DStep 5
💡 Hint
Look at the 'Action' column for when 'Start failover process' happens.
If quorum was set to 3, what would happen at step 3?
AFailover starts
BVotes reach quorum
CWait for more votes
DFailover completes
💡 Hint
Compare quorum value in variable_tracker and votes at step 3.
Concept Snapshot
Sentinel quorum is the minimum votes needed to start failover.
Sentinels monitor master and vote on failure.
Failover starts only if votes >= quorum.
Quorum prevents false failovers.
Set quorum based on number of Sentinels.
Full Transcript
Redis Sentinel nodes continuously monitor the master server. When a failure is detected by any Sentinel, it votes that the master is down. These votes are counted, and only if the number of votes reaches or exceeds the configured quorum does Sentinel start the failover process to elect a new master. If the votes are below quorum, Sentinels wait and continue monitoring. This quorum mechanism helps avoid false failovers caused by temporary network issues or isolated Sentinel failures. In the example, with quorum set to 2, failover starts only after two Sentinels agree the master is down.