Sorry for the SPAM;

I wrote something about this

http://www.milnou.net/~pfreixes/blog/memcached/consistent_hashing_memcached_all_you_should_know.html


Good weekend

--pau

On Fri, Jun 26, 2009 at 5:29 PM, Henrik Schröder <[email protected]> wrote:

> Well, the problem of inconsistencies with automatic recovery from failover
> isn't a problem with memcached itself, it's client-dependent, and it's a
> trade-off between high availability or absolute consistency. It always
> depends on your application what's best for you. In the best of all worlds,
> all clients should offer the user the choice on how to handle failover. Mine
> doesn't, so I guess I'll have to spend some vacation time on fixing that.
> :-)
>
>
> /Henrik
>
>
> On Fri, Jun 26, 2009 at 16:00, Xaxo <[email protected]> wrote:
>
>>
>> On Jun 23, 8:19 pm, Pau Freixes <[email protected]> wrote:
>> > This change can be problematic because now the new continium has a more
>> > points for server A and server B , and probably keys that after this
>> change
>> > was assigned in server A now can be assigned  in server B. And viceversa
>> !
>> >
>> > Without weight algoritm works fine.
>>
>> You are right, that the algorithm is somehow broken :) but you are
>> missing a point here that makes things even worse:
>>  1) Imagine you have cache servers A, B and C
>>  2) C goes down
>>  3) keys are remapped to A and B
>>  4) C comes up
>> and here comes the mess :)
>>  * since you have assigned some keys (k1, k2) from C to A and B, A and
>> B might now have the new versions of k1 and k2. Imagine the cache on C
>> is still there (it was probably a network or firewall issue), now C is
>> serving the old keys k1 and k2 ;)
>>  * I have not read the source you are referring to, but if it does
>> suff like you describe, namely remap keys from A to B and vice versa,
>> the mess is bigger. When C went down, you have remapped k3 from A to
>> B, so B might now have a newer version of k3. When C comes up, you
>> remap again k3 to A, so A will still serve the old version of k3.
>>
>> Messy messy, most of the clients are broken in this way: they remap
>> keys upon server down and don't care that you might serve old stuff
>> after server up + remap again.
>>
>> If you need consistency, don't use memcached at all or fix the problem
>> yourself ;) basically memcached stores key/value pairs on SINGLE
>> server, it doesn't care about the world outside and this is a big
>> problem, since it does not allow consistency over several instances.
>>
>> Momchil
>
>
>


-- 
--pau

Reply via email to