Jedis pool - switch master event

73 views
Skip to first unread message

Harihar Narayanan

unread,
Nov 29, 2023, 8:54:58 AM11/29/23
to Redis DB
Hi there,
We had an issue when our redis master switched to a different node during our regular patching. As Jedis sentinel pool subscribes to the switch master event, the sentinel logs clearly shows the from and to instances (host plus port). However, the jedis client subscribing to that event is showing a wrong master event. I have couple of questions
  • We need to understand more why there was a discrepancy in the jedis client subscribing to the wrong master even though sentinel logs show clearly that it is switching to the right master
  • To better safeguard this, can we have a fix that can actually do an additional get-master-addr-by-name and a role command to ensure that it is the master and if not, wait until it fetches the right master before refreshing the connection pool
Thanks,
Hari

vishal macom

unread,
Mar 5, 2024, 12:28:47 PMMar 5
to redi...@googlegroups.com
Hi Hari,

I had a similar issue, when i was using hiredis.

The official clients provided by redis normally use a cluster architecture with less sentinels.

So, what I did to mitigate it is, I changed the client code(in your case - Jedis) and added the heartbeat mechanism for the sentinel for checking the event and updating my internal code accordingly.

Let me know, if you find any leads,

Thanks & Regards,
Vishal Macom


--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/redis-db/939dc5d1-8426-426b-82f2-20fbd96d73c8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages