Skip to content

Commit

Permalink
Cluster: from 4096 to 16384 hash slots.
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Feb 14, 2013
1 parent 072c91f commit ebd666d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/* -----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/redis.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit ebd666d

Please sign in to comment.