PECL memcache extension

Elizabeth Mattijsen liz at dijkmat.nl
Tue Feb 7 11:37:12 UTC 2006


At 3:58 AM -0500 2/7/06, Paul G wrote:
>----- Original Message ----- From: "Don MacAskill" <don at smugmug.com>
>To: "memcached mail list" <memcached at lists.danga.com>
>Cc: <mikl at php.net>
>Sent: Friday, February 03, 2006 5:37 PM
>Subject: PECL memcache extension
>
>-- snip --
>
>>If "set key1" is destined to ServerB's buckets, but ServerB fails, 
>>I don't want "key1" being redirected to ServerA instead.  Why? 
>>Because when ServerB comes online, I now have "key1" in two places, 
>>and one of them will now potentially get out of date.  Should 
>>ServerB fail again before "key1" has expired, calls to "get key1" 
>>will return old stale data from ServerA instead of fresh data or no 
>>result.
>>
>>Make sense?  Am I doing something wrong?  Can the PECL extension 
>>work in this fashion?
>
>maybe i'm missing something, but i don't think the case you're 
>trying to protect against is actually going to occur. once serverB 
>comes back online (and gets added to the rotation, which gets 
>rehashed), all further queries for key1 will again be run against 
>it, whether it's set or get. sure, you get a stale entry for it on 
>serverA, but if it never gets queried for it again, who cares?

Well, unless server B dies / is unreachable again, of course.  And 
this could certainly be the case with intermittent network problems. 
Remember Murphy: if something can go wrong, it will!

Of course, all of this depends on how much of a problem it is when 
you get stale data.  I guess in any situation where it _really_ 
matters, you shouldn't be using memcached in the first place, but 
something more persistent / less error prone such as db transactions.


Liz


More information about the memcached mailing list