Return-Path: X-Original-To: apmail-cassandra-dev-archive@www.apache.org Delivered-To: apmail-cassandra-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 05E21102CF for ; Fri, 6 Dec 2013 06:38:21 +0000 (UTC) Received: (qmail 92848 invoked by uid 500); 6 Dec 2013 03:48:16 -0000 Delivered-To: apmail-cassandra-dev-archive@cassandra.apache.org Received: (qmail 92823 invoked by uid 500); 6 Dec 2013 03:48:09 -0000 Mailing-List: contact dev-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 dev@cassandra.apache.org Received: (qmail 92800 invoked by uid 99); 6 Dec 2013 03:48:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Dec 2013 03:48:05 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jbellis@gmail.com designates 209.85.212.170 as permitted sender) Received: from [209.85.212.170] (HELO mail-wi0-f170.google.com) (209.85.212.170) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Dec 2013 03:48:01 +0000 Received: by mail-wi0-f170.google.com with SMTP id hq4so429750wib.5 for ; Thu, 05 Dec 2013 19:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=P5JSz/3kvj83dpq7sxvm0Q+JJfModNi6MrF63+R/by4=; b=zNJkatiZMJ2ZeV2kNCm8Mn4m1NIRnNkIC/hUe4AxP6gmFU6UhGRsY53iYV/bpoUhZO bdNtuWwWX7yX1cNQugrZE24IVurtwHFs2KKdJAaWbbuSl1GD3pa9tCOzhf36Juqi00qL qmDTuE9CIpoxsxPjzCN9+FttxeG4Abj3nhuxI8DWtFqThBf1vUybIOO4btDueWOaFTLX n1Afm2upvW32sEsJR6SUSzgh1VPxbS/m289+WxOTpBaWTT7rsF9cdsQ/Id7b/+MWSLWC h3l2qzkzBLLqYajoO08a2SS7ofhvGIfXqfF86/VS5j/l+jU2yp7GuXbOyw44JrGe9WQQ mYmw== X-Received: by 10.194.84.72 with SMTP id w8mr19992212wjy.55.1386301660261; Thu, 05 Dec 2013 19:47:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.97.12 with HTTP; Thu, 5 Dec 2013 19:47:20 -0800 (PST) In-Reply-To: <529E9495.4050506@gmail.com> References: <529E9495.4050506@gmail.com> From: Jonathan Ellis Date: Thu, 5 Dec 2013 21:47:20 -0600 Message-ID: Subject: Re: lightweight transaction timeout To: dev Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Does turning tracing on shed any light? On Tue, Dec 3, 2013 at 8:33 PM, Jim Xu wrote: > Hi all, > > I use two threads to test lightweight transaction. Each thread execute > "insert into test_table(column1,column2) values (i, thread_id) if not > exists" N times, and "i" is in the range of 0~N. If N is a small number, > it is ok,some row are inserted by thread 1 and other rows are inserted > by thread 2; if N is a big number, I will get > TimedoutException(acknowledged_by:1, paxos_in_progress:true) and have > the following two different results: > > 1) only one thread throws the exception, and this thread successfully > inserts the value; > 2) both the two threads throw the exception, and no value is inserted > into the table. > > I except that some rows in test_table are inserted by thread 1 and others > inserted by thread 2. If one thread inserts a row which has be in the > table, > the row will not be modified and the thread will continue to insert the > next row. > > I think that is lightweight transaction's function, but why I get the > exception and how to avoid it. > I try to enlarge cas_contention_timeout_in_ms in cassandra.yaml, but it > does not work. > > my cassandra version is 2.0.3, and the cluster has two nodes with > keypsace's replication_factor is 2. > > Best Regards > Jim Xu -- Jonathan Ellis Project Chair, Apache Cassandra co-founder, http://www.datastax.com @spyced