Implement DC-aware load-balancing policy
Closed this issue · 0 comments
whatyouhide commented
We need to implement a new Xandra.Cluster.LoadBalancingPolicy.DCAwareRoundRobin
policy. This policy will return all nodes in the "local" datacenter, which is the datacenter of the first node the control connection connected to. It will return the nodes in a round-robin fashion, cycling through them.
If there are not enough "local" nodes, this policy should start returning nodes in other DCs too.
To implement this, we might need to slightly change the Xandra.Cluster.LoadBalancingPolicy
behaviour. We might have to add something like an options
argument to the hosts_plan/1
or init/1
callbacks, so that we can pass in the datacenter that we consider to be local.