Pragmatic
Pragmatic

Reputation: 3127

Does redis delete all the keys when one master and its slave fails in redis cluster

I have a question. Suppose I am using a Redis cluster with 3 shards (with master and slave). I came to know that if a master and its slave fails at the same time Redis Cluster is not able to continue to operate. What happen after that.

  1. Would Redis cluster delete all the other keys from other 2 nodes as well? (When it comes back)
  2. Do we need to manually restart this cluster and can we somehow retain the other keys values (on other nodes)?
  3. How will it behave if I use Azure Redis Cache?

Thanks In Advance

Upvotes: 0

Views: 2508

Answers (1)

Basit Anwer
Basit Anwer

Reputation: 6890

1. Would Redis cluster delete all the other keys from other 2 nodes as well? (When it comes back)

First of all only the operations are blocked not the cluster activity and nothing is done with the data so says the documentation

Redis Cluster failure detection is used to recognize when a master or slave node is no longer reachable by the majority of nodes and then respond by promoting a slave to the role of master. When slave promotion is not possible the cluster is put in an error state to stop receiving queries from clients.

Next regarding if the data gets deleted or not (Under Replication document)

In setups where Redis replication is used, it is strongly advised to have persistence turned on in the master

Which means that only if the persistence was turned off and the master server pair went down then you will loose the data. When the pair comes back up, you will not be able to recover the data. So keep Redis persistence turned on.

2. Do we need to manually restart this cluster and can we somehow retain the other keys values (on other nodes)?

I think the above answer covers it up.

3. How will it behave if I use Azure Redis Cache?

From Azure Redis Cache FAQ

High Availability/SLA: Azure Redis Cache guarantees that a Standard/Premium cache will be available at least 99.9% of the time. To learn more about our SLA, see Azure Redis Cache Pricing. The SLA only covers connectivity to the Cache endpoints. The SLA does not cover protection from data loss. We recommend using the Redis data persistence feature in the Premium tier to increase resiliency against data loss.

So it's kinda their headache

OR

Redis Cluster: If you want to create caches larger than 53 GB or want to shard data across multiple Redis nodes, you can use Redis clustering which is available in the Premium tier. Each node consists of a primary/replica cache pair for high availability. For more information, see How to configure clustering for a Premium Azure Redis Cache.

Upvotes: 1

Related Questions