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 C80CB18222 for ; Mon, 19 Oct 2015 12:13:36 +0000 (UTC) Received: (qmail 96869 invoked by uid 500); 19 Oct 2015 12:13:31 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 96835 invoked by uid 500); 19 Oct 2015 12:13:31 -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 96811 invoked by uid 99); 19 Oct 2015 12:13:31 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Oct 2015 12:13:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6D088E02FF; Mon, 19 Oct 2015 12:13:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: blerer@apache.org To: commits@cassandra.apache.org Date: Mon, 19 Oct 2015 12:13:31 -0000 Message-Id: <121bccaf290f44feb2ff5d66bf9057fa@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] cassandra git commit: Fix RangeNamesQueryPager (CASSANDRA-10509) Repository: cassandra Updated Branches: refs/heads/cassandra-3.0 10c65d434 -> 6977521ad Fix RangeNamesQueryPager (CASSANDRA-10509) patch by Stefania Alborghetti; reviewed by Benjamin Lerer for CASSANDRA-10509 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/289b7b7c Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/289b7b7c Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/289b7b7c Branch: refs/heads/cassandra-3.0 Commit: 289b7b7cefd7ee5e1c41f7527a41fa40141ee7f7 Parents: 20ce2cf Author: Stefania Alborghetti Authored: Mon Oct 19 14:04:36 2015 +0200 Committer: blerer Committed: Mon Oct 19 14:07:44 2015 +0200 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../apache/cassandra/service/pager/RangeNamesQueryPager.java | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/289b7b7c/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 889438f..0904559 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.2.4 + * Fix RangeNamesQueryPager (CASSANDRA-10509) * Deprecate Pig support (CASSANDRA-10542) * Reduce contention getting instances of CompositeType (CASSANDRA-10433) Merged from 2.1: http://git-wip-us.apache.org/repos/asf/cassandra/blob/289b7b7c/src/java/org/apache/cassandra/service/pager/RangeNamesQueryPager.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/service/pager/RangeNamesQueryPager.java b/src/java/org/apache/cassandra/service/pager/RangeNamesQueryPager.java index 50d1280..6b36a25 100644 --- a/src/java/org/apache/cassandra/service/pager/RangeNamesQueryPager.java +++ b/src/java/org/apache/cassandra/service/pager/RangeNamesQueryPager.java @@ -81,7 +81,9 @@ public class RangeNamesQueryPager extends AbstractQueryPager protected boolean containsPreviousLast(Row first) { // When querying the next page, we create a bound that exclude the lastReturnedKey - return false; + // but unfortunately ExcludingBounds is serialized as Bounds, which includes both endpoints, + // so we may still get a live row with the same key as lastReturnedKey, see CASSANDRA-10509 + return lastReturnedKey != null && lastReturnedKey.equals(first.key); } protected boolean recordLast(Row last) @@ -103,11 +105,11 @@ public class RangeNamesQueryPager extends AbstractQueryPager AbstractBounds bounds = command.keyRange; if (bounds instanceof Range || bounds instanceof Bounds) { - return new Range(lastReturnedKey, bounds.right); + return new Range<>(lastReturnedKey, bounds.right); } else { - return new ExcludingBounds(lastReturnedKey, bounds.right); + return new ExcludingBounds<>(lastReturnedKey, bounds.right); } } }