You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jon Hermes (JIRA)" <ji...@apache.org> on 2011/06/20 23:08:48 UTC

[jira] [Created] (CASSANDRA-2800) OPP#describeOwnership reports incorrect ownership

OPP#describeOwnership reports incorrect ownership
-------------------------------------------------

                 Key: CASSANDRA-2800
                 URL: https://issues.apache.org/jira/browse/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:
{code}
int splits = keycount * DatabaseDescriptor.getIndexInterval() / keysPerSplit;
if (keycount >= splits) { ... add count to result set }
{code}
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: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2800) OPP#describeOwnership reports incorrect ownership

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13060617#comment-13060617 ] 

Hudson commented on CASSANDRA-2800:
-----------------------------------

Integrated in Cassandra-0.7 #522 (See [https://builds.apache.org/job/Cassandra-0.7/522/])
    Fix describeOwnership for OPP
patch by jhermes; reviewed by slebresne for CASSANDRA-2800

slebresne : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1143437
Files : 
* /cassandra/branches/cassandra-0.7/CHANGES.txt
* /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/dht/OrderPreservingPartitioner.java


> OPP#describeOwnership reports incorrect ownership
> -------------------------------------------------
>
>                 Key: CASSANDRA-2800
>                 URL: https://issues.apache.org/jira/browse/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:
> {code}
> int splits = keycount * DatabaseDescriptor.getIndexInterval() / keysPerSplit;
> if (keycount >= splits) { ... add count to result set }
> {code}
> 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: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-2800) OPP#describeOwnership reports incorrect ownership

Posted by "Jon Hermes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2800?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jon Hermes updated CASSANDRA-2800:
----------------------------------

    Attachment: 2800.txt

> OPP#describeOwnership reports incorrect ownership
> -------------------------------------------------
>
>                 Key: CASSANDRA-2800
>                 URL: https://issues.apache.org/jira/browse/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:
> {code}
> int splits = keycount * DatabaseDescriptor.getIndexInterval() / keysPerSplit;
> if (keycount >= splits) { ... add count to result set }
> {code}
> 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: http://www.atlassian.com/software/jira