Fix CqlPagingRecordReader on tables with few rows

Patch by Tyler Hobbs; reviewed by Brandon Williams for CASSANDRA-7322
This commit is contained in:
Tyler Hobbs 2014-05-29 17:31:43 -05:00
parent ee950b4103
commit 30df4a7283
2 changed files with 3 additions and 1 deletions

View File

@ -34,6 +34,7 @@
* Fix DataOutputTest on Windows (CASSANDRA-7265)
* Embedded sets in user defined data-types are not updating (CASSANDRA-7267)
* Add tuple type to CQL/native protocol (CASSANDRA-7248)
* Fix CqlPagingRecordReader on tables with few rows (CASSANDRA-7322)
Merged from 2.0:
* Copy compaction options to make sure they are reloaded (CASSANDRA-7290)
* Add option to do more aggressive tombstone compactions (CASSANDRA-6563)

View File

@ -2983,7 +2983,8 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
int index = (int) Math.round(i * step);
Token token = tokens.get(index);
Range<Token> range = new Range<>(prevToken, token);
splits.add(Pair.create(range, cfs.estimatedKeysForRange(range)));
// always return an estimate > 0 (see CASSANDRA-7322)
splits.add(Pair.create(range, Math.max(cfs.metadata.getMinIndexInterval(), cfs.estimatedKeysForRange(range))));
prevToken = token;
}
return splits;