You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ty...@apache.org on 2016/09/27 17:04:52 UTC
[2/3] cassandra git commit: Fix time-order query check for non-frozen
UDTs, frozen collections
Fix time-order query check for non-frozen UDTs, frozen collections
Patch by Tyler Hobbs; reviewed by Benjamin Lerer for CASSANDRA-12605
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/21d8a7d3
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/21d8a7d3
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/21d8a7d3
Branch: refs/heads/trunk
Commit: 21d8a7d3bd5b9ec49f486c3c7a816939c4040686
Parents: 8aa6f29
Author: Tyler Hobbs <ty...@gmail.com>
Authored: Tue Sep 27 11:59:53 2016 -0500
Committer: Tyler Hobbs <ty...@gmail.com>
Committed: Tue Sep 27 11:59:53 2016 -0500
----------------------------------------------------------------------
CHANGES.txt | 2 ++
.../cassandra/db/SinglePartitionReadCommand.java | 16 ++++++++--------
2 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/21d8a7d3/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 576dfb5..4280abd 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
3.0.10
+ * Fix potentially incomplete non-frozen UDT values when querying with the
+ full primary key specified (CASSANDRA-12605)
* Skip writing MV mutations to commitlog on mutation.applyUnsafe() (CASSANDRA-11670)
* Establish consistent distinction between non-existing partition and NULL value for LWTs on static columns (CASSANDRA-12060)
* Extend ColumnIdentifier.internedInstances key to include the type that generated the byte buffer (CASSANDRA-12516)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/21d8a7d3/src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java b/src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java
index 886a918..23b02f3 100644
--- a/src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java
+++ b/src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java
@@ -511,11 +511,11 @@ public class SinglePartitionReadCommand extends ReadCommand
* 2) If we have a name filter (so we query specific rows), we can make a bet: that all column for all queried row
* will have data in the most recent sstable(s), thus saving us from reading older ones. This does imply we
* have a way to guarantee we have all the data for what is queried, which is only possible for name queries
- * and if we have neither collections nor counters (indeed, for a collection, we can't guarantee an older sstable
- * won't have some elements that weren't in the most recent sstables, and counters are intrinsically a collection
- * of shards so have the same problem).
+ * and if we have neither non-frozen collections/UDTs nor counters (indeed, for a non-frozen collection or UDT,
+ * we can't guarantee an older sstable won't have some elements that weren't in the most recent sstables,
+ * and counters are intrinsically a collection of shards and so have the same problem).
*/
- if (clusteringIndexFilter() instanceof ClusteringIndexNamesFilter && queryNeitherCountersNorCollections())
+ if (clusteringIndexFilter() instanceof ClusteringIndexNamesFilter && !queriesMulticellType())
return queryMemtableAndSSTablesInTimestampOrder(cfs, copyOnHeap, (ClusteringIndexNamesFilter)clusteringIndexFilter());
Tracing.trace("Acquiring sstable references");
@@ -662,14 +662,14 @@ public class SinglePartitionReadCommand extends ReadCommand
return clusteringIndexFilter().shouldInclude(sstable);
}
- private boolean queryNeitherCountersNorCollections()
+ private boolean queriesMulticellType()
{
for (ColumnDefinition column : columnFilter().fetchedColumns())
{
- if (column.type.isCollection() || column.type.isCounter())
- return false;
+ if (column.type.isMultiCell() || column.type.isCounter())
+ return true;
}
- return true;
+ return false;
}
/**