Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9E70B7A2A for ; Wed, 9 Nov 2011 16:20:15 +0000 (UTC) Received: (qmail 49387 invoked by uid 500); 9 Nov 2011 16:20:15 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 49362 invoked by uid 500); 9 Nov 2011 16:20:15 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 49354 invoked by uid 99); 9 Nov 2011 16:20:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Nov 2011 16:20:15 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Nov 2011 16:20:11 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 8A60C44F6A for ; Wed, 9 Nov 2011 16:19:51 +0000 (UTC) Date: Wed, 9 Nov 2011 16:19:51 +0000 (UTC) From: "Alain RODRIGUEZ (Commented) (JIRA)" To: commits@cassandra.apache.org Message-ID: <899935688.14722.1320855591568.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1939764810.7506.1320691971677.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CASSANDRA-3465) Wrong counters values when RF > 1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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