1

I am using ServiceStack 5.0.2 with Redis Sentinel (3 + 3) and having issues in case of a failover: commands being issued during or after a failover fail with timeout.

I have come up with an idea to implement retry pattern via custom IRedisClient. But probably there is a better strategy to employ in this case.

Answer given in the post How does ServiceStack PooledRedisClientManager failover work? does not seem to be the right way to go.

Thank you,

ptarasov
  • 63
  • 4

1 Answers1

1

Redis Clients wrap a TCP connection with a Redis Server, a Redis Client that was connected with the instance that failed over will fail, but any new Redis Clients retrieved from the pool after failover will be connected to the new failed over instance.

mythz
  • 141,670
  • 29
  • 246
  • 390
  • mythz, thank you for confirming my understanding of the way Redis Client works. The question now is whether I should employ some kind of retry strategy, or ServiceStack is going to implement higher level API with no need for clients to reissue commands. – ptarasov Mar 14 '18 at 19:08
  • @ptarasov ServiceStack.Redis implements [automatic retries](https://github.com/ServiceStack/ServiceStack.Redis#automatic-retries) for the same redis instance, but if the RedisClient was connected to a failed instance, the retries will fail and eventually throw a TimeoutException. But this should only be an issue during the failover for clients that were already resolved from the pool and configured to use the old instance. – mythz Mar 14 '18 at 19:31