Description
Modulo should be used to convert a crc32 hash into a lower range of mappings (e.g. from the full 32bit range to 1024). The way the couchbase-cli pump currently does it is by subtracting 1 from the number of vbuckets (e.g. to 1023 == 0x3FF or the lower 10bits as 1) and using that as a bitmask.
While this works for powers of 2 like 64 and 1024 it does not work for others like 61. The couchbase-cli pump should just use Python's modulo operator instead of a bitmask.
Attachments
Issue Links
- relates to
-
MB-25666 vbucket mapping algorithm is incorrect if num vbucket is not power of 2
- Open
For Gerrit Dashboard: MB-19520 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
63719,4 | MB-19520 Fix rehash to work on non-powers of two vbuckets | master | couchbase-cli | Status: MERGED | +2 | +1 |