Cluster: from 4096 to 16384 hash slots.

This commit is contained in:
antirez 2013-02-14 12:49:16 +01:00
parent 072c91fe13
commit ebd666db47
2 changed files with 4 additions and 4 deletions

View File

@ -299,10 +299,10 @@ void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
* Key space handling * Key space handling
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
/* We have 4096 hash slots. The hash slot of a given key is obtained /* We have 16384 hash slots. The hash slot of a given key is obtained
* as the least significant 12 bits of the crc16 of the key. */ * as the least significant 14 bits of the crc16 of the key. */
unsigned int keyHashSlot(char *key, int keylen) { unsigned int keyHashSlot(char *key, int keylen) {
return crc16(key,keylen) & 0x0FFF; return crc16(key,keylen) & 0x3FFF;
} }
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------

View File

@ -514,7 +514,7 @@ typedef struct redisOpArray {
* Redis cluster data structures * 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_OK 0 /* Everything looks ok */
#define REDIS_CLUSTER_FAIL 1 /* The cluster can't work */ #define REDIS_CLUSTER_FAIL 1 /* The cluster can't work */
#define REDIS_CLUSTER_NEEDHELP 2 /* The cluster works, but needs some help */ #define REDIS_CLUSTER_NEEDHELP 2 /* The cluster works, but needs some help */