Open GoogleCodeExporter opened 9 years ago
[deleted comment]
[deleted comment]
I think that ketemaNodeLocator was designed to return the list including the
dead ones - they're checked further down the line.
The problem is that the iterator that it returns is of size allNodes.size().
If you have 2 nodes in your ring, and you return 2 random ones. There's a 1 in
4 chance that you will return 2 dead ones. That will explain why 5 of your 20
requests failed.
In the original implementation, the number of nodes iterated through was the
number of buckets.
So if we changed:
public Iterator<MemcachedNode> getSequence(String k) {
return new KetamaIterator(k, allNodes.size());
}
to
public Iterator<MemcachedNode> getSequence(String k) {
return new KetamaIterator(k, ketamaNodes.size());
}
then it would match the original implementation.
Original comment by david.sh...@gmail.com
on 22 Oct 2010 at 1:17
I believe this has been fixed some time ago. There was a bug in ketama node
locator where it would use the length of servers, and that was incorrect.
I'll mark this as accepted and we'll look into it further, but I bet it's
already fixed.
Original comment by ingen...@gmail.com
on 19 Aug 2012 at 8:30
So, I'm curious. Was this fixed or not? We made our own change some time ago,
and we want to upgrade but don't want to reintroduce the issue again.
Original comment by penguin...@gmail.com
on 6 Sep 2012 at 7:00
I've not rerun the specific test, which is why I'd not closed it. Can you
identify the change you've made? I can eyeball it and let you know.
This is the commit that I believe fixes it:
https://github.com/dustin/java-memcached-client/commit/00daa10f012a7fd1656f41a56
78629fa5978b1f5
Original comment by ingen...@gmail.com
on 6 Sep 2012 at 7:19
Original issue reported on code.google.com by
anyh...@gmail.com
on 23 Jun 2010 at 6:38Attachments: