Срд. Янв. 09 11:12:12 2008, drew@drewtaylor.com писал:
Show quoted text> We were implementing support for memcached at $work today, and wanted
> to use
> Cache::Memcached::Fast but didn't like that it would not rehash the
> keys to another server if the
> requested one is down.
It's technically possible to implement rehashing the same way C::M does,
however this will likely screw cluster consistency. Suppose you have
several memcached servers and several C::M::F clients. When the client
detects that the server is down it would rehash the keys to another
server. The problem is that the client can't distinguish between
"server down" and (temporal) "network down" cases. While some clients
might fail to reach particular server, others may reach it alright, so
when some clients will start to rehash, others will not, and the clients
would no longer agree on what key goes where.
I don't see the way to implement consistent rehashing without the
consistent view on which servers are up and which are down, and to get
such a view you'd have to design memcached server differently (make all
servers aware of each other for instance, but implementing such
distributed system is not a simple task).
Instead of rehashing one may simply monitor the servers with some
script, and either restart them, or automatically rewrite address list
passed to C::M::F constructor.