-
Notifications
You must be signed in to change notification settings - Fork 541
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
LatestRoute always picks the same node in cluster #127
Comments
I did find #35 (comment) as well. I implemented that and I think it mostly solves my issues. However, I still have some questions:
Thanks! |
Hi @nathanwelch! First of all, thanks for the detailed explanation of your problem.
Correct. To achieve your goal I would go with
Full example with logs and small test: http://pastebin.com/GBFhmmvb What does it do? For
hostid is calculated based on local IP address. If all mcrouter instances are running on the same host, they will use the same hostid. The logic of calculating hostid is here: https://github.com/facebook/mcrouter/blob/master/mcrouter/lib/fbi/cpp/globals.cpp#L61
Mcrouter will not remove TKO'd nodes by default. You should explicitly add |
Hi @nathanwelch, did @pavlo-fb's response resolve your issue? |
@jmswen Yes it did answer my question but I haven't had a chance to test it out yet. Sorry I forgot to close the issue afterwards. Thanks for help! For the record for future readers, the solution in #35 (comment) gave me some weird results in testing. I can elaborate if someone needs it but basically after sustained use I saw a dramatic increase in latency from any cache reads/writes. I never fully tracked down why though. |
Goal
I want to handle situations where a node in a pool fails and is TKO'd. I'd like to do this for both writes/reads so that operations can continue to other working nodes. I'd like TKO'd nodes to be skipped until they are usable again but I would like load to be mostly even across the other nodes while this happens. Based on trial and error, reading the docs, and reading through other issues, it seems like this is the best way to achieve this for reads/writes:
AllFastestRoute
makes sets to failed nodes in Pool A not return an error but still allows for replication so that future get commands will hit.LatestRoute
should try a node and then failover to another one on error. I triedFailoverRoute
but seems to always go in order on the pool so it will always choose the first available node which sends all traffic there rather than doing any sort of hashing to find a server.Issue
I'm running a mcrouter client in a docker container on every API host that talks to memcached. Even on different API hosts,
LatestRoute
seems to be choosing the same memcached node in my pool. Would the host ID that mcrouter uses to generate the list of nodes in the pool forLatestRoute
come from the mcrouter docker container? If so, I guess it's possible that's always the same even on different API hosts?Questions
LatestRoute
to make sure it talks to more than one node?FailoverRoute
config.The text was updated successfully, but these errors were encountered: