0
0
Redisquery~10 mins

Why Sentinel provides high availability in Redis - Visual Breakdown

Choose your learning style9 modes available
Concept Flow - Why Sentinel provides high availability
Start: Redis Master and Slaves Running
Sentinel Monitors Master
Detects Master Failure?
NoContinue Monitoring
Yes
Sentinel Elects New Master from Slaves
Update Clients to Use New Master
Resume Normal Operations with New Master
Sentinel watches the Redis master. If it fails, Sentinel picks a new master from slaves and tells clients to use it, keeping the system available.
Execution Sample
Redis
1. Sentinel monitors master
2. Detects failure
3. Elects new master
4. Updates clients
5. System continues
This sequence shows how Sentinel detects failure and switches to a new master to keep Redis available.
Execution Table
StepSentinel ActionConditionResultSystem State
1Monitor masterMaster is healthyNo fail detectedMaster active, slaves syncing
2Monitor masterMaster not respondingFail detectedMaster down
3Start failoverFail confirmed by quorumElect new masterOne slave promoted
4Update clientsNew master electedClients redirectedClients connected to new master
5Resume monitoringNew master activeNormal operationHigh availability restored
💡 Sentinel stops failover after new master is elected and clients are updated
Variable Tracker
VariableStartAfter Step 2After Step 3After Step 4Final
Master StatusHealthyDownDownDownNew Master Active
Failover StateNoneFail DetectedFailover In ProgressFailover DoneNone
Client ConnectionTo MasterTo Master (Failing)SwitchingTo New MasterTo New Master
Key Moments - 2 Insights
Why does Sentinel wait for quorum before electing a new master?
Sentinel waits for quorum to avoid false failover; this ensures multiple Sentinels agree the master is down (see execution_table step 3).
What happens if clients are not updated after failover?
Clients would keep trying the old master and fail; updating clients (step 4) is crucial to maintain availability.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at which step does Sentinel detect the master failure?
AStep 1
BStep 3
CStep 2
DStep 4
💡 Hint
Check the 'Condition' and 'Result' columns in execution_table row for Step 2
According to variable_tracker, what is the client connection state after step 4?
AConnected to new master
BSwitching connection
CConnected to old master
DDisconnected
💡 Hint
Look at 'Client Connection' row under 'After Step 4' in variable_tracker
If Sentinel did not update clients after failover, what would happen?
AClients connect to new master automatically
BClients fail to connect and lose availability
CClients continue normal operation
DSentinel restarts the master
💡 Hint
Refer to key_moments explanation about client updates after failover
Concept Snapshot
Sentinel monitors Redis master continuously.
If master fails, Sentinel confirms failure with quorum.
Sentinel elects a slave as new master.
Clients are updated to use new master.
This automatic failover keeps Redis highly available.
Full Transcript
Redis Sentinel provides high availability by monitoring the master server. It continuously checks if the master is working. When Sentinel detects the master is down, it waits for agreement from other Sentinels (quorum) to avoid mistakes. Then, Sentinel chooses one of the slaves to become the new master. After that, Sentinel updates all clients to connect to this new master. This process ensures Redis keeps working without manual intervention, maintaining high availability.