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

node level circuit breakers #812

Open
justinreddit opened this issue Mar 22, 2025 · 1 comment
Open

node level circuit breakers #812

justinreddit opened this issue Mar 22, 2025 · 1 comment

Comments

@justinreddit
Copy link

Is it possible to configure circuit breakers at the request level for a node? In cases of node degradation, we'd like to continue serving traffic for other nodes in the cluster and partition off bad nodes till they recover.

@rueian
Copy link
Collaborator

rueian commented Mar 22, 2025

The closest we have is the combination of SendToReplicas and ReplicaSelector. This allows you to specify which replica to send data to for each slot whenever the cluster topology in rueidis needs to be updated, such as due to a network error.

client, err := rueidis.NewClient(rueidis.ClientOption{
	InitAddress:         []string{"address.example.com:6379"},
	SendToReplicas: func(cmd rueidis.Completed) bool {
		return cmd.IsReadOnly()
	},
	ReplicaSelector: func(slot uint16, replicas []rueidis.ReplicaInfo) int {
		for i, replica := range replicas {
			return i // return the index of a healthy replica
		}
		return -1 // or send to the primary.
	},
})

@justinreddit justinreddit changed the title request level circuit breakers node level circuit breakers Mar 25, 2025
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

No branches or pull requests

2 participants