Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 3374 invoked from network); 8 Sep 2010 02:06:55 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Sep 2010 02:06:55 -0000 Received: (qmail 33621 invoked by uid 500); 8 Sep 2010 02:06:53 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 33575 invoked by uid 500); 8 Sep 2010 02:06:53 -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 33567 invoked by uid 99); 8 Sep 2010 02:06:52 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Sep 2010 02:06:52 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jbellis@gmail.com designates 209.85.212.44 as permitted sender) Received: from [209.85.212.44] (HELO mail-vw0-f44.google.com) (209.85.212.44) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Sep 2010 02:06:30 +0000 Received: by vws10 with SMTP id 10so5313214vws.31 for ; Tue, 07 Sep 2010 19:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=tUyLoNje/JOmNKHQZk2NHrpkQ1vmeoEkg3jyguGNk2g=; b=LhXtPG3oP6p3eI4RS/h3bQ22jbVS3oWaGg1v9JpG2cZbXPEFRK+SDt7kndVRhQmIif IS+ok0eeWST0OVAoKUhZClh678eZuPtbVX0RggJQYQxypvXGfYCVrlDcJWXhlbCRnGCs m24QwJ90IEe2tokPFf9E3Cqw2bkHWw9B/voUU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=WWReY77u8nFgZChS7tmPm6i3ySYUuvWmCD1XYa9Mnvuw2qguzGTmOYsmwOfvwTqMdR chpAwORZ3P2qGJ1RUvq+uKMYC0smtDtzfAmSh8VajtIkACMxDniYHr9GUpAQ956NotDL UnOa1eUjKCWa4I0RsnWvSYkVJbwX9rawT/JIY= Received: by 10.220.128.198 with SMTP id l6mr594414vcs.219.1283911569395; Tue, 07 Sep 2010 19:06:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.182.193 with HTTP; Tue, 7 Sep 2010 19:05:48 -0700 (PDT) In-Reply-To: References: From: Jonathan Ellis Date: Tue, 7 Sep 2010 21:05:48 -0500 Message-ID: Subject: Re: batch_mutate silently failing in Cassandra To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org QUORUM of ReplicationFactor=3D1 is 1. All consistency levels should work fine as long as RF <=3D node count. If you are seeing it work at CL.ONE but not at QUORUM then that is probably a bug. On Tue, Sep 7, 2010 at 7:36 PM, Lucas Nodine wrote: > Partially Resolved... > > Taking your advise (both Jonathan and Aaron's) I was able to track the > problem down.=A0 The issue was that running insert (also batch_mutate) an= d > using a consistencylevel of quorum on a cluster of=A01 server with a > replication factor of 1 does not work.=A0 Well, that is not accurate, let= me > explain.=A0 I believe the problem lies in the description of QUORUM as de= fined > in the API on the wiki "Ensure that the write has been written to N=A0/= =A02=A0+=A01 > replicas before responding to the client." > > 1/2+1 =3D 1.5 -- One server can never accomplish this.=A0 I believe I rea= d > something about this somewhere in all the documentation, but it would be > really handy to have received an error telling me that it was impossible > (assuming this was actually the issue).=A0 I am by far, not familiar with= the > replication model, but if it is not by design, someone let me know and I'= ll > report it. > > Thx, > > - LN > > On Tue, Sep 7, 2010 at 3:00 PM, Lucas Nodine wrot= e: >> >> Jonathan, >> >> I have done it successfully with insert, but I have not tried it with >> mutate.=A0 I'll give that a try tonight. >> >> Thanks >> On Tue, Sep 7, 2010 at 2:54 PM, Jonathan Ellis wrote= : >>> >>> I would try to get a single hard-coded column to insert, before doing >>> something more complex. >>> >>> You can also enable debug logging on the server and see if that >>> matches what you want the client to be doing. >>> >>> On Tue, Sep 7, 2010 at 9:11 AM, Lucas Nodine >>> wrote: >>> > Hello all, >>> > >>> > I have=A0posted the following to Stackoverflow, but thought that I wo= uld >>> > also >>> > try the list.=A0 If you have any suggestions, please let me know >>> > >>> > I am working with Cassandra 0.6.5 using the thrift interface. I am >>> > trying to >>> > use the batch_mutate method call, however, when I execute it, I recei= ve >>> > no >>> > error message. This leads me to believe it worked. When I check using >>> > the >>> > CLI, there is nothing there. Is there something wrong with my code or >>> > format >>> > of the mutation_map that anyone can see? Any ideas? >>> > >>> > Thanks in advance, >>> > >>> > LN >>> > >>> > public void Update(string keyspace, Common.NetworkPackage.MetaAsset m= a) >>> > { >>> > =A0 Dictionary>> package; >>> > =A0 Dictionary> packageEntry; >>> > =A0 Dictionary.Enumerator en; >>> > =A0 List mutList; >>> > =A0 Mutation mut; >>> > =A0 DateTime now =3D DateTime.Now; >>> > >>> > =A0 if(!ma.Fields.ContainsKey("$guid")) >>> > =A0 =A0 throw new ArgumentException("The field $guid is not present")= ; >>> > >>> > =A0 mutList =3D new List(); >>> > =A0 en =3D ma.Fields.GetEnumerator(); >>> > >>> > =A0 while(en.MoveNext()) >>> > =A0 { >>> > =A0 =A0 if (en.Current.Value =3D=3D null) >>> > =A0 =A0 =A0 continue; >>> > =A0 =A0 mut =3D new Mutation(); >>> > =A0 =A0 mut.Column_or_supercolumn =3D new ColumnOrSuperColumn(); >>> > =A0 =A0 mut.Column_or_supercolumn.Column =3D new Column(); >>> > =A0 =A0 mut.Column_or_supercolumn.Column.Name =3D >>> > _utf8.GetBytes(en.Current.Key); >>> > >>> > =A0 =A0 if (en.Current.Value =3D=3D null) >>> > =A0 =A0 =A0 mut.Column_or_supercolumn.Column.Value =3D null; >>> > =A0 =A0 else >>> > =A0 =A0 =A0 mut.Column_or_supercolumn.Column.Value =3D >>> > ToBytes(en.Current.Value); >>> > >>> > =A0 =A0 mut.Column_or_supercolumn.Column.Timestamp =3D >>> > Utilities.Timestamp(now); >>> > >>> > =A0 =A0 mutList.Add(mut); >>> > =A0 } >>> > >>> > =A0 packageEntry =3D new Dictionary>(); >>> > =A0 packageEntry.Add("MetaAsset", mutList); >>> > >>> > =A0 package =3D new Dictionary>> > List>>(); >>> > =A0 package.Add((string)ma.Fields["$guid"], packageEntry); >>> > >>> > =A0 Console.WriteLine(Utilities.ExportBulkMutate("LawOffice", package= )); >>> > >>> > =A0 _client.batch_mutate(keyspace, package, ConsistencyLevel.QUORUM); >>> > } >>> > >>> > The above code produces (columns are name:value @ timestamp, value >>> > consists >>> > of a type:and a representation of the actual value): >>> > >>> > LawOffice : { >>> > =A0Row=3D08469fba50f448be8943614abd059d10 : { >>> > =A0 =A0CF=3DMetaAsset : { >>> > =A0 =A0 $guid : String:08469fba50f448be8943614abd059d10 @ 93 >>> > =A0 =A0 $creator : String:Lucas @ 93 >>> > =A0 =A0 $previousversion : String:00000000000000000000000000000000 @ = 93 >>> > =A0 =A0 $nextversion : String:00000000000000000000000000000000 @ 93 >>> > =A0 =A0 $etag : String:0 @ 93 >>> > =A0 =A0 $length : Int32:123456789 @ 93 >>> > =A0 =A0 $extension : String:.odt @ 93 >>> > =A0 =A0 $created : DateTime:90 @ 93 >>> > =A0 =A0 $modified : DateTime:90 @ 93 >>> > =A0 =A0 $lastaccess : DateTime:90 @ 93 >>> > =A0 =A0 $title : String:Title @ 93 >>> > =A0 =A0 $tags : List`1:tag1,tag2,tag3 @ 93 >>> > =A0 =A0} >>> > =A0} >>> > } >>> > >>> > >>> >>> >>> >>> -- >>> Jonathan Ellis >>> Project Chair, Apache Cassandra >>> co-founder of Riptano, the source for professional Cassandra support >>> http://riptano.com > --=20 Jonathan Ellis Project Chair, Apache Cassandra co-founder of Riptano, the source for professional Cassandra support http://riptano.com