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 B4FB8102F3 for ; Mon, 22 Jul 2013 07:25:40 +0000 (UTC) Received: (qmail 17396 invoked by uid 500); 22 Jul 2013 07:25:38 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 17324 invoked by uid 500); 22 Jul 2013 07:25:37 -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 17312 invoked by uid 99); 22 Jul 2013 07:25:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jul 2013 07:25:36 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of soumava@utexas.edu designates 209.85.128.44 as permitted sender) Received: from [209.85.128.44] (HELO mail-qe0-f44.google.com) (209.85.128.44) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jul 2013 07:25:30 +0000 Received: by mail-qe0-f44.google.com with SMTP id 5so3612343qeb.3 for ; Mon, 22 Jul 2013 00:25:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :x-gm-message-state; bh=2gWru1t58TxnppWzYy0KRmYFP0bs8c5NZIYdJIP88dw=; b=Yn0U8N6IVWbsUK+LSlARk713sVFpI20Dpau6MPo6I0JWSn4LHFmaS39nF5m2Itn38x ax0Q0chq4VvGxOucEcJJkz0Uh9DmiObrs6N7/BPSbk4D4FdYOp74hm14ASiuzeFPbq7B MZ3YsP5qxHfoOSIOjIK0MRQ+y5KdbeltTJouCcCETkMRY/Z34J+PL1ZVoNZrLU7NSRkk SgvddKOSvInHp2j/lqNGBwqNkj/mgI8axvKEALOi1sgTgSDxvR0Kiwy1Dc3XI6zrsLl/ J9O0uoCNv5hoA56whpYu1NGBWqf6FVzGeOSc8c4At8sfCHTa4lPHcpWALJxtEZwp44lq lNMQ== X-Received: by 10.224.60.70 with SMTP id o6mr31836381qah.89.1374477908556; Mon, 22 Jul 2013 00:25:08 -0700 (PDT) MIME-Version: 1.0 Sender: soumava@utexas.edu Received: by 10.49.105.168 with HTTP; Mon, 22 Jul 2013 00:24:48 -0700 (PDT) In-Reply-To: References: From: Soumava Ghosh Date: Mon, 22 Jul 2013 00:24:48 -0700 X-Google-Sender-Auth: DRHpK1D61dwi9JdlGWGOtppO3jI Message-ID: Subject: Re: Cassandra 2.0 - AssertionError in ArrayBackedSortedColumns To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=001a1133d3c47deccc04e2149309 X-Gm-Message-State: ALoCoQn1hQ8bLD3/96Ce9vxe+wo9oQPMfZzq5E1Kduxs3usMvA0ZsaOkVkLiA9qde11QNMiEsM+U X-Virus-Checked: Checked by ClamAV on apache.org --001a1133d3c47deccc04e2149309 Content-Type: text/plain; charset=ISO-8859-1 Thanks for the reply Sylvain! A couple of follow-up questions: i. The second stack in my mail originated at a getRow() call. What could be the cause of that? I am assuming data retrieval should not cause any issues, unless data was stored in incorrect order and I don't know if that is possible through the API.. ii. I am also seeing some sporadic cases where a single column cas() update is hitting this same issue (the bug you mentioned) as multiple columns, do you see any reason for that happening? I am yet to investigate this though. Thank you, Soumava On Mon, Jul 22, 2013 at 12:11 AM, Sylvain Lebresne wrote: > This is a bug really: https://issues.apache.org/jira/browse/CASSANDRA-5786 > . > > This should get fixed in the next beta of 2.0, but if you really want to > test CAS updates in the meantime, you'll have to provide the columns in > (column family comparator) sorted order to the thrift cas() method. > > -- > Sylvain > > > On Sun, Jul 21, 2013 at 1:22 PM, Soumava Ghosh wrote: > >> Hi, >> >> I'm taking a look at the Check and Set functionalities provided by the >> cas() API provided by cassandra 2.0 (the code available on git). I'm >> running a few tests on a small sized cluster (replication factor 3, >> consistency level quorum) with a few clients. I've observed a lot of cases >> seem to hit the TimedOutException while paxos is in progress. On inspection >> of the server side logs the following stack was seen: >> >> ERROR [Thread-582] 2013-07-21 01:17:46,169 CassandraDaemon.java (line >> 196) Exception in thread Thread[Thread-582,5,main] >> java.lang.AssertionError: Added column does not sort as the last column >> at >> org.apache.cassandra.db.ArrayBackedSortedColumns.addColumn(ArrayBackedSortedColumns.java:115) >> at >> org.apache.cassandra.db.ColumnFamily.addColumn(ColumnFamily.java:117) >> at >> org.apache.cassandra.db.ColumnFamilySerializer.deserialize(ColumnFamilySerializer.java:119) >> at >> org.apache.cassandra.db.ColumnFamilySerializer.deserialize(ColumnFamilySerializer.java:96) >> at >> org.apache.cassandra.db.ColumnFamilySerializer.deserialize(ColumnFamilySerializer.java:91) >> at >> org.apache.cassandra.service.paxos.Commit$CommitSerializer.deserialize(Commit.java:139) >> at >> org.apache.cassandra.service.paxos.Commit$CommitSerializer.deserialize(Commit.java:128) >> at org.apache.cassandra.net.MessageIn.read(MessageIn.java:99) >> at >> org.apache.cassandra.net.IncomingTcpConnection.receiveMessage(IncomingTcpConnection.java:175) >> at >> org.apache.cassandra.net.IncomingTcpConnection.handleModernVersion(IncomingTcpConnection.java:135) >> at >> org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:82) >> >> I was updating multiple columns using the same cas() call, and looking at >> the assert (code below) I added code to sort them before sending. >> However, now I'm seeing the same issue *even with single column* cas() >> calls. >> >> int c = internalComparator().compare(columns.get(getColumnCount() >> - 1).name(), column.name()); >> // note that we want an assertion here (see addColumn javadoc), >> but we also want that if >> // assertion are disabled, addColumn works correctly with >> unsorted input >> assert c <= 0 : "Added column does not sort as the " + (reversed >> ? "first" : "last") + " column"; >> >> I have also seen this error occur in the getRow() path, as below: >> >> java.lang.AssertionError: Added column does not sort as the last column >> at >> org.apache.cassandra.db.ArrayBackedSortedColumns.addColumn(ArrayBackedSortedColumns.java:115) >> at >> org.apache.cassandra.db.ColumnFamily.addColumn(ColumnFamily.java:117) >> at >> org.apache.cassandra.db.ColumnFamily.addAtom(ColumnFamily.java:151) >> at >> org.apache.cassandra.db.CollationController.collectTimeOrderedData(CollationController.java:95) >> at >> org.apache.cassandra.db.CollationController.getTopLevelColumns(CollationController.java:57) >> at >> org.apache.cassandra.db.ColumnFamilyStore.getTopLevelColumns(ColumnFamilyStore.java:1452) >> at >> org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilyStore.java:1281) >> at >> org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilyStore.java:1195) >> at org.apache.cassandra.db.Table.getRow(Table.java:331) >> at >> org.apache.cassandra.db.SliceByNamesReadCommand.getRow(SliceByNamesReadCommand.java:55) >> at >> org.apache.cassandra.service.StorageProxy$LocalReadRunnable.runMayThrow(StorageProxy.java:1288) >> at >> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:1813) >> at >> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) >> at java.lang.Thread.run(Thread.java:722) >> >> Could someone provide me a little more clarity about what the context of >> the error is and what the client needs to do to fix it? I understand that >> running with assertions disabled would do away with this error, but i'd >> like to know if there is a proper way to fix this. Moreover, what could >> possibly be going wrong in the get path that is hitting this issue? >> >> Some guidance, on the fact that whether it is expected that the client >> sort the columns before calling the API with multiple columns, would be >> really appreciated. >> >> Thanks, >> Soumava >> > > --001a1133d3c47deccc04e2149309 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks for the reply Sylvain! A couple of follow-up questi= ons:

i. The second stack in my mail originated at = a getRow() call. What could be the cause of that? I am assuming data retrie= val should not cause any issues, unless data was stored in incorrect order = and I don't know if that is possible through the API..

ii. I am also seeing some sporadic cases wh= ere a single column cas() update is hitting this same issue (the bug you me= ntioned) as multiple columns, do you see any reason for that happening? I a= m yet to investigate this though.

Thank you,
Soumava


On Mon, Ju= l 22, 2013 at 12:11 AM, Sylvain Lebresne <sylvain@datastax.com><= /span> wrote:
This is a bug really:=A0https://issues.apache.org/jira/browse/CASSANDRA-5786.

This should get fixed in the next beta of 2.0, but if you re= ally want to test CAS updates in the meantime, you'll have to provide t= he columns in (column family comparator) sorted order to the thrift cas() m= ethod.

--
Sylvain
<= div class=3D"h5">


On Sun, Jul 21, 2013 at 1:22 PM, Soumava Ghosh <soumava@cs.utexas.= edu> wrote:
Hi,

I= 9;m taking a look at the Check and Set functionalities provided by the cas(= ) API provided by cassandra 2.0 (the code available on git). I'm runnin= g a few tests on a small sized cluster (replication factor 3, consistency l= evel quorum) with a few clients. I've observed a lot of cases seem to h= it the TimedOutException while paxos is in progress. On inspection of the s= erver side logs the following stack was seen:

ERROR [Thread-582] 2013-07-21 01:17:46,169 Cassand= raDaemon.java (line 196) Exception in thread Thread[Thread-582,5,main]
java.lang.AssertionError: Added column does not sort as the last colu= mn
=A0 =A0 =A0 =A0 at org.apache.cassandra.db.ArrayBackedSortedColumns.ad= dColumn(ArrayBackedSortedColumns.java:115)
=A0 =A0 =A0 =A0 at org= .apache.cassandra.db.ColumnFamily.addColumn(ColumnFamily.java:117)
=A0 =A0 =A0 =A0 at org.apache.cassandra.db.ColumnFamilySerializer.deseria= lize(ColumnFamilySerializer.java:119)
=A0 =A0 =A0 =A0 at org.apache.cassandra.db.ColumnFamilySerializer.dese= rialize(ColumnFamilySerializer.java:96)
=A0 =A0 =A0 =A0 at org.ap= ache.cassandra.db.ColumnFamilySerializer.deserialize(ColumnFamilySerializer= .java:91)
=A0 =A0 =A0 =A0 at org.apache.cassandra.service.paxos.Commit$CommitSer= ializer.deserialize(Commit.java:139)
=A0 =A0 =A0 =A0 at org.apach= e.cassandra.service.paxos.Commit$CommitSerializer.deserialize(Commit.java:1= 28)
=A0 =A0 =A0 =A0 at org.apache.cassandra.net.MessageIn.read(MessageIn.java:9= 9)
=A0 =A0 =A0 =A0 at org.apache.cassandra.net.IncomingTcpConnect= ion.receiveMessage(IncomingTcpConnection.java:175)
=A0 =A0 =A0 = =A0 at org.apache.cassandra.net.IncomingTcpConnection.handleModernVersion(I= ncomingTcpConnection.java:135)
=A0 =A0 =A0 =A0 at org.apache.cassandra.net.IncomingTcpConnection.run(= IncomingTcpConnection.java:82)

I was updating mult= iple columns using the same cas() call, and looking at the assert (code bel= ow) I added code to sort them before sending.=A0
However, now I'm seeing the same issue even=A0with=A0single col= umn cas() calls.=A0

=A0 =A0 =A0 =A0 int c =3D internalComparator().compare(col= umns.get(getColumnCount() - 1).name(), column.name());
=A0 =A0 =A0 = =A0 // note that we want an assertion here (see addColumn javadoc), but we = also want that if
=A0 =A0 =A0 =A0 // assertion are disabled, addColumn works = correctly with unsorted input
=A0 =A0 =A0 =A0 assert c <=3D= 0 : "Added column does not sort as the " + (reversed ? "fir= st" : "last") + " column";

I have also s= een this error occur in the getRow() path, as below:

java.lang.AssertionError: Added column does not so= rt as the last column
=A0 =A0 =A0 = =A0 at org.apache.cassandra.db.ArrayBackedSortedColumns.addColumn(ArrayBack= edSortedColumns.java:115)
=A0 =A0 = =A0 =A0 at org.apache.cassandra.db.ColumnFamily.addColumn(ColumnFamily.java= :117)
=A0 =A0 =A0 = =A0 at org.apache.cassandra.db.ColumnFamily.addAtom(ColumnFamily.java:151)<= /span>
=A0 =A0 =A0 =A0 at org.apache.cass= andra.db.CollationController.collectTimeOrderedData(CollationController.jav= a:95)
=A0 =A0 =A0 = =A0 at org.apache.cassandra.db.CollationController.getTopLevelColumns(Colla= tionController.java:57)<= br>=A0 =A0 = =A0 =A0 at org.apache.cassandra.db.ColumnFamilyStore.getTopLevelColumns(Col= umnFamilyStore.java:1452)
=A0 =A0 =A0 = =A0 at org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFami= lyStore.java:1281)
=A0 =A0 =A0 =A0= at org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilyS= tore.java:1195)
=A0 =A0 =A0 = =A0 at org.apache.cassandra.db.Table.getRow(Table.java:331)
=A0 =A0 =A0 =A0 at org.apache.cassandra.db.SliceB= yNamesReadCommand.getRow(SliceByNamesReadCommand.java:55)
=A0 =A0 =A0 = =A0 at org.apache.cassandra.service.StorageProxy$LocalReadRunnable.runMayTh= row(StorageProxy.java:1288)
=A0 = =A0 =A0 =A0 at org.apache.cassandra.service.StorageProxy$DroppableRunnable.= run(StorageProxy.java:1813)
=A0 =A0 =A0 = =A0 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor= .java:1145)
=A0 =A0 =A0 =A0 at jav= a.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615= )

=A0 =A0 =A0 = =A0 at java.lang.Thread.run(Thread.java:722)

Could someone prov= ide me a little more clarity about what the context of the error is and wha= t the client needs to do to fix it? I understand that running with assertio= ns disabled would do away with this error, but i'd like to know if ther= e is a proper way to fix this. Moreover, what could possibly be going wrong= in the get path that is hitting this issue?

Some guidance, on the fact that whether it is exp= ected that the client sort the columns before calling the API with multiple= columns, would be really appreciated.

Thanks,
Soumava


--001a1133d3c47deccc04e2149309--