When initializing more than one DistributedClient with the same servers, the hashing for the keys is not consistent. Each client will potentially yield a different server for the same key.
The problem seems to be that when creating the HashRing, it uses the Protocol class:
self._ring = HashRing(self._servers)
Steps to reproduce:
from bmemcached import DistributedClient
client = DistributedClient('localhost:11211,localhost:11212,localhost:11213'.split(','))
client.set('the_key', '1234556') # Server with port 11213
client = DistributedClient('localhost:11211,localhost:11212,localhost:11213'.split(','))
client.set('the_key', '1234556') # Server with port 11211
When using HashRing directly with the server strings, it works as expected
from uhashring import HashRing
hr = HashRing('localhost:11211,localhost:11212,localhost:11213'.split(','))
hr.get_node('the_key') # localhost:11213
from uhashring import HashRing
hr = HashRing('localhost:11211,localhost:11212,localhost:11213'.split(','))
hr.get_node('the_key') # localhost:11213
When initializing more than one DistributedClient with the same servers, the hashing for the keys is not consistent. Each client will potentially yield a different server for the same key.
The problem seems to be that when creating the HashRing, it uses the Protocol class:
Steps to reproduce:
When using HashRing directly with the server strings, it works as expected