-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat(ring): specify custom health check func via HeartbeatFn option #2940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ring): specify custom health check func via HeartbeatFn option #2940
Conversation
Thank you, @strobil! I do think having a custom healthcheck in the ring can benefit the users. Would you mind resolving conflicts so we can merge master and proceed with review of this PR? |
@ndyakov |
@strobil i do see the test continue to fail, would you mind taking a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving this. @strobil keep in mind we are not actively supporting ring since there are other limitation that simply cannot be covered with clustering controlled from the client.
…2940) * specify custom health check func via ShardHealthCheckFn option * ShardHealthCheckFn renamed to HeartbeatFn --------- Co-authored-by: Mykhailo Alipa <strobil@Mykhailos-MacBook-Air.local> Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com> Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
The current implementation of the Redis ring does not support specifying custom shard health check rules.
We use a Redis shard to distribute the load across multiple Redis slave instances.
However, if any shard encounters replication issues, the Redis ring continues to utilize this shard because it responds to ping requests successfully.
Thus, the Redis ring does not remove the malfunctioning shard, even though it is inconsistent.
This pull request proposes adding a HeartbeatFn option to the RingOptions, which can be configured during ring construction. This addition enables the definition of custom health check logic, such as checks based on the current replication status of the shard.