-
Notifications
You must be signed in to change notification settings - Fork 38
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
[3.x] RackAwareRoundRobinPolicy
seems incompatible with ReplicaOrdering.RANDOM
in TokenAwarePolicy
#369
Comments
On that front I also want to point out that both
|
I reread the comment and now I see that you are talking about LWT |
This seems like a separate issue though. I'm not convinced that it is wrong since IIRC LWT queries have its own rules. I think it's meant not to follow LBP 100%. |
True, but how do you force them target particular rack, datacenter ? |
What to do with racks then ? |
I'm not sure. We probably should care about where the primary replica is rather than target particular rack. I'd need to brush up on how LWT is supposed to work, especially with tablets and raft. |
See the following snippet from
TokenAwarePolicy.java
This is how we calculate the first hosts in query plan in case of
ReplicaOrdering.RANDOM
. We prioritise replicas (which have been random shuffled beforehand) and select first those that according to child policy are local replicas. The problem is withdistance
implementation ofRackAwareRoundRobinPolicy
On its own this policy prioritizes first local rack, then remote racks but in local DC then remote DCs. However,
HostDistance
right now only differentiates betweenLOCAL
,REMOTE
andIGNORED
. If this policy is used with random ordering token aware policy then if remote rack but local dc replica comes first in the list of replicas, then it will be consideredLOCAL
according to this code snippet, invalidating the property of local rack going first. It's effectively DCAware and not RackAware in that configuration.The text was updated successfully, but these errors were encountered: