Merge branch 'cassandra-3.0' into trunk
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a5e501f0 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a5e501f0 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a5e501f0 Branch: refs/heads/trunk Commit: a5e501f094e882e1531abf9bf205e8a59730ed70 Parents: 7cd14d0 14f08e6 Author: Sam Tunnicliffe <[email protected]> Authored: Wed Apr 20 16:04:18 2016 +0100 Committer: Sam Tunnicliffe <[email protected]> Committed: Wed Apr 20 16:06:51 2016 +0100 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../index/internal/keys/KeysSearcher.java | 33 ++++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a5e501f0/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index 08efbfb,ae73437..ca679b2 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,58 -1,5 +1,59 @@@ -3.0.6 +3.6 + * Optimize the overlapping lookup by calculating all the + bounds in advance (CASSANDRA-11571) + * Support json/yaml output in noetool tablestats (CASSANDRA-5977) + * (stress) Add datacenter option to -node options (CASSANDRA-11591) + * Fix handling of empty slices (CASSANDRA-11513) + * Make number of cores used by cqlsh COPY visible to testing code (CASSANDRA-11437) + * Allow filtering on clustering columns for queries without secondary indexes (CASSANDRA-11310) + * Refactor Restriction hierarchy (CASSANDRA-11354) + * Eliminate allocations in R/W path (CASSANDRA-11421) + * Update Netty to 4.0.36 (CASSANDRA-11567) + * Fix PER PARTITION LIMIT for queries requiring post-query ordering (CASSANDRA-11556) + * Allow instantiation of UDTs and tuples in UDFs (CASSANDRA-10818) + * Support UDT in CQLSSTableWriter (CASSANDRA-10624) + * Support for non-frozen user-defined types, updating + individual fields of user-defined types (CASSANDRA-7423) + * Make LZ4 compression level configurable (CASSANDRA-11051) + * Allow per-partition LIMIT clause in CQL (CASSANDRA-7017) + * Make custom filtering more extensible with UserExpression (CASSANDRA-11295) + * Improve field-checking and error reporting in cassandra.yaml (CASSANDRA-10649) + * Print CAS stats in nodetool proxyhistograms (CASSANDRA-11507) + * More user friendly error when providing an invalid token to nodetool (CASSANDRA-9348) + * Add static column support to SASI index (CASSANDRA-11183) + * Support EQ/PREFIX queries in SASI CONTAINS mode without tokenization (CASSANDRA-11434) + * Support LIKE operator in prepared statements (CASSANDRA-11456) + * Add a command to see if a Materialized View has finished building (CASSANDRA-9967) + * Log endpoint and port associated with streaming operation (CASSANDRA-8777) + * Print sensible units for all log messages (CASSANDRA-9692) + * Upgrade Netty to version 4.0.34 (CASSANDRA-11096) + * Break the CQL grammar into separate Parser and Lexer (CASSANDRA-11372) + * Compress only inter-dc traffic by default (CASSANDRA-8888) + * Add metrics to track write amplification (CASSANDRA-11420) + * cassandra-stress: cannot handle "value-less" tables (CASSANDRA-7739) + * Add/drop multiple columns in one ALTER TABLE statement (CASSANDRA-10411) + * Add require_endpoint_verification opt for internode encryption (CASSANDRA-9220) + * Add auto import java.util for UDF code block (CASSANDRA-11392) + * Add --hex-format option to nodetool getsstables (CASSANDRA-11337) + * sstablemetadata should print sstable min/max token (CASSANDRA-7159) + * Do not wrap CassandraException in TriggerExecutor (CASSANDRA-9421) + * COPY TO should have higher double precision (CASSANDRA-11255) + * Stress should exit with non-zero status after failure (CASSANDRA-10340) + * Add client to cqlsh SHOW_SESSION (CASSANDRA-8958) + * Fix nodetool tablestats keyspace level metrics (CASSANDRA-11226) + * Store repair options in parent_repair_history (CASSANDRA-11244) + * Print current leveling in sstableofflinerelevel (CASSANDRA-9588) + * Change repair message for keyspaces with RF 1 (CASSANDRA-11203) + * Remove hard-coded SSL cipher suites and protocols (CASSANDRA-10508) + * Improve concurrency in CompactionStrategyManager (CASSANDRA-10099) + * (cqlsh) interpret CQL type for formatting blobs (CASSANDRA-11274) + * Refuse to start and print txn log information in case of disk + corruption (CASSANDRA-10112) + * Resolve some eclipse-warnings (CASSANDRA-11086) + * (cqlsh) Show static columns in a different color (CASSANDRA-11059) + * Allow to remove TTLs on table with default_time_to_live (CASSANDRA-11207) +Merged from 3.0: + * Ensure columnfilter covers indexed columns for thrift 2i queries (CASSANDRA-11523) * Only open one sstable scanner per sstable (CASSANDRA-11412) * Option to specify ProtocolVersion in cassandra-stress (CASSANDRA-11410) * ArithmeticException in avgFunctionForDecimal (CASSANDRA-11485) http://git-wip-us.apache.org/repos/asf/cassandra/blob/a5e501f0/src/java/org/apache/cassandra/index/internal/keys/KeysSearcher.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/index/internal/keys/KeysSearcher.java index 468e8fe,189b652..a6b27cf --- a/src/java/org/apache/cassandra/index/internal/keys/KeysSearcher.java +++ b/src/java/org/apache/cassandra/index/internal/keys/KeysSearcher.java @@@ -134,6 -137,17 +137,17 @@@ public class KeysSearcher extends Cassa }; } + private ColumnFilter getExtendedFilter(ColumnFilter initialFilter) + { - if (command.columnFilter().includes(index.getIndexedColumn())) ++ if (command.columnFilter().fetches(index.getIndexedColumn())) + return initialFilter; + + ColumnFilter.Builder builder = ColumnFilter.selectionBuilder(); + builder.addAll(initialFilter.fetchedColumns()); + builder.add(index.getIndexedColumn()); + return builder.build(); + } + private UnfilteredRowIterator filterIfStale(UnfilteredRowIterator iterator, Row indexHit, ByteBuffer indexedValue, @@@ -144,10 -158,12 +158,12 @@@ if (isForThrift) { // The data we got has gone though ThrifResultsMerger, so we're looking for the row whose clustering - // is the indexed name. Ans so we need to materialize the partition. + // is the indexed name and so we need to materialize the partition. ImmutableBTreePartition result = ImmutableBTreePartition.create(iterator); iterator.close(); - Row data = result.getRow(new Clustering(index.getIndexedColumn().name.bytes)); + Row data = result.getRow(Clustering.make(index.getIndexedColumn().name.bytes)); + if (data == null) + return null; // for thrift tables, we need to compare the index entry against the compact value column, // not the column actually designated as the indexed column so we don't use the index function @@@ -164,7 -180,18 +180,18 @@@ } else { - return result.unfilteredIterator(); - if (command.columnFilter().includes(index.getIndexedColumn())) ++ if (command.columnFilter().fetches(index.getIndexedColumn())) + return result.unfilteredIterator(); + + // The query on the base table used an extended column filter to ensure that the + // indexed column was actually read for use in the staleness check, before + // returning the results we must filter the base table partition so that it + // contains only the originally requested columns. See CASSANDRA-11523 + ClusteringComparator comparator = result.metadata().comparator; + Slices.Builder slices = new Slices.Builder(comparator); + for (ColumnDefinition selected : command.columnFilter().fetchedColumns()) + slices.add(Slice.make(comparator, selected.name.bytes)); + return result.unfilteredIterator(ColumnFilter.all(command.metadata()), slices.build(), false); } } else
