cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Hermes (JIRA)" <>
Subject [jira] [Created] (CASSANDRA-2800) OPP#describeOwnership reports incorrect ownership
Date Mon, 20 Jun 2011 21:08:48 GMT
OPP#describeOwnership reports incorrect ownership

                 Key: CASSANDRA-2800
             Project: Cassandra
          Issue Type: Bug
    Affects Versions: 0.7.4
            Reporter: Jon Hermes
            Assignee: Jon Hermes
            Priority: Minor
             Fix For: 0.7.7, 0.8.2
         Attachments: 2800.txt

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.

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message