It depends if your client library code has reconnected with the lost (old)
machine or not. If the client has not reconnected yet, it will get the key
from the last machine. If the client has reestablished the connection,
it will get it from the old machine - you might have stale data in that case.
The bottom line is that the client decides which server to go for the key.
Tony Wong
> Date: Tue, 14 Sep 2010 16:03:46 -0700
> Subject: Which key is chosen when key duplicates exist in a cluster?
> From: [email protected]
> To: [email protected]
>
> Suppose one of the memcached machines in a cluster looses connection,
> when asking for a key it is non existent on any other machine in the
> cluster so
> the client decides to create a new one, now the disconnected machine
> is back.
> Thus we have two machines with the same key, which key->value pair
> would we get
> when requesting this duplicated key?
>
> - the one created the last?
> - which ever server answers first?
>
> thanks
> Granit