Details
-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
-
2.11.6
-
Security Level: Public
-
None
-
All
Description
In our setup we are accessing a memcached cluster from both ruby, using libmemcached and java using spymemcached.
Using ketama to cluster memcache is both supported in libmemcached and spymemcached. Due to configuration the both implementations are not interoperable.
a) the node key format differs, as spymemcached uses a format of hostname/ip:port while libmemcached uses hostname:[port]
b) spymemcached does not support weighted ketama
c) spymemcached does not allow alternative hashes to be used with ketama, ketama itself only states that the hash to place the nodes on the ring needs to be md5 the hash used to select can by any supported one.
The changes made in http://review.couchbase.org/47624 allow libmemcached and spymemcached to access the same cluster, using ketama weighted node distribution.
a) exteracted a KetamaNodeKeyFormatter to allow for a selection of either libmemcached or spymemcached format (and maybe others in the futur) carrying over the optimizations previously made in the Configuraiton.
b and c) Add support for weighted ketama, while maintaining backwards compatability for non weighted setups. This is due to the behaviour of using a different hashing setup unless KETAMA_HASH is used, even though the HASH is allowed to differ for ring setup and selection afaik (and in does in our setup).