Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9D4B363BC for ; Mon, 20 Jun 2011 21:09:11 +0000 (UTC) Received: (qmail 15450 invoked by uid 500); 20 Jun 2011 21:09:11 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 15428 invoked by uid 500); 20 Jun 2011 21:09:11 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 15420 invoked by uid 99); 20 Jun 2011 21:09:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jun 2011 21:09:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jun 2011 21:09:09 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 18AC842493D for ; Mon, 20 Jun 2011 21:08:48 +0000 (UTC) Date: Mon, 20 Jun 2011 21:08:48 +0000 (UTC) From: "Jon Hermes (JIRA)" To: commits@cassandra.apache.org Message-ID: <1620662784.22587.1308604128087.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (CASSANDRA-2800) OPP#describeOwnership reports incorrect ownership MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org 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