[jira] [Commented] (CASSANDRA-15641) No error if consistency_level = SERIAL and unqualified select

2020-04-02 Thread Massimiliano Tomassi (Jira)


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

Massimiliano Tomassi commented on CASSANDRA-15641:
--

Hi [~Osipov], as already explained by [~samt] in the slack channel, the 
behaviour depends on how the select statement is implemented. When paging is 
turned off, the query you are trying (filtering with an IN clause), results in 
a single multi-partition read (in which case the query would fail if SERIAL 
consistency is used), while if paging is turned on it will result in separate 
single-partition reads each executed with SERIAL consistency, therefore no 
exception is thrown. 

Here you can see the query failed with paging turned off and SERIAL consistency:
{code:java}
cqlsh> SELECT * FROM test.t where a in (1,2);
InvalidRequest: Error from server: code=2200 [Invalid query] 
message="SERIAL/LOCAL_SERIAL consistency may only be requested for one 
partition at a time"
{code}

I'm going to close this ticket as it doesn't categorise as a bug.

> No error if consistency_level = SERIAL and unqualified select
> -
>
> Key: CASSANDRA-15641
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15641
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Semantics
>Reporter: Konstantin
>Assignee: Massimiliano Tomassi
>Priority: Normal
> Fix For: 4.0-rc
>
> Attachments: test.py
>
>
> The attached test program produces no errors, while doesn't provide serial 
> consistency. There is no exception that the consistency level is incorrect. 
> It's simply silently downgraded. The issue is not documented either. 
> kostja@atlas ~ % python test.py
> Row(a=1, b=1)
> Row(a=0, b=0)
> Row(a=2, b=2)
> Row(a=3, b=3)
> Row(a=1, b=1)
> Row(a=2, b=2)
> The behavior is contrary to the original intent by LWT author, since the code 
> has the following check: 
>if (group.queries.size() > 1)
> throw new InvalidRequestException("SERIAL/LOCAL_SERIAL 
> consistency may only be requested for one partition at a time");
> https://github.com/apache/cassandra/blob/cassandra-3.11/src/java/org/apache/cassandra/service/StorageProxy.java#L1593



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15641) No error if consistency_level = SERIAL and unqualified select

2020-03-13 Thread Konstantin (Jira)


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

Konstantin commented on CASSANDRA-15641:


Konstantin Osipov 
what I am curious about though, is there any way to hit the code path I 
highlighted? I can't build a relevant query

beobal  8:38 PM
@Konstantin Osipov session.execute(SimpleStatement("select * from ks.t where a 
in (1, 2) ", fetch_size=-1, consistency_level=ConsistencyLevel.SERIAL))

Konstantin Osipov  8:39 PM
why does fetch_size matter? there is only a handful of rows in the table 
anyway..

beobal  8:41 PM
fetch_size=-1 disables paging. With paging enabled the multiple single 
partition reads are executed separately (and paged), but disabling it shortcuts 
that and goes straight to StorageProxy::read with a group of size 2

> No error if consistency_level = SERIAL and unqualified select
> -
>
> Key: CASSANDRA-15641
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15641
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Semantics
>Reporter: Konstantin
>Priority: Normal
> Attachments: test.py
>
>
> The attached test program produces no errors, while doesn't provide serial 
> consistency. There is no exception that the consistency level is incorrect. 
> It's simply silently downgraded. The issue is not documented either. 
> kostja@atlas ~ % python test.py
> Row(a=1, b=1)
> Row(a=0, b=0)
> Row(a=2, b=2)
> Row(a=3, b=3)
> Row(a=1, b=1)
> Row(a=2, b=2)
> The behavior is contrary to the original intent by LWT author, since the code 
> has the following check: 
>if (group.queries.size() > 1)
> throw new InvalidRequestException("SERIAL/LOCAL_SERIAL 
> consistency may only be requested for one partition at a time");
> https://github.com/apache/cassandra/blob/cassandra-3.11/src/java/org/apache/cassandra/service/StorageProxy.java#L1593



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org