Failover
When the upstream Redis instance fails, you need to perform a disaster recovery failover for the replication group first, and then switch the client's access address to the promoted instance.
This procedure applies to Disaster Recovery mode (spec.activeRedis.mode: peerof) on both Redis 6.0 and Redis 7.2, where replication is directed and one instance is the upstream.
Active-Active mode has no failover step of this kind: every member is already active and accepts writes, so recovering from the loss of a datacenter is a matter of redirecting clients to a surviving member. Removing the lost member from the mesh is described in Removing a member.
TOC
Replication Group SwitchFailover Timing DescriptionDisaster Recovery SwitchUse the failed upstream as a downstream of the new upstreamClient-side Disaster Recovery SwitchReplication Group Switch
In a disaster recovery group, when the upstream fails, the synchronization link with the failed upstream needs to be interrupted, and the downstream side is promoted to the upstream; to ensure that the client can write data and that the dirty data of the failed upstream will not pollute the downstream instance.
Failover Timing Description
When a failure occurs at the upstream of the replication group, Alauda Cache Service E1 on the downstream side will detect that the link with the upstream is interrupted. At this time, the status of the ActiveRedisConnection resource will be abnormal, and the Web Console of the downstream instance will prompt that a disaster recovery switch can be performed.
Disaster Recovery Switch
View Connection Status
When STATUS is Failed, it indicates that the connection between instance c6-dest and the upstream is abnormal. You can view the yaml details to understand the specific situation:
Disconnect from the upstream
After manually confirming that the upstream is indeed abnormal, you need to disconnect the downstream instance from the upstream link to prevent the introduction of dirty data.
After deleting the corresponding ActiveRedisConnection resource, the Redis instance has become an independent upstream instance, and the client's access address can be safely switched to this instance for reading and writing.
Deleting the connection tears the link down according to its spec.teardownPolicy. Use the default Detach so the failed datacenter can rejoin later. Reserve Decommission for a datacenter that is gone for good — it is irreversible and forces a full resynchronization if the peer ever returns. See Removing a connection.
Use the failed upstream as a downstream of the new upstream
After the failed upstream returns to normal, it can be re-added to the replication group as a downstream instance of the promoted upstream. For the operation method, refer to Set Up Disaster Recovery Replication.
Client-side Disaster Recovery Switch
Before connecting to the replication group, the client should support switching the Redis access address to the promoted instance after detecting the upstream failure. Usually, there are the following switching methods:
Whether the client triggers a disaster recovery failover cannot be judged solely by a binary decision; failover is a multi-dimensional, high-confidence decision-making process. It needs to be handled in combination with multiple dimensions of fault detection, including but not limited to: the available status of the instance, whether the instance still has high availability, whether the k8s cluster has the possibility of continuing to serve, data center availability detection.
Usually, the following expression needs to be met before the client can safely perform a disaster recovery switch:
Alauda Cache Service E1 currently does not provide support for client-side disaster recovery switching. Customers need to implement a suitable client switching method according to their own infrastructure.