[ 
https://issues.apache.org/jira/browse/CASSANDRA-3465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13147134#comment-13147134
 ] 

Alain RODRIGUEZ commented on CASSANDRA-3465:
--------------------------------------------

I've made a mistake doing this little test script.

$stats_test = new ColumnFamily($pool, 'test_counter',
$read_consistency_level=cassandra_ConsistencyLevel::QUORUM,
$write_consistency_level=cassandra_ConsistencyLevel::QUORUM);

should have been:

$stats_test = new ColumnFamily($pool, 'test_counter',
true, true,cassandra_ConsistencyLevel::QUORUM, 
cassandra_ConsistencyLevel::QUORUM);

I'm sorry about it.

Now I see in the logs that modifications are using CL.QUORUM. I'm sure to read 
with CL.QUORUM too.

DEBUG [MutationStage:13] 2011-11-09 15:30:39,483 
CounterMutationVerbHandler.java (line 53) Applying forwarded 
CounterMutation(RowMutation(keyspace='mykeyspace', key='31', 
modifications=[ColumnFamily(test_counter 
[323031313131303931353a74657374:false:8@1320852636516,])]), QUORUM)
DEBUG [MutationStage:13] 2011-11-09 15:30:39,483 StorageProxy.java (line 135) 
insert writing local & replicate 
CounterMutation(RowMutation(keyspace='mykeyspace', key='31', 
modifications=[test_counter]), QUORUM)

It still doesn't work properly, the behaviour reamins exactly the same as with 
a CL.ONE.

But I don't know why you think it comes from the CL, because I thought the CL 
shoudn't change the way that data are written but just the number of node we 
need to request before returning the information. After performing a repair on 
all nodes, shouldn't I have the same results with CL.ONE, CL.QUORUM or CL.ALL ?

"And getting the results you get at CL.ONE is not surprising." --> Why not ?

By the way, I have try with a CL.ALL and it doesn't work better.

DEBUG [MutationStage:8] 2011-11-09 16:02:37,180 CounterMutationVerbHandler.java 
(line 53) Applying forwarded CounterMutation(RowMutation(keyspace='mykeyspace', 
key='34', modifications=[ColumnFamily(test_counter 
[323031313131303931363a74657374:false:8@1320854552469,])]), ALL)
DEBUG [MutationStage:8] 2011-11-09 16:02:37,180 StorageProxy.java (line 135) 
insert writing local & replicate 
CounterMutation(RowMutation(keyspace='mykeyspace', key='34', 
modifications=[test_counter]), ALL)

This looks very weird to me, especially since you can not reproduce this 
behaviour.

If I can do more, just let me know.


                
> Wrong counters values when RF > 1
> ---------------------------------
>
>                 Key: CASSANDRA-3465
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3465
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>         Environment: Amazon EC2 (cluster of 5 t1.micro), phpCassa 0.8.a.2
>            Reporter: Alain RODRIGUEZ
>            Assignee: Sylvain Lebresne
>            Priority: Critical
>         Attachments: logServer0.log, logServer1.log, logServer2.log
>
>
> I have got a CF that contains many counters of some events. When I'm at RF = 
> 1 and simulate 10 events, they are well counted.
> However, when I switch to a RF = 3, my counter show a wrong value that 
> sometimes change when requested twice (it can return 7, then 5 instead of 10 
> all the time).
> I first thought that it was a problem of CL because I seem to remember that I 
> read once that I had to use CL.One for reads and writes with counters. So I 
> tried with CL.One, without success...
> /*-------------------------------------------------- CODE 
> -------------------------------------------------------*/
> $servers = array("ec2-xxx-xxx-xxx-xxx.eu-west-1.compute.amazonaws.com",
>                "ec2-yyy-yyy-yyy-yyy.eu-west-1.compute.amazonaws.com",
>                "ec2-zzz-zzz-zzz-zzz.eu-west-1.compute.amazonaws.com",
>                "ec2-aaa-aaa-aaa-aaa.eu-west-1.compute.amazonaws.com",
>                "ec2-bbb-bbb-bbb-bbb.eu-west-1.compute.amazonaws.com");
> $pool = new ConnectionPool("mykeyspace", $servers);
> $stats_test = new ColumnFamily($pool, 'stats_test',
>                  $read_consistency_level=cassandra_ConsistencyLevel::ONE,
>                $write_consistency_level=cassandra_ConsistencyLevel::ONE);
>       
> $time = date( 'YmdH', time());
>                        
> for($i=0; $i<10; $i++){
>       for($c=1; $c<=3; $c++){
>               $stats_test->add($c, $time.':test');
>       }
>         $counts = $stats_test->multiget(array(1,2,3));
>       echo('Counter1: '.$counts[1][$time.':test']."\n");
>       echo('Counter2: '.$counts[2][$time.':test']."\n");
>       echo('Counter3: '.$counts[3][$time.':test']."\n\n");
> }
> /*-------------------------------- END OF CODE 
> -------------------------------------------------------------------------*/
> /*-------------------------------------------------- OUTPUT 
> ------------------------------------------------------------*/
> Counter1: 1
> Counter2: 1
> Counter3: 1
> Counter1: 2
> Counter2: 2
> Counter3: 2
> Counter1: 3
> Counter2: 3
> Counter3: 3
> Counter1: 3
> Counter2: 4
> Counter3: 4
> Counter1: 4
> Counter2: 5
> Counter3: 3
> Counter1: 5
> Counter2: 6
> Counter3: 3
> Counter1: 6
> Counter2: 7
> Counter3: 4
> Counter1: 4
> Counter2: 8
> Counter3: 7
> Counter1: 5
> Counter2: 9
> Counter3: 8
> Counter1: 8
> Counter2: 4
> Counter3: 9

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to