Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-25666

vbucket mapping algorithm is incorrect if num vbucket is not power of 2

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • bug-backlog
    • 5.0.0
    • ns_server
    • None
    • Untriaged
    • No

    Description

      Trivial bug. ns_server uses a bitmask rather than the modulo:

      https://github.com/couchbase/ns_server/blob/22dd0b865aada27dfc2529f70af15a235e10ee55/src/cb_util.erl#L38

      This means that ns_server uses the wrong vbucket for a key if the number of vbuckets is not a power of 2.

      Index = Hashed band (NumVBuckets - 1),
      

      should beĀ 

      Index = Hashed rem NumVBuckets,

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              dfinlay Dave Finlay
              will.gardner Will Gardner (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty