Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-2800

OPP#describeOwnership reports incorrect ownership

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 0.7.7, 0.8.2
    • None
    • None
    • Low

    Description

      OPP#describeOwnership relies on StorageService#getSplits and counts the received tokens as its basis of ownership.

      When the number of result keys is less than the number of splits, the full count is omitted (to save work?). However, we don't care if a split would end up fractional in this case, we just need the full count.

      The logic here is:

      int splits = keycount * DatabaseDescriptor.getIndexInterval() / keysPerSplit;
      if (keycount >= splits) { ... add count to result set }
      

      We were passing in 1 key per split (since we just care about the count), but splits=keycount*IndexInterval is guaranteed to be > keycount, so the result set is not completely formed.
      The better "unit keysPerSplit" to use is IndexInterval itself, which gives splits=keycount*II/II=keycount, so the logic runs correctly.

      Attachments

        1. 2800.txt
          0.8 kB
          Jon Hermes

        Activity

          People

            jhermes Jon Hermes
            jhermes Jon Hermes
            Jon Hermes
            Sylvain Lebresne
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: