incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Xu <jimxu...@gmail.com>
Subject Getting different results each time after inserting data into cassandra using lightweight transaction
Date Tue, 18 Feb 2014 03:22:12 GMT
Hi all,

The cluster has 5 nodes, one keyspace(RF=3), a table(named t1) and a 
column family(named cf1,and has two fixed columns each row).
Single thread, two test programs to insert data using lightweight 
transaction.

the pseudocode is as follows:
program 1:
...
for (int i=1;i<10000;i++){
...
client.execute_sql3_query("insert into t1(id,name) values("+i+",'jane') 
if not exists");
}

program 2:
...
List<Column> expected=new ArrayList<Column>();
for (int i=1;i<10000;i++){
List<Column> updates=new ArrayList<Column>();
updates.add(...);
...
client.cas(ByteBufferUtil.byte(i),"cf1",expected,updates,ConsistencyLevel.SERIAL, 
ConsistencyLevel.QUORUM);
}

Program 1 and 2 are executed synchrously,if there is no exception, data 
got from cqlsh using the following cqls:
cqlsh> select count(*) from t1 limit 10000;
cqlsh> select count(*) from cf1 limit 10000;

However,the results of the two cqls are different each time I 
execute,and I find every node is UP, using nodetool status.

In the beginning of a suite of tests, we didn't find any problem. The 
case should we notice is that, a test when the former table and column 
family were dropped and then the newly created table and column family 
would lead the scenario descripted above.


I¹m using Cassandra 2.0.3.

Any insights would be greatly appreciated.

Thanks.

Mime
View raw message