This is an automated email from the ASF dual-hosted git repository. bdeggleston pushed a commit to branch cassandra-3.11 in repository https://gitbox.apache.org/repos/asf/cassandra.git
commit 839fc7e36f6f949b9e2fa6c786abc05816ecd87f Merge: 7e64003 d27c3ad Author: Blake Eggleston <bdeggles...@gmail.com> AuthorDate: Wed Apr 24 11:37:39 2019 -0700 Merge branch 'cassandra-3.0' into cassandra-3.11 CHANGES.txt | 1 + src/java/org/apache/cassandra/db/ReadCommand.java | 2 + .../org/apache/cassandra/db/filter/DataLimits.java | 19 ++++ .../upgrade/CompactStorage2to3UpgradeTest.java | 102 +++++++++++++++++++++ 4 files changed, 124 insertions(+) diff --cc CHANGES.txt index c04ad58,4f76c70..9ce2972 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,8 -1,7 +1,9 @@@ -3.0.19 +3.11.5 + * Fixed nodetool cfstats printing index name twice (CASSANDRA-14903) + * Add flag to disable SASI indexes, and warnings on creation (CASSANDRA-14866) +Merged from 3.0: + * Fix mixed mode partition range scans with limit (CASSANDRA-15072) * cassandra-stress works with frozen collections: list and set (CASSANDRA-14907) - * For nodetool listsnapshots output, put spaces between columns, and increase snapshot padding (CASSANDRA-14876) * Fix handling FS errors on writing and reading flat files - LogTransaction and hints (CASSANDRA-15053) * Avoid double closing the iterator to avoid overcounting the number of requests (CASSANDRA-15058) * Improve `nodetool status -r` speed (CASSANDRA-14847) diff --cc src/java/org/apache/cassandra/db/filter/DataLimits.java index 205d745,46a1c6d..c6918eb --- a/src/java/org/apache/cassandra/db/filter/DataLimits.java +++ b/src/java/org/apache/cassandra/db/filter/DataLimits.java @@@ -80,29 -77,31 +80,48 @@@ public abstract class DataLimit public static DataLimits cqlLimits(int cqlRowLimit) { - return new CQLLimits(cqlRowLimit); + return cqlRowLimit == NO_LIMIT ? NONE : new CQLLimits(cqlRowLimit); } + // mixed mode partition range scans on compact storage tables without clustering columns coordinated by 2.x are + // returned as one (cql) row per cell, but we need to count each partition as a single row. So we just return a + // CQLLimits instance that doesn't count rows towards it's limit. See CASSANDRA-15072 + public static DataLimits legacyCompactStaticCqlLimits(int cqlRowLimits) + { + return new CQLLimits(cqlRowLimits) { + public Counter newCounter(int nowInSec, boolean assumeLiveData, boolean countPartitionsWithOnlyStaticData, boolean enforceStrictLiveness) + { + return new CQLCounter(nowInSec, assumeLiveData, countPartitionsWithOnlyStaticData, enforceStrictLiveness) { + public Row applyToRow(Row row) + { + // noop: only count full partitions + return row; + } + }; + } + }; + } + public static DataLimits cqlLimits(int cqlRowLimit, int perPartitionLimit) { - return new CQLLimits(cqlRowLimit, perPartitionLimit); + return cqlRowLimit == NO_LIMIT && perPartitionLimit == NO_LIMIT + ? NONE + : new CQLLimits(cqlRowLimit, perPartitionLimit); + } + + private static DataLimits cqlLimits(int cqlRowLimit, int perPartitionLimit, boolean isDistinct) + { + return cqlRowLimit == NO_LIMIT && perPartitionLimit == NO_LIMIT && !isDistinct + ? NONE + : new CQLLimits(cqlRowLimit, perPartitionLimit, isDistinct); + } + + public static DataLimits groupByLimits(int groupLimit, + int groupPerPartitionLimit, + int rowLimit, + AggregationSpecification groupBySpec) + { + return new CQLGroupByLimits(groupLimit, groupPerPartitionLimit, rowLimit, groupBySpec); } public static DataLimits distinctLimits(int cqlRowLimit) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org