You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by bl...@apache.org on 2015/10/20 14:37:51 UTC

[1/2] cassandra git commit: Fix paging issues with partitions containing only static columns data

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.2 a33790730 -> 98be5de70


Fix paging issues with partitions containing only static columns data

patch by Benjamin Lerer; reviewed by Sylvain Lebresne for CASSANDRA-10381


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/328916d1
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/328916d1
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/328916d1

Branch: refs/heads/cassandra-2.2
Commit: 328916d1591be69f217f6519304651d3757d9e1d
Parents: 9b3b1cb
Author: blerer <be...@datastax.com>
Authored: Tue Oct 20 14:33:50 2015 +0200
Committer: blerer <be...@datastax.com>
Committed: Tue Oct 20 14:33:50 2015 +0200

----------------------------------------------------------------------
 CHANGES.txt                                                 | 2 ++
 .../apache/cassandra/service/pager/AbstractQueryPager.java  | 6 +++++-
 .../cassandra/service/pager/RangeSliceQueryPager.java       | 8 ++++++--
 .../org/apache/cassandra/service/pager/SliceQueryPager.java | 9 +++++++--
 4 files changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/328916d1/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index b17929c..dbb3480 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.1.12
+ * Fix paging issues with partitions containing only static columns data
+   (CASSANDRA-10381)
  * Fix conditions on static columns (CASSANDRA-10264)
  * AssertionError: attempted to delete non-existing file CommitLog (CASSANDRA-10377)
  * Merge range tombstones during compaction (CASSANDRA-7953)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/328916d1/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java b/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java
index a3991ed..6056b9a 100644
--- a/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java
+++ b/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java
@@ -345,7 +345,11 @@ abstract class AbstractQueryPager implements QueryPager
                     copy.addColumn(iter.next());
             }
         }
-        return Math.min(counter.live(), toDiscard);
+        int live = counter.live();
+        // We want to take into account the row even if it was containing only static columns
+        if (live == 0 && !staticCells.isEmpty())
+            live = 1;
+        return Math.min(live, toDiscard);
     }
 
     private int discardTail(ColumnFamily cf, int toDiscard, ColumnFamily copy, Iterator<Cell> iter, DeletionInfo.InOrderTester tester)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/328916d1/src/java/org/apache/cassandra/service/pager/RangeSliceQueryPager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/pager/RangeSliceQueryPager.java b/src/java/org/apache/cassandra/service/pager/RangeSliceQueryPager.java
index e02bb46..fd14c82 100644
--- a/src/java/org/apache/cassandra/service/pager/RangeSliceQueryPager.java
+++ b/src/java/org/apache/cassandra/service/pager/RangeSliceQueryPager.java
@@ -98,10 +98,14 @@ public class RangeSliceQueryPager extends AbstractQueryPager
 
         // Same as SliceQueryPager, we ignore a deleted column
         Cell firstCell = isReversed() ? lastCell(first.cf) : firstNonStaticCell(first.cf);
+        // If the row was containing only static columns it has already been returned and we can skip it.
+        if (firstCell == null)
+            return true;
+
         CFMetaData metadata = Schema.instance.getCFMetaData(command.keyspace, command.columnFamily);
         return !first.cf.deletionInfo().isDeleted(firstCell)
-            && firstCell.isLive(timestamp())
-            && firstCell.name().isSameCQL3RowAs(metadata.comparator, lastReturnedName);
+                && firstCell.isLive(timestamp())
+                && firstCell.name().isSameCQL3RowAs(metadata.comparator, lastReturnedName);
     }
 
     protected boolean recordLast(Row last)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/328916d1/src/java/org/apache/cassandra/service/pager/SliceQueryPager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/pager/SliceQueryPager.java b/src/java/org/apache/cassandra/service/pager/SliceQueryPager.java
index c8572d4..1a2fc6c 100644
--- a/src/java/org/apache/cassandra/service/pager/SliceQueryPager.java
+++ b/src/java/org/apache/cassandra/service/pager/SliceQueryPager.java
@@ -102,12 +102,17 @@ public class SliceQueryPager extends AbstractQueryPager implements SinglePartiti
             return false;
 
         Cell firstCell = isReversed() ? lastCell(first.cf) : firstNonStaticCell(first.cf);
+        // If the row was containing only static columns it has already been returned and we can skip it.
+        if (firstCell == null)
+            return true;
+
         CFMetaData metadata = Schema.instance.getCFMetaData(command.getKeyspace(), command.getColumnFamilyName());
         // Note: we only return true if the column is the lastReturned *and* it is live. If it is deleted, it is ignored by the
         // rest of the paging code (it hasn't been counted as live in particular) and we want to act as if it wasn't there.
+
         return !first.cf.deletionInfo().isDeleted(firstCell)
-            && firstCell.isLive(timestamp())
-            && firstCell.name().isSameCQL3RowAs(metadata.comparator, lastReturned);
+                && firstCell.isLive(timestamp())
+                && firstCell.name().isSameCQL3RowAs(metadata.comparator, lastReturned);
     }
 
     protected boolean recordLast(Row last)


[2/2] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2

Posted by bl...@apache.org.
Merge branch cassandra-2.1 into cassandra-2.2

Conflicts:
	CHANGES.txt


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/98be5de7
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/98be5de7
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/98be5de7

Branch: refs/heads/cassandra-2.2
Commit: 98be5de7035509fe7160917350e6c401df67d3b0
Parents: a337907 328916d
Author: blerer <be...@datastax.com>
Authored: Tue Oct 20 14:37:10 2015 +0200
Committer: blerer <be...@datastax.com>
Committed: Tue Oct 20 14:37:10 2015 +0200

----------------------------------------------------------------------
 CHANGES.txt                                                 | 1 +
 .../apache/cassandra/service/pager/AbstractQueryPager.java  | 6 +++++-
 .../cassandra/service/pager/RangeSliceQueryPager.java       | 8 ++++++--
 .../org/apache/cassandra/service/pager/SliceQueryPager.java | 9 +++++++--
 4 files changed, 19 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/98be5de7/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 261a53a,dbb3480..458d0d5
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,12 -1,9 +1,13 @@@
 -2.1.12
 - * Fix paging issues with partitions containing only static columns data
 -   (CASSANDRA-10381)
 +2.2.4
 + * Expose phi values from failure detector via JMX and tweak debug
 +   and trace logging (CASSANDRA-9526)
 + * Fix RangeNamesQueryPager (CASSANDRA-10509)
 + * Deprecate Pig support (CASSANDRA-10542)
 + * Reduce contention getting instances of CompositeType (CASSANDRA-10433)
 +Merged from 2.1:
++ * Fix paging issues with partitions containing only static columns data (CASSANDRA-10381)
   * Fix conditions on static columns (CASSANDRA-10264)
   * AssertionError: attempted to delete non-existing file CommitLog (CASSANDRA-10377)
 - * Merge range tombstones during compaction (CASSANDRA-7953)
   * (cqlsh) Distinguish negative and positive infinity in output (CASSANDRA-10523)
   * (cqlsh) allow custom time_format for COPY TO (CASSANDRA-8970)
   * Don't allow startup if the node's rack has changed (CASSANDRA-10242)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/98be5de7/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java
----------------------------------------------------------------------