1

we are reading from cassandra ver 1 and inserting into ver 3 While reading from cassandra ver 1 I am not able to retrieve rows and in logs I see same logs in loop For reading we are using netflix astyanax API

Keyspace.prepareQuery(ColumnFamily).getAllRows.execute.getResult()

It works sometimes but fails majority of times Do we require to configure any property in cassandra host ?

DEBUG STATES: 306- [/IPaddr1:9042] Connection[/IPaddr1:9042-1, inFlight-e, closed-false] Transport initialized, connection ready
DEBUG HostConnectionPool:153 Created connection pool to host /IPaddr1:9842 (1 connections needed, 1 successfully opened)
DEBUG Session: 364 Added connection pool for /IPaddr1:9042
TRACE RequestHandler:71 [1983451872] USE <keyspace_name>
TRACE RequestHandler:272 [1983451872-1] Starting - TRACE RequestHandler: 280 [1983451872-1] Querying node nodel/IPaddr2:9042
TRACE Connection:519 Connection [node1/IPaddr2:9042-2, inFlight-1, closed-false], stream 128, writing request QUERY USE <keyspace_name>([c1-LOCAL QUORUM,
positionalVals-[], namedVals-(), skip-false, psize-5000, state-null, serialCI-LOCAL SERIAL])
TRACE Connection: 567 Connection [node1/IPaddr2:9042-2, inFlight-1, closed-false], stream 128, request sent successfully TRACE Connection:979 Connection[node1/IPaddr2:9042-2, inFlight-1, closed-false], stream 128, received: RESULT set keyspace <keyspace_name>
TRACE RequestHandler:166 [1983451872-1] Setting Final result INFO ThriftKeyspaceImpl:640 Detected partitioner org.apache.cassandra.dht.RandomPartitioner for keyspace <keyspace_name>
TRACE RequestHandler: 71 [1955920234] com.datastax.driver.core.Statement$1@56166512 TRACE RequestHandler: 272 [1955920234-1] Starting
TRACE RequestHandler: 280 [1955920234-1] Querying node /IPaddr3:9842 = TRACE Connection:456 Connection[/IPaddr3:9842-1, inFlight-1, closed-false] Setting keyspace <keyspace_name>
TRACE Connection:519 Connection[/IPaddr3:9042-1, inFlight-1, closed-false], stream 128, writing request QUERY USE "<keyspace_name>"([c1-ONE, positionalVals-[],
namedVals-(), skip-false, psize--1, state-null, serialC1-SERIAL])
TRACE Connection: 567 Connection[/IPaddr3:9042-1, inFlight-1, closed-false], stream 128, request sent successfully TRACE Connection:979 Connection[/IPaddr3:9042-1, inFlight-1, closed-false], stream 128, received: RESULT set keyspace <keyspace_name>
TRACE Connection: 519 Connection[/IPaddr3:9042-1, inFlight-1, closed-false], stream 192, writing request PREPARE insert into table_name(...) values(...) using ttl
ttl
TRACE Connection: 567 Connection[/IPaddr3:9042-1, inFlight-1, closed-false], stream 192, request sent successfully
TRACE Connection:979 - Connection[/IPaddr3:9042-1, inFlight-1, closed-false], stream 192, received: RESULT PREPARED 8x2d705d7bcasd4e6bcf1824 [vid (int)][rdt (bigint)]
TRACE RequestHandler: 166 [1955920234-1] Setting final result
TRACE Connection:456 Connection[node1/IPaddr2:9842-2, inflight-1, closed-false] Setting keyspace <keyspace_name>
TRACE Connection:519 - Connection[node1/IPaddr2:9842-2, inflight-1, closed-false], stream 192, writing request QUERY USE namedVals-(), skip-false, psize--1, state-null, serialC1-SERIAL])
I
"<keyspace_name>" ([c1-ONE, positionalVals-[],
TRACE Connection: 567 Connection [node1/IPaddr2:9842-2, inFlight-1, closed-false], stream 192, request sent successfully TRACE Connection:979 - Connection[node1/IPaddr2:9842-2, inFlight-1, closed-false], stream 192, received: RESULT set keyspace <keyspace_name>
TRACE Connection:519 - Connection [node1/IPaddr2:9842-2, inFlight-1, closed-false], stream 256, writing request PREPARE insert into table name (...) values (...) using ttl :ttl
TRACE Connection:567 - Connection[node1/IPaddr2:9842-2, inFlight-1, closed-false], stream 256, request sent successfully TRACE Connection:456 Connection[/IPaddr1:9842-1, inFlight-1, closed-false] Setting keyspace <keyspace_name>
TRACE Connection:519 - Connection/IPaddr1:9842-1, inFlight=1, closed-false], stream 128, writing request QUERY USE "<keyspace_name>"([c1-ONE, positionalVals=[], namedVals-, skio false. osize--1. state=null, serialC1-SERIAL])
TRACE Connection:567 Connection[/IPaddr1:9042-1, inflight-1, closed-false], stream 128, request sent successfully
TRACE Connection:979 Connection[node1/IPaddr2:9042-2, inflight-1, closed-false], stream 256, received: RESULT PREPARED 0x2d785d7asdf1024 [vid (int)] [rdt (bigint)] [cts (bigint)][fd (bigint)][vd (bigint)][dv (double)][lu (bigint)][s (int)][tv (varchar)][ttl (int)] (resultMetadata=[8 columns])
TRACE Connection:979 Connection]/IPaddr1:9042-1, inFlight-1, closed-false], stream 128, received: RESULT set keyspace <keyspace name> TRACE Connection:519 - Connection[/IPaddr1:9842-1, inflight-1, closed-false], stream 192, writing request PREPARE insert into table_name(...) values (...) using ttl
:ttl
TRACE Connection:567- Connection[/IPaddr1:9042-1, inFlight-1, closed-false], stream 192, request sent successfully TRACE Connection:979 - Connection[/IPaddr1:9042-1, inFlight-1, closed-false], stream 192, received: RESULT PREPARED 0x20705d7bc168e3dea201d34e6bcf1024 [vid (int)][rdt
(bigint)][cts (bigint)][fd (bigint)][vd (bigint)][dv (double)][lu (bigint)][s (int)][tv (varchar)][ttl (int)] (resultMetadata-[9 columns])
TRACE HostConnectionPool:565 Current inFlight 1, 1 connections needed, 1 connections available, trashing TRACE HostConnectionPool:565 Current inFlight 1, 1 connections needed, 1 connections available, trashing -
TRACE HostConnectionPool:565 Current inFlight 1, 1 connections needed, 1 connections available, trashing TRACE HostConnectionPool:565 Current inFlight 0, 1 connections needed, 1 connections available, trashing 0 -
TRACE HostConnectionPool:565 - Current inFlight 0, 1 connections needed, 1 connections available, trashing e TRACE HostConnectionPool:565 Current inFlight 0, 1 connections needed, 1 connections available, trashing
TRACE HostConnectionPool:565 Current inflight = 0, 1 connections needed, 1 connections available, trashing
TRACE HostConnectionPool:565 Current inflight 8, 1 connections needed, 1 connections available, trashing 0.
TRACE HostConnectionPool:565 Current inFlight 0, 1 connections needed, 1 connections available, trashing DEBUG Connection:1016 Connection[nodel/IPaddr2:9042-1, inFlight-0, closed-false] was inactive for 30 seconds, sending heartbeat
TRACE Connection:519 - Connection[nodel/IPaddr2:9842-1, inflight-0, closed-false], stream 8, writing request OPTIONS TRACE Connection:567 Connection[node1/IPaddr2:9842-1, inflight-8, closed-false], stream 0, request sent successfully
TRACE Connection:979 Connection [node1/IPaddr2:9842-1, inFlight-e, closed-false], stream 0, received: SUPPORTED (COMPRESSION-[snappy, 124], CQL_VERSION-[3.4.2]} DEBUG Connection:1886- Connection[node1/IPaddr2:9842-1, inFlight-0, closed-false] heartbeat query succeeded DEBUG Connection: 1816 Connection[nodel/IPaddr2:9842-2, inFlight-0, closed-false] was inactive for 30 seconds, sending heartbeat
DEBUG Connection:1816- Connection[/IPaddr3:9842-1, inFlight-e, closed-false] was inactive for 30 seconds, sending heartbeat
TRACE Connection:519 Connection[node1/IPaddr2:9842-2, inFlight-0, closed-false], stream 320, writing request OPTIONS TRACE Connection:519 Connection[/IPaddr3:9842-1, inFlight-e, closed-false], stream 256, writing request OPTIONS
TRACE Connection: 567 Connection[node1/IPaddr2:9842-2, inflight-0, closed-false], stream 328, request sent successfully TRACE Connection: 567 Connection[/IPaddr3:9842-1, inFlight-0, closed-false], stream 256, request sent successfully
Aaron
  • 55,518
  • 11
  • 116
  • 132
Zen
  • 31
  • 3

1 Answers1

0
Keyspace.prepareQuery(ColumnFamily).getAllRows.execute.getResult()

How many rows are in this table? Are there a lot of columns per row? If you're seeing inconsistent results, it is probably because of this: getAllRows.

You might need to try using setRowLimit to get Astyanax to make smaller, incremental queries to Cassandra:

Keyspace.prepareQuery(ColumnFamily)
    .getAllRows
    .setRowLimit(10)
    .execute.getResult()

I'd also advise checking out Richard Low's Answer here:

how to read all 1000 rows from cassandra CF with astyanax

It's 10 years old, and it uses the deprecated setBlockSize instead of setRowLimit. But it might give you some ideas on how to move forward, especially if there are a lot of columns per row.

Aaron
  • 55,518
  • 11
  • 116
  • 132
  • Yes we are using setRowLimit for incremental queries and column size is also 10 – Zen Jul 11 '23 at 03:19