Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
Normal
Description
The ctor of SliceQueryPager has the following code:
if (state != null) { // The only case where this could be a non-CellName Composite is if it's Composites.EMPTY, but that's not // valid for PagingState.cellName, so we can safely cast to CellName. lastReturned = (CellName) cfm.comparator.fromByteBuffer(state.cellName); restoreState(state.remaining, true); }
The assumption that we can only get a CellName is invalid however. When using a MultiPartitionPager (so when the query has a IN on the partition key), it's possible for a page to stop at the end of one of the underlying pager, and for that pager to be exhausted. If that's the case, the PagingState returned will have the partition key of the next key to retrieve, but a null cellname (since we haven't started to query that next key). When the next page is queried, that PagingState will trigger a ClassCastException.
The following dtest reproduces this problem.
Attachments
Issue Links
- is duplicated by
-
CASSANDRA-10290 2.1 EmptyComposite cannot be cast - SliceQueryPager
-
- Resolved
-