dahomey-technologies / rustis

An asynchronous Redis client for Rust

Home Page:https://docs.rs/rustis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error reconnect in the master-replica model of Redis-Server with Redis Sentinel

lazyky opened this issue · comments

Description
When the master node of redis-server crash, reconnecting will not obtain the address of the updated master node and generate an error:

Err(Client("Disconnected from server"))

To Reproduce
According to the document of redis.

  • Build the master-replica model of Redis-Server with Redis Sentinel
       +----+
       | M1 |
       | S1 |
       +----+
          |
+----+    |    +----+
| R2 |----+----| R3 |
| S2 |         | S3 |
+----+         +----+

Masters are called M1, M2, M3, ..., Mn.
Replicas are called R1, R2, R3, ..., Rn (R stands for replica).
Sentinels are called S1, S2, S3, ..., Sn.
  • Crash the master node of redis-server

Additional context

SentinelConnection
ClusterConnection