Hi all.
I'm using datastax cassandra java driver version 3.0.0. with cassandra server 3.x.
(Actually the problem is also reproduced with newest driver 3.1.0 too)
Preamble: In order to workaround the issues
https://datastax-oss.atlassian.net/browse/JAVA-268https://datastax-oss.atlassian.net/browse/JAVA-471our code always executes query asynchronously.
We faced that driver sends SELECT query twice even for CL=ONE if SELECT is with LIMIT N and actually limits RS to N (more than N rows present in DB satisfying WHERE clause).
In logs it looks like:
2016-08-16 18:59:22,858000 DEBUG main/my.CassandraSession.Q: Query [SELECT ...] on [KS1] took 84ms at host03.some.domain with consistency ONE; OK
2016-08-16 18:59:22,858001 TRACE host-cass-nio-worker-9/com.datastax.driver.core.QueryLogger.NORMAL: [host] [host03.some.domain/ipv6:9042] Query completed normally, took 83 ms: [1 bound values] SELECT ...; [params]
2016-08-16 18:59:22,935000 TRACE host-cass-nio-worker-1/com.datastax.driver.core.QueryLogger.NORMAL: [host] [host01.some.domain/ipv6:9042] Query completed normally, took 61 ms: [1 bound values] SELECT ...; [params]
This example shows 2 TRACEs from driver and we see that driver sent query twice to different host from different nio threads.
Sometimes it even sends query twice to same host from same nio thread.
Also note that timing is different, so it seems not a simple 1 query logged twice problem.
DEBUG log is from my app, it shows that both:
- desired CL (statement.getConsistencyLevel())
- and actual CL (ExecutionInfo.getAchievedConsistencyLevel())
is the same and =ONE.If they differ then log message will be different saying that CL was altered during query execution.
If there are less than N rows matched WHERE clause – then we see only single TRACE log.
I can't find any info about such a problem in internet. Should I open issue in tracker?
When I turn on TRACE for the whole "com.datastax" I see additional info:
1-st query logs: received: ROWS [5 columns] (to be continued)
2-nd query logs: received: ROWS [5 columns]
If you want I can show this full TRACEd queries too.