Skip to content

Fall back to any reachable host of a shard for replica reads - #41

Closed
g7r wants to merge 1 commit into
masterfrom
feature/replica-fallback-any-host
Closed

g7r wants to merge 1 commit into
masterfrom
feature/replica-fallback-any-host

Conversation

@g7r

@g7r g7r commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

A shard's health mask is a hard filter in connForPolicySlaves, and its bits
contradict each other while a master is down: the master's bit is never
cleared, while its replica reports master_link_status:down for the whole
failover window even though it keeps serving reads. Every MasterAndSlaves /
PreferSlaves read to that shard fails with no_alive_connection until redis
finishes the failover and CLUSTER SLOTS reports a new master.

Health becomes a preference: hosts in the mask are tried first, the rest of the
shard after them. Zero-weight hosts are tried last rather than never, since the
weighted wheel cannot draw from a total of zero.

A shard's health mask is a hard filter in connForPolicySlaves, and its
bits contradict each other while a master is down: the master's bit is
never cleared, while its replica reports master_link_status:down for
the whole failover window even though it keeps serving reads. Every
MasterAndSlaves / PreferSlaves read to that shard fails with
no_alive_connection until redis finishes the failover and CLUSTER SLOTS
reports a new master.

Health becomes a preference: hosts in the mask are tried first, the
rest of the shard after them. Zero-weight hosts are tried last rather
than never, since the weighted wheel cannot draw from a total of zero.
@g7r
g7r marked this pull request as draft September 15, 2026 06:08
@g7r g7r closed this Sep 15, 2026
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.

1 participant