Skip to content

replicas in redis-cluster are not applying round-robin #610

@mgravell

Description

@mgravell

(discovery via an off-list email chain)

See ServerSelectionStrategy.Select; in the non-cluster scenario (aka NoSlot), we use the local Any method which does an Interlocked.Increment of the base offset to apply a crude round-robin.

However, in the redis-cluster scenario, for replicas, we use FindSlave which iterates the replica nodes for a given ServerEndPoint (the master endpoint for that slot). We do not apply any round-robin, with the consequence that in a multi-replica scenario, all "prefer slave" / "demand slave" requests go to the first replica (unless it is unavailable).

For balancing, we should add some kind of base-offset integer to the parent ServerEndPoint, and used in the same way that the global anyStartOffset currently works. We could also possibly just use anyStartOffset? it'll still rotate, which is all we really need...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions