invalidation by namespace Re: Listing all keys on a server: why?

Don MacAskill don at smugmug.com
Sat Jul 29 20:18:01 UTC 2006


Martin Atkins wrote:
> The "best practice" for memcached is not to do remapping on node 
> failure, despite that being the plan to start with, because node deaths 
> are often brief and so all you really achieve is screwing up the hash so 
> that all of the keys need to get recreated, and so you end up storing 
> loads of things twice.
> 
> Assuming the node is only down for a few minutes (which is most 
> frequently the case, unless you have really unreliable servers) you just 
> end up with a bit of slowness for a while as the app has to hit the real 
> backing store, and then some pain while the cache rebuilds when the node 
> comes back up. The rest of the cluster is unaffected.

Let's not forget that not doing remapping also avoids the stale cache 
data problem entirely, as a result of storing loads of things twice.

If Server A crashes for a few minutes, and Servers B-Z get remapped 
data, and then Server A recovers and Servers B-Z aren't flushed, then 
there exists the likelihood that you'll read bad data from Servers B-Z 
again if Server A should fail.

Don




More information about the memcached mailing list