cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-10352) Paging with DISTINCT and IN can throw ClassCastException
Date Wed, 16 Sep 2015 11:20:45 GMT


Sylvain Lebresne commented on CASSANDRA-10352:

I've pushed a fix for this [here|]. With
that, the dtest linked above passes.

> Paging with DISTINCT and IN can throw ClassCastException
> --------------------------------------------------------
>                 Key: CASSANDRA-10352
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 2.1.x, 2.2.x
> The ctor of {{SliceQueryPager}} has the following code:
> {noformat}
>         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);
>         }
> {noformat}
> 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.

This message was sent by Atlassian JIRA

View raw message