Skip to content

Commit

Permalink
bugfix: incorrect num of nodes in the continuum
Browse files Browse the repository at this point in the history
  • Loading branch information
doujiang24 committed Dec 24, 2015
1 parent 51c8dac commit cf4d4e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ngx_http_upstream_consistent_hash_module.c
Expand Up @@ -152,7 +152,7 @@ ngx_http_upstream_init_consistent_hash(ngx_conf_t *cf,

for (i = 0; i < us->servers->nelts; i++) {
for (j = 0; j < server[i].naddrs; j++) {
for (k = 0; k < ((MMC_CONSISTENT_POINTS * server[i].weight) / server[i].naddrs); k++) {
for (k = 0; k < (MMC_CONSISTENT_POINTS * server[i].weight); k++) {
ngx_snprintf(hash_data, HASH_DATA_LENGTH, "%V-%ui%Z", &server[i].addrs[j].name, k);
continuum->nodes[continuum->nnodes].sockaddr = server[i].addrs[j].sockaddr;
continuum->nodes[continuum->nnodes].socklen = server[i].addrs[j].socklen;
Expand Down

0 comments on commit cf4d4e7

Please sign in to comment.