diff --git a/src/cluster.c b/src/cluster.c index 6bc16555..60e99df0 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -299,10 +299,10 @@ void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) { * Key space handling * -------------------------------------------------------------------------- */ -/* We have 4096 hash slots. The hash slot of a given key is obtained - * as the least significant 12 bits of the crc16 of the key. */ +/* We have 16384 hash slots. The hash slot of a given key is obtained + * as the least significant 14 bits of the crc16 of the key. */ unsigned int keyHashSlot(char *key, int keylen) { - return crc16(key,keylen) & 0x0FFF; + return crc16(key,keylen) & 0x3FFF; } /* ----------------------------------------------------------------------------- diff --git a/src/redis.h b/src/redis.h index 093c7024..a97648e0 100644 --- a/src/redis.h +++ b/src/redis.h @@ -514,7 +514,7 @@ typedef struct redisOpArray { * Redis cluster data structures *----------------------------------------------------------------------------*/ -#define REDIS_CLUSTER_SLOTS 4096 +#define REDIS_CLUSTER_SLOTS 16384 #define REDIS_CLUSTER_OK 0 /* Everything looks ok */ #define REDIS_CLUSTER_FAIL 1 /* The cluster can't work */ #define REDIS_CLUSTER_NEEDHELP 2 /* The cluster works, but needs some help */