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 5E23AD444 for ; Mon, 15 Oct 2012 19:55:04 +0000 (UTC) Received: (qmail 16501 invoked by uid 500); 15 Oct 2012 19:55:03 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 16429 invoked by uid 500); 15 Oct 2012 19:55:03 -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 16347 invoked by uid 99); 15 Oct 2012 19:55:03 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Oct 2012 19:55:03 +0000 Date: Mon, 15 Oct 2012 19:55:03 +0000 (UTC) From: "Nikolay (JIRA)" To: commits@cassandra.apache.org Message-ID: <1879506832.46962.1350330903196.JavaMail.jiratomcat@arcas> In-Reply-To: <544107893.43061.1350229622853.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (CASSANDRA-4804) Wrong assumption for KeyRange about range.end_token in get_range_slices(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-4804?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nikolay updated CASSANDRA-4804: ------------------------------- Attachment: cassa.1.2.x.diff.txt cassa.1.1.6.diff.txt > Wrong assumption for KeyRange about range.end_token in get_range_slices(). > --------------------------------------------------------------------------- > > Key: CASSANDRA-4804 > URL: https://issues.apache.org/jira/browse/CASSANDRA-4804 > Project: Cassandra > Issue Type: Bug > Components: API > Affects Versions: 1.1.6, 1.2.0 beta 1 > Reporter: Nikolay > Priority: Minor > Fix For: 1.1.6, 1.2.0 beta 1 > > Attachments: cassa.1.1.6.diff.txt, cassa.1.2.x.diff.txt > > Original Estimate: 1h > Remaining Estimate: 1h > > In get_range_slices() there is parameter KeyRange range. > There you can pass start_key - end_key, start_token - end_token, or start_key - end_token. > This is described in the documentation. > in thrift/ThriftValidation.java there is validation function validateKeyRange() (line:489) that validates correctly the KeyRange, including the case start_key - end_token. > However in thrift/CassandraServer.java in function get_range_slices() on line: 686 wrong assumption is made: > if (range.start_key == null) > { > ... // populate tokens > } > else > { > bounds = new Bounds(RowPosition.forKey(range.start_key, p), RowPosition.forKey(range.end_key, p)); > } > This means if there is start key, no end token is checked. > The opposite - null is "inserted" as end_key. > Solution: > same file - thrift/CassandraServer.java on next function - get_paged_slice(), on line:741 same code is written correctly > if (range.start_key == null) > { > ... // populate tokens > } > else > { > RowPosition end = range.end_key == null ? p.getTokenFactory().fromString(range.end_token).maxKeyBound(p) > : RowPosition.forKey(range.end_key, p); > bounds = new Bounds(RowPosition.forKey(range.start_key, p), end); > } -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira