You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Julien Aymé (JIRA)" <ji...@apache.org> on 2013/12/04 13:14:38 UTC

[jira] [Comment Edited] (CASSANDRA-6447) SELECT someColumns FROM table results in AssertionError in AbstractQueryPager.discardFirst

    [ https://issues.apache.org/jira/browse/CASSANDRA-6447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13838841#comment-13838841 ] 

Julien Aymé edited comment on CASSANDRA-6447 at 12/4/13 12:13 PM:
------------------------------------------------------------------

Also, since newCf.getColumnCount() == 0, the rest of the code is still valid (the row will not be included in the returned Rows).
Therefore, I think that the assert statement should be transformed to:
{code}
assert discarded == 1 || discarded == 0;
{code}
Or that the assert statement should be dropped, since it was introduced in the last commit on AbstractQueryPager: 

See: https://git-wip-us.apache.org/repos/asf?p=cassandra.git;a=commit;h=3c9760bdb986f6c2430adfc13c86ecb75c3246ac



was (Author: julien.ayme@gmail.com):
Also, since newCf.getColumnCount() == 0, the rest of the code is still valid (the row will not be included in the returned Rows).
Therefore, I think that the assert statement should be transformed to:
{code}
assert discarded == 1 || discarded == 0;
{code}
Or that the assert statement should be dropped.

> SELECT someColumns FROM table results in AssertionError in AbstractQueryPager.discardFirst
> ------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-6447
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6447
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: Cluster: single node server (ubuntu)
> Cassandra version: 2.0.3 (server/client)
> Client: Datastax cassandra-driver-core 2.0.0-rc1
>            Reporter: Julien Aymé
>         Attachments: stacktrace.txt
>
>
> I have a query which must read all the rows from the table:
> Query: "SELECT key, col1, col2, col3 FROM mytable"
> Here is the corresponding code (this is using datastax driver):
> {code}
> ResultSet result = session.execute("SELECT key, col1, col2, col3 FROM mytable");
> for (Row row : result) {
>      // do some work with row
> }
> {code}
> Messages sent from the client to Cassandra:
> * 1st: {{QUERY SELECT key, col1, col2, col3 FROM mytable([cl=ONE, vals=[], skip=false, psize=5000, state=null, serialCl=ONE])}}
> * 2nd: {{QUERY SELECT key, col1, col2, col3 FROM mytable([cl=ONE, vals=[], skip=false, psize=5000, state=java.nio.HeapByteBuffer[pos=24 lim=80 cap=410474], serialCl=ONE])}}
> On the first message, everything is fine, and the server returns 5000 rows.
> On the second message, paging is in progress, and the server fails in AbstractQueryPager.discardFirst: AssertionError (stack trace attached).
> Here is some more info (step by step debugging on reception of 2nd message):
> {code}
> AbstractQueryPager.fetchPage(int):
> * pageSize=5000, currentPageSize=5001, rows size=5002, liveCount=5001
> * containsPreviousLast(rows.get(0)) returns true
> -> AbstractQueryPager.discardFirst(List<Row>):
> * rows size=5002
> * first=TreeMapBackedSortedColumns[with TreeMap size=1]
> -> AbstractQueryPager.discardHead(ColumnFamily, ...):
> * counter = ColumnCounter$GroupByPrefix
> * iter.hasNext() returns true (TreeMap$ValueIterator with TreeMap size=1)
> * Column c = DeletedColumn
> * counter.count() -> c.isLive returns false (c is DeletedColumn)
> * counter.live() = 0
> * iter.hasNext() returns false
> * Math.min(0, toDiscard==1) returns 0
> <- AbstractQueryPager.discardFirst(List<Row>):
> * discarded = 0;
> * count = newCf.getColumnCount() = 0;
> {code}
> ->  assert discarded == 1 *throws AssertionError*



--
This message was sent by Atlassian JIRA
(v6.1#6144)