0
votes

[Update]

The previous statement was quite misleading so I am elaborating more here:

I ran a test that sends out queries via Thrift protocol in PHP and the script looks like:

for ($i=0; $i<100; $i++) {  
    $query = "update ns.table set value='before' where key='key$i';";  
    // randomly select a node and send query  
}  

for ($i=0; $i<100; $i++) {  
    $query = "update ns.table set value='after' where key='key$i';";  
    // randomly select a node and send query  
}  

The table started as empty, and after the test only certain rows contain the value "after" while most rows contain "before".

I did not receive any error throughout the test. So somehow the queries in the second loop failed silently.

All queries are sent with consistency level ALL, and the table has a replication factor of 2.

My cassandra version is DSE 4.6.3, and the cluster has a total of 39 nodes.

[Update2]

After putting a sleep (for 3 seconds) in between the two loops the test can now give me correct result, with all rows in the table having the value "after".

But this is still confusing since for consistency level ALL I am expecting all queries to be made transactionally. No need for the sleep function.

1
There could be a number of reasons why this is happening. Could you please update your answer to include: cassandra version, client being used (and its version), and a snippet of your application?Andy Tolbert
What does your query look like? Is it a range query? Are you sure your selects are being executed after your writes have completed?Andy Tolbert
I wonder about clock sync, as well.mshuler

1 Answers

1
votes

After syncing the clocks of nodes the issue has been resolved.

Thanks @mshuler for pointing out.