Skip to content
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

specify custom health check func via HeartbeatFn option #2940

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

strobil
Copy link

@strobil strobil commented Mar 13, 2024

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.

@strobil strobil marked this pull request as draft March 13, 2024 22:19
@strobil strobil marked this pull request as ready for review March 14, 2024 10:42
@strobil strobil changed the title specify custom health check func via ShardHealthCheckFn option specify custom health check func via HeartbeatFn option Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants