In a rolling Redis upgrade under Sentinel or Redis Cluster, which nodes go first, and how does the primary role move between them?
answer
- replicas, one at a time
- manual failover, not a crash
- which node receives the command
- selection ignores the version
- search waits for every master
basics
~20 sUpgrade replicas one at a time, then demote the primary with SENTINEL FAILOVER, or CLUSTER FAILOVER sent to one of its replicas. Upgrade the demoted node last, and repeat per shard in a cluster, checking health before each next node.
solid answer
~50 sUpgrade replicas first, one at a time, waiting for each to finish syncing before the next. On Redis 8.10 under Sentinel, then run `SENTINEL FAILOVER <master name>`. Sentinel picks by `replica-priority`, then replication offset, then run ID, never by version, so upgrade every replica first or a replica still on the old version can win. Under Redis Cluster, send `CLUSTER FAILOVER` to a replica of the master being upgraded, wait for that master to become a replica, upgrade it, and optionally fail back. That handshake moves clients only after the replica has processed the full replication stream. Sentinel's manual failover documents no such handshake, so check offsets first. Repeat shard by shard, and verify with `INFO server`, `CLUSTER INFO` and `redis-cli --cluster check`. Redis Search will not be fully operational until all master shards are upgraded.
code
bash · 7 lines# Sentinel: force the failover, then ask for the new address
redis-cli -p 26379 SENTINEL FAILOVER mymaster
redis-cli -p 26379 SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
# Redis Cluster: send this to a replica of the master being upgraded
redis-cli -h replica-1 -p 7001 CLUSTER FAILOVER
redis-cli --cluster check replica-1:7001go deeper
Recall the order: replicas first, one at a time, then a deliberate failover, then the old primary last.
Name the commands and where they go: SENTINEL FAILOVER to a Sentinel, CLUSTER FAILOVER to a replica. Explain why FORCE and TAKEOVER do not belong in a routine upgrade.
Explain why order matters, what selection ignores, what each window degrades, and how Sentinel's own CONFIG REWRITE changes files on disk during the roll.
Decide how long a fleet may stay mixed-version, and plan for search being degraded until every master shard is done, since that sets the maintenance story for teams on top.
## The shape is the same A **rolling upgrade** replaces one node at a time, so the service stays up throughout. The Redis administration page gives the short version for both Sentinel and Cluster: upgrade one replica after the other, then perform a manual failover to promote an upgraded replica. The cluster upgrade page adds the rule in its own words: upgrade each node one at a time, starting with the replicas. The administration page ends with "finally promote the last replica", but the cluster scaling page is more exact: the demoted master is then upgraded like any replica, and failing back to it is optional. A **manual failover** moves the primary role while the primary is healthy, which is the point: the role moves on your schedule, not because of a crash. ## Why replicas go first A replica on the new version can follow a primary on the old one, and the Redis 8.0 release notes list upgrades by replication from previous versions. The reverse has no such promise. A full sync delivers an RDB, and a loader refuses a format version above its own, so a primary upgraded first could leave old replicas unable to resync. Compatibility is not a law of nature either: the administration page records that Redis Cluster 4.0 could not talk to 3.2 on the cluster bus and needed a mass restart, so read the notes for each jump. ## How the two compare | | Sentinel | Redis Cluster | |---|---|---| | Scope | One primary and its replicas | Every shard in turn | | Move the role | `SENTINEL FAILOVER <master name>` | `CLUSTER FAILOVER` | | Sent to | Any Sentinel | A replica of the master being upgraded | | Coordination | Forced, without agreement from other Sentinels | Handshake: the replica reaches the primary's offset, then gets a new epoch from a majority of primaries | | Client move | Clients ask Sentinel for the new address | Old primary returns redirects | ## Under Sentinel 1. Upgrade one replica, restart it, and wait for `master_link_status:up`. 2. Repeat for the other replicas. 3. Run `SENTINEL FAILOVER mymaster` against one Sentinel. 4. Confirm `SENTINEL GET-MASTER-ADDR-BY-NAME` returns the new address and the old node reports `role:slave`. 5. Upgrade the old primary. Four details deserve attention: - **Selection ignores the version.** Replicas sort by `replica-priority` (lower is preferred, default 100), then offset, then run ID. A value of 0 means never selected. - **The failover is not a paused handoff.** The documentation describes forcing it as if the master were unreachable, so compare offsets first and accept that replication is asynchronous. - **Sentinel edits config files.** To reconfigure an instance, it sends a transaction holding `SLAVEOF`, the older name of `REPLICAOF`, and `CONFIG REWRITE`. So the `replicaof` line and any non-default values change on disk during your upgrade, and configuration management may disagree later. - **Sentinel processes are not covered.** The upgrade pages do not list them, so keep a majority running if you upgrade them too. ## Under Redis Cluster 1. Take a copy of data on every node, primaries and replicas. 2. Upgrade the replicas of one shard, one at a time. 3. Send `CLUSTER FAILOVER` to an upgraded replica and wait for the old master to become a replica. 4. Upgrade the old master, then optionally fail back the same way. 5. Run `redis-cli --cluster check` and move to the next shard. The default form of `CLUSTER FAILOVER` avoids data loss by waiting for the replica to reach the primary's replication offset. `FORCE` skips the handshake with the primary and `TAKEOVER` also skips the cluster's authorization, for cases such as an unreachable primary, so neither belongs in a routine upgrade. The plain `FAILOVER` command replies `FAILOVER not allowed in cluster mode`. ## What is degraded meanwhile - **Redundancy.** While a shard's only replica restarts, that shard has no failover target. Finish one node before starting the next. - **Replica reads.** Clients reading from replicas must reconnect to another when one goes down. - **Redis Search.** The cluster upgrade page warns it will not be fully operational until all master shards are upgraded. Queries in that window return errors or a message such as `Waiting for all nodes to connect`. Plan a search outage or a route around it.
- Mid-roll, the primary crashes and a replica still on the old version wins the election. What do you do?Keep rolling. The upgraded replicas now follow an older primary, which is the supported direction, so the set is still consistent with the usual asynchronous-replication loss. Upgrade the remaining old replicas first, confirm the links are up, and only then trigger the manual failover. Stop and investigate if a node fails to resync, since that may indicate a jump the notes warned about.
- How do you stop Sentinel promoting a specific Redis replica during the roll?Set `replica-priority 0` on it, which means it is never selected but is still reconfigured to follow the new primary. The setting is modifiable with `CONFIG SET`. Set it back afterwards and check the file, because the `CONFIG REWRITE` Sentinel sends while reconfiguring that replica can write the 0 to disk.
- Restart the primaries first so the new code takes writes straight away.
- Run CLUSTER FAILOVER on the master you want to demote.
- SENTINEL FAILOVER picks the replica running the newest Redis version.
- Upgrading all nodes of one shard at once is fine because other shards stay up.
- Redis Search keeps answering normally throughout a cluster upgrade.
Assumes an upgrade to Redis 8.10 Open Source; the Redis Search warning comes from the upgrade page for Redis 8, where the query engine is part of Redis.