Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 38812 invoked from network); 7 Apr 2011 06:49:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Apr 2011 06:49:44 -0000 Received: (qmail 8488 invoked by uid 500); 7 Apr 2011 06:49:42 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 8421 invoked by uid 500); 7 Apr 2011 06:49: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 8413 invoked by uid 99); 7 Apr 2011 06:49:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 06:49:42 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ross.w.black@gmail.com designates 74.125.82.172 as permitted sender) Received: from [74.125.82.172] (HELO mail-wy0-f172.google.com) (74.125.82.172) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 06:49:35 +0000 Received: by wyb29 with SMTP id 29so2127024wyb.31 for ; Wed, 06 Apr 2011 23:49:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=nSPUT30nvtgCY6qpkcI0icM7BTFrmwToo5OpyRqKUno=; b=hkCxe6WQzREYrPQ7jKpeitQS6NgVCIceDJTizgoOQhCAE8cfpDDuJPd3dL3DOHa5ZH i4GcHxX3Gy84y5ur95D1GOZi8lgsrqI/xW4Er+8fIjct8MnDeNdDfEQ+Zs6Dgememej9 zjzP2yVfEa8oVrI9LZGXsog8HoDxzKY9ZwqIY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=H/FvlPZeh3KHIEObEO3X430Z7RxtPQaWSEZ09PwGX0UFLuGlUZfgt99yjCV225FO6m B9hrJN1KI2X9fwbUdfxNFMZNTz67Q/nGUMNISpGxIrb/w9CnpaBar4c7IKhFT7wvbV66 RAZZb01IE37jqfsmWMZ4uciJaocaGIlkb3i9E= MIME-Version: 1.0 Received: by 10.227.196.208 with SMTP id eh16mr468188wbb.224.1302158954218; Wed, 06 Apr 2011 23:49:14 -0700 (PDT) Received: by 10.227.128.9 with HTTP; Wed, 6 Apr 2011 23:49:14 -0700 (PDT) Date: Thu, 7 Apr 2011 16:49:14 +1000 Message-ID: Subject: problem with large batch mutation set From: Ross Black To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=20cf30025926e8464c04a04e8160 --20cf30025926e8464c04a04e8160 Content-Type: text/plain; charset=ISO-8859-1 Hi, I am using the thrift client batch_mutate method with Cassandra 0.7.0 on Ubuntu 10.10. When the size of the mutations gets too large, the client fails with the following exception: Caused by: org.apache.thrift.transport.TTransportException: java.net.SocketException: Connection reset at org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:147) at org.apache.thrift.transport.TFramedTransport.flush(TFramedTransport.java:157) at org.apache.cassandra.thrift.Cassandra$Client.send_batch_mutate(Cassandra.java:901) at org.apache.cassandra.thrift.Cassandra$Client.batch_mutate(Cassandra.java:889) at com.cxense.cxad.core.persistence.cassandra.store.BatchMutationTask.apply(BatchMutationTask.java:78) at com.cxense.cxad.core.persistence.cassandra.store.BatchMutationTask.apply(BatchMutationTask.java:30) at com.cxense.cassandra.conn.DefaultCassandraConnectionTemplate.execute(DefaultCassandraConnectionTemplate.java:316) at com.cxense.cassandra.conn.DefaultCassandraConnectionTemplate.execute(DefaultCassandraConnectionTemplate.java:257) at com.cxense.cxad.core.persistence.cassandra.store.AbstractCassandraStore.writeMutations(AbstractCassandraStore.java:492) ... 39 more Caused by: java.net.SocketException: Connection reset at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:96) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.BufferedOutputStream.write(BufferedOutputStream.java:105) at org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:145) ... 47 more It took a while for me to discover that this obscure error message was as a result of the thrift message exceeding the maximum frame size specified for the Cassandra server. (default 15MB) [Using TFastFramedTransport with a max frame size of 15728640 bytes.] The poor error message looks like a bug in Thrift server code that assumes that any transport exception is a connection failure which should drop the connection. * *My main problem is how to ensure that this does not occur again in running code. I could configure the server with a larger frame size, but this size is effectively arbitrary so there is no guarantee in our code would stop a very large mutation being sent occasionally. My current work-around is to break the mutation list into multiple parts, but to do this correctly I need to track the size of each mutation which is fairly messy. * Is there some way to configure Thrift or Cassandra to deal with messages that are larger than the max frame size (at either client or server) ?* Thanks, Ross --20cf30025926e8464c04a04e8160 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

I am using the thrift client batch_mutate method with Cassandra = 0.7.0=A0 on Ubuntu 10.10.

When the size of the mutations gets too la= rge, the client fails with the following exception:

Caused by: org.a= pache.thrift.transport.TTransportException: java.net.SocketException: Conne= ction reset
=A0=A0=A0 at org.apache.thrift.transport.TIOStreamTransport.write(TIOStream= Transport.java:147)
=A0=A0=A0 at org.apache.thrift.transport.TFramedTran= sport.flush(TFramedTransport.java:157)
=A0=A0=A0 at org.apache.cassandra= .thrift.Cassandra$Client.send_batch_mutate(Cassandra.java:901)
=A0=A0=A0 at org.apache.cassandra.thrift.Cassandra$Client.batch_mutate(Cass= andra.java:889)
=A0=A0=A0 at com.cxense.cxad.core.persistence.cassandra.= store.BatchMutationTask.apply(BatchMutationTask.java:78)
=A0=A0=A0 at co= m.cxense.cxad.core.persistence.cassandra.store.BatchMutationTask.apply(Batc= hMutationTask.java:30)
=A0=A0=A0 at com.cxense.cassandra.conn.DefaultCassandraConnectionTemplate.e= xecute(DefaultCassandraConnectionTemplate.java:316)
=A0=A0=A0 at com.cxe= nse.cassandra.conn.DefaultCassandraConnectionTemplate.execute(DefaultCassan= draConnectionTemplate.java:257)
=A0=A0=A0 at com.cxense.cxad.core.persistence.cassandra.store.AbstractCassa= ndraStore.writeMutations(AbstractCassandraStore.java:492)
=A0=A0=A0 ... = 39 more
Caused by: java.net.SocketException: Connection reset
=A0=A0= =A0 at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:96)<= br> =A0=A0=A0 at java.net.SocketOutputStream.write(SocketOutputStream.java:136)=
=A0=A0=A0 at java.io.BufferedOutputStream.write(BufferedOutputStream.ja= va:105)
=A0=A0=A0 at org.apache.thrift.transport.TIOStreamTransport.writ= e(TIOStreamTransport.java:145)
=A0=A0=A0 ... 47 more


It took a while for me to discover that th= is obscure error message was as a result of the thrift message exceeding th= e maximum frame size specified for the Cassandra server. (default 15MB)
= [Using TFastFramedTransport with a max frame size of 15728640 bytes.]

The poor error message looks like a bug in Thrift server code that assu= mes that any transport exception is a connection failure which should drop = the connection.


My main problem is how to ensure that thi= s does not occur again in running code.
I could configure the server with a larger frame size, but this size is eff= ectively arbitrary so there is no guarantee in our code would stop a very l= arge mutation being sent occasionally.
My current work-around is to brea= k the mutation list into multiple parts, but to do this correctly I need to= track the size of each mutation which is fairly messy.

Is there some way to configure Thrift or Cassandra to deal with mess= ages that are larger than the max frame size (at either client or server) ?=



Thanks,
Ross

--20cf30025926e8464c04a04e8160--