On Fri, Mar 15, 2013 at 3:51 AM, Josiah Carlson
<
josiah....@gmail.com> wrote:
> For a lot of users who are sharding already, their client already has
> a method of hooking in a "shard hint" to determine what shard to
Exactly, this is already a common practice after all. The difference
with Redis Cluster is mainly that:
1) As you mentioned, slots can be moved, so the ability to update
config is needed.
2) That you have the CLUSTER NODES command to simply update the state
after a cold start. Actually in my client I always use CLUSTER NODES
once I detect that a single route changed: it is much more efficient
in case multiple slots moved after a resharding.
3) You have to handle the ASKING thing (if you are redirected with
"-ASK" instead of "-MOVED" you have to issue an ASKING command to tell
the server you are here because of a redirection).
Well nothing exceptional or too complex after all, however as usually
the evil is in the details.
For instance in redis-rb-cluster you can also configure the max number
of sockets you want to use.
Another subtleness is that it is important to always take a list of
random IPs of nodes so that you have somebody to connect to if the
node you are connecting is failing.
> I haven't read the docs lately, so I don't know how long it is
> expected to take for a cluster node being down to have its shards
> migrated to one of the slave replicas. But that will limit how quickly
> clients can recover from a cluster node failure.
This is configurable and is called the "node timeout", all the other
timings in the cluster are multiple of this value.
For instance, max time a slave does no longer receive updates from
master to still be elegible, is node_timeout * 10.
Time needed for a node to be marked as ok again if it returns to be
reachable via cluster bus, and nobody failed over it for some reason,
is node_timeout * 10, and so forth.
It is possible that even the multiplication factors may turn into
configurable parameters later, but I would do it only if absolutely
needed as it is more stuff to understand from the POV of users.