Ignore:
Timestamp:
04/12/08 17:10:40 (4 years ago)
Author:
Tomash Brechko <tomash.brechko@…>
Branches:
master-v0.7, master-v0.6, memcached_hash, upstream_count_limit
Children:
a1f117
Parents:
36798d
git-author:
Tomash Brechko <tomash.brechko@…> (04/12/08 16:36:01)
git-committer:
Tomash Brechko <tomash.brechko@…> (04/12/08 17:10:40)
Message:

Fix key distribution bug in compatible mode.

Because of accumulated rounding error some keys were mapped
to the different server than with Cache::Memcached. Now
we round toward zero, and depend on the fact that the error
can't be too big to cover the whole interval.

This change corresponds to commit
98421be6b7767f81c8d5b24d394d35ecd478fe2 in the
Cache::Memcached::Fast tree.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • memcached_hash/ngx_http_upstream_memcached_hash_module.c

    r36798d r2ab823  
    317317                (memd->buckets[j].point 
    318318                 - ((uint64_t) memd->buckets[j].point * server[i].weight 
    319                     + total_weight / 2) / total_weight); 
     319                    / total_weight)); 
    320320            } 
    321321 
Note: See TracChangeset for help on using the changeset viewer.