redis / ioredis

🚀 A robust, performance-focused, and full-featured Redis client for Node.js.
MIT License
14.26k stars 1.19k forks source link

ioredis not accepting request when sentinel do the failover but doesn't make the last master as new slave #1059

Open ben-yacine opened 4 years ago

ben-yacine commented 4 years ago

Hello,

I have the following config of my redis stack. One master redis and one slave connected to this master. I also create a sentinel instance to monitor the redis master. I can connect to sentinel with ioredis and everything works fine.

My problem is when i execute the command DEBUG SLEEP 80 to cause the failover, sentinel detect that the master is down and promote the slave as master. But after that, sentinel will try to make the previous master as slave but it doesn't succeed because the master still down and we have +SDOWN log in sentinel part. During this period, ioredis will not redirect the request coming to the new master until sentinel make the master as slave. so ioredis will connect again to the new master and the requests will be treated.

What i want is if we can make the requests redirected to the new master even if the last one is not yet promoted as slave. this is the high availability that we want to have from using sentinel.

Any idea ?

Thanks in advance.

ben-yacine commented 4 years ago

If some one can help please. I'm still stuck in this step. Thanks in advance.

ajinkyarajput commented 4 years ago

Nicely described. I am also facing same. On Power off of myster server(node), failover not happening. We can see new nominated master in sentinels.

ajinkyarajput commented 4 years ago

net package doesn't trigger any event of error on that situation, that's the reason failover doesnot work. That means, current implementation of failover only works if we gracefully shutdown of redis server.

anurag4DSB commented 4 years ago

Has anyone found a manual way to failover manually? I have noticed the same issue.

vyshkov commented 3 years ago

I found the same problem. If I kill a pod with Redis master node, ioredis doesn't notice a new master elected by other sentinels.

alimoezzi commented 2 days ago

I have the same problem. With current implementation sentinel is useless.