cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [1/3] cassandra git commit: Fix distinct queries in mixed version clusters
Date Fri, 06 Nov 2015 13:52:32 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 dc7e8405b -> 57d56bd1c


Fix distinct queries in mixed version clusters

patch by blerer; reviewed by slebresne for CASSANDRA-10573


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

Branch: refs/heads/cassandra-3.0
Commit: 962aa2b5cce685f32b106d70df35e66ea46e6817
Parents: dc7e840
Author: Benjamin Lerer <b.lerer@gmail.com>
Authored: Fri Nov 6 12:11:55 2015 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Fri Nov 6 12:13:49 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                       | 1 +
 src/java/org/apache/cassandra/db/ReadCommand.java | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/962aa2b5/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index bb8b4d2..6d26afa 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0
+ * Fix distinct queries in mixed version cluster (CASSANDRA-10573)
  * Skip sstable on clustering in names query (CASSANDRA-10571)
  * Remove value skipping as it breaks read-repair (CASSANDRA-10655)
  * Fix bootstrapping with MVs (CASSANDRA-10621)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/962aa2b5/src/java/org/apache/cassandra/db/ReadCommand.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ReadCommand.java b/src/java/org/apache/cassandra/db/ReadCommand.java
index ace5e1e..301cb86 100644
--- a/src/java/org/apache/cassandra/db/ReadCommand.java
+++ b/src/java/org/apache/cassandra/db/ReadCommand.java
@@ -922,8 +922,10 @@ public abstract class ReadCommand implements ReadQuery
         static ColumnFilter getColumnSelectionForSlice(boolean selectsStatics, int compositesToGroup,
CFMetaData metadata)
         {
             // A value of -2 indicates this is a DISTINCT query that doesn't select static
columns, only partition keys.
+            // In that case, we'll basically be querying the first row of the partition,
but we must make sure we include
+            // all columns so we get at least one cell if there is a live row as it would
confuse pre-3.0 nodes otherwise.
             if (compositesToGroup == -2)
-                return ColumnFilter.selection(PartitionColumns.NONE);
+                return ColumnFilter.all(metadata);
 
             // if a slice query from a pre-3.0 node doesn't cover statics, we shouldn't select
them at all
             PartitionColumns columns = selectsStatics


Mime
View raw message