cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 鄢来琼 <laiqiong....@gtafe.com>
Subject RE: query statement return empty
Date Fri, 31 Jul 2015 01:54:21 GMT
The replication factor is 3, and we have tested it using “ALL”/ “QUORUM ”consistency
level, the result are in-consistency.
But we rewrite it using java or C#, the results are consistency.

Thanks.

发件人: Jeff Jirsa [mailto:Jeff.Jirsa@crowdstrike.com]
发送时间: Friday, July 31, 2015 9:15 AM
收件人: user@cassandra.apache.org
主题: Re: query statement return empty

What consistency level are you using with your query?
What replication factor are you using on your keyspace?
Have you run repair?

The most likely explanation is that you wrote with low consistency (ANY, ONE, etc), and that
one or more replicas does not have the cell. You’re then reading with low consistency (ONE,
etc), and occasionally the coordinator choses a replica without the data, so it is returning
an empty result.

You can either increase your consistency level on reads and/or writes, or you can run repair
to get the data on all nodes.



From: 鄢来琼
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>"
Date: Thursday, July 30, 2015 at 6:02 PM
To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>"
Subject: query statement return empty

Hi ALL

The result of “select * from t_test where id = 1” statement is not consistency,
Could you tell me why?

test case,
I = 0;
While I < 5:
    result = cassandra_session.execute(“select ratio from t_test where id = 1”)
print result

testing result:
[Row(ratio=Decimal('0.000'))]
[]
[Row(ratio=Decimal('0.000'))]
[Row(ratio=Decimal('0.000'))]
[Row(ratio=Decimal('0.000'))]

Cassandra cluster:
My Cassandra version is 2.12,
the Cassandra cluster has 9 nodes.
The python driver version is 2.6

I have tested both the AsyncoreConnection and LibevConnection, the results are in consistency.

Thanks a lot.

Peter
Mime
View raw message