soveran / ohm

Object-Hash Mapping for Redis

Home Page:http://ohm.keyvalue.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot save record on automatically failover

phuongnd08 opened this issue · comments

We are using redis-sentinel to do automatically failover. When new master promoted, the redic client is instructed to reconnect to the new master. Ohm trying to use EVALSHA but the sha is not to be found on the new master thus cause record unable to be stored.

The cache uses the Redis URL as the key (check here), does the redis-sentinel client update that value?

In other words:

Ohm.redis = Redis::Sentine.new(...)
url1 = Ohm.redis.url

# After a failover, the URL should be different
url2 = Ohm.redis.url

assert url1 != url2

If this is easy to check for you, let me know and we follow up from there. I haven't tried it myself, but I can do it if you are busy with something else.

I see, right now it only changes the uri of Ohm.redis.client. Need some patch to propagate that change to Ohm.redis.

@phuongnd08 I'm closing this issue for now, but please let me know if I can help you or if we need to reopen it.