Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5ACC877BB for ; Mon, 29 Aug 2011 21:03:45 +0000 (UTC) Received: (qmail 7625 invoked by uid 500); 29 Aug 2011 21:03:43 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 7528 invoked by uid 500); 29 Aug 2011 21:03:42 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 7515 invoked by uid 99); 29 Aug 2011 21:03:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Aug 2011 21:03:42 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jiangc@gmail.com designates 209.85.220.172 as permitted sender) Received: from [209.85.220.172] (HELO mail-vx0-f172.google.com) (209.85.220.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Aug 2011 21:03:35 +0000 Received: by vxi29 with SMTP id 29so5787743vxi.31 for ; Mon, 29 Aug 2011 14:03:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=fR34Y0r5pd/VF6ixaL/ySFoMYqp2ofqh2sTjmBUDznY=; b=heaPLg8HlN5sfjXxNGKn+Y3xiB50pTudKeOHmF4YWKdYvfX9ThjSzgporbWYocX/7W b4Rx7gKsU62fGeTIglMLETXSfDNDlcfUHNY9yelHULhi1yaZsVPkEw+YUZhMIY0g5v2G +By0XqJgPk3LmUV/YSTnuizM3LjYoEEUmMCtY= MIME-Version: 1.0 Received: by 10.52.21.139 with SMTP id v11mr3364243vde.329.1314651794232; Mon, 29 Aug 2011 14:03:14 -0700 (PDT) Received: by 10.52.115.228 with HTTP; Mon, 29 Aug 2011 14:03:14 -0700 (PDT) Date: Mon, 29 Aug 2011 17:03:14 -0400 Message-ID: Subject: Updates lost From: Jiang Chen To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi, Just started developing using Cassandra (0.8.4). I noticed when updating the same row and column repeatedly, say, in a test case, updates may get lost. I found it in a Java client but the following python script also exhibits the same problem. ****************************************************************** import pycassa import time pool = pycassa.ConnectionPool('TestKeySpace', server_list=['localhost']) cf = pycassa.ColumnFamily(pool, 'blah') for i in range(1, 1000): cf.insert('foo', {'body': 'aaa'}) assert 'aaa'==cf.get('foo')['body'] cf.insert('foo', {'body': 'bbb'}) assert 'bbb'==cf.get('foo')['body'] #time.sleep(0.015) print i ****************************************************************** The script errors out at assertion, when the value is supposed to be updated back to 'aaa' from 'bbb' ****************************************************************** $ python test.py 1 Traceback (most recent call last): File "test.py", line 10, in assert 'aaa'==cf.get('foo')['body'] AssertionError ****************************************************************** If the client sleeps for a few ms at each loop, the success rate increases. At 15 ms, the script always succeeds so far. Interestingly, the problem seems to be sensitive to alphabetical order. Updating the value from 'aaa' to 'bbb' never has problem. No pause needed. Is this a real problem or I'm missing something about how Cassandra works? Only one Cassandra instance is used in the test. Thanks. Jiang