Serious bug in memcached - patch attached

Brad Fitzpatrick brad at danga.com
Mon Apr 4 17:10:41 PDT 2005


Don,

Thanks --- committed to cvs!

- Brad


On Mon, 4 Apr 2005, Don MacAskill wrote:

>
> ... or, at least, it seems that way.  :)  'flush_all' doesn't seem to
> work properly.  Basically, if you try to add a key which is present, but
> expired, the store fails but the old key is no longer expired.  Here's
> output:
>
> get key1
> END
>
> add key1 1 0 2
> 27
> STORED
>
> get key1
> VALUE key1 1 2
> 27
> END
>
> flush_all
> OK
>
> add key1 1 0 2
> 28
> NOT_STORED
>
> get key1
> VALUE key1 1 2
> 27
> END
>
> I suppose it's possible there's some design reason why it behaves that
> way, but if so, I don't know what it is.  Certainly breaks our stuff.  :)
>
> (we built a memcached tracker which controls the state of our pool of
> memcached processes.  It flushes any hosts/ports which fail at any
> writes, among other things, and this bug caused some big problems, as
> you can imagine).
>
> Patch against CVS attached.  It's probably mildly overkill (probably
> doesn't need to destroy the item on a stale 'get', only on 'add', but
> it's pretty simple and gives me the warm fuzzies).
>
> Don
>
>


More information about the memcached mailing list