Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0836F6045 for ; Mon, 30 May 2011 11:09:29 +0000 (UTC) Received: (qmail 43928 invoked by uid 500); 30 May 2011 11:09:28 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 43903 invoked by uid 500); 30 May 2011 11:09:28 -0000 Mailing-List: contact commits-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 commits@cassandra.apache.org Received: (qmail 43895 invoked by uid 99); 30 May 2011 11:09:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 May 2011 11:09:28 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 May 2011 11:09:27 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 63202E909D for ; Mon, 30 May 2011 11:08:47 +0000 (UTC) Date: Mon, 30 May 2011 11:08:47 +0000 (UTC) From: "Sylvain Lebresne (JIRA)" To: commits@cassandra.apache.org Message-ID: <1055805925.53207.1306753727402.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <240968556.13063.1305385427382.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (CASSANDRA-2653) index scan errors out when zero columns are requested MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-2653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sylvain Lebresne updated CASSANDRA-2653: ---------------------------------------- Attachment: 0001-Reset-SSTII-in-EchoedRow-constructor.patch This is indeed compaction related (but not related to secondary indexing at all). The problem is that compaction may lose some rows. Because of the way the ReducingIterator works, when we create a new {Pre|Lazy|Echoed}CompactedRow, we have already decoded the next row key and the file pointer if after that next row key. Both PreCompactedRow and LazyCompactedRow handle this correctly by "resetting" their SSTableIdentityIterator before reading (SSTII.getColumnFamilyWithColumns() does it for PreCompactedRow and LazilyCompactedRow calls SSTII.reset() directly). But EchoedRow doesn't handle this correctly. Hence when EchoedRow.isEmpty() is called, it will call SSTII.hasNext(), that will compare the current file pointer to the finishedAt value of the iterator. The pointer being on the next row, this test will always fail and the row will be skipped. Attaching a patch against 0.8 with a (smaller) unit test. Note that luckily this doesn't affect 0.7, because it only uses EchoedRow for cleanup compactions and clean compactions does not use ReducingIterator (and thus, the underlying SSTII won't have changed when the EchoedRow is built). I would still be in favor of committing the patch there too, just to make sure we don't hit this later. > index scan errors out when zero columns are requested > ----------------------------------------------------- > > Key: CASSANDRA-2653 > URL: https://issues.apache.org/jira/browse/CASSANDRA-2653 > Project: Cassandra > Issue Type: Bug > Components: Core > Affects Versions: 0.8.0 beta 2 > Reporter: Jonathan Ellis > Assignee: Sylvain Lebresne > Priority: Minor > Fix For: 0.7.7 > > Attachments: 0001-Reset-SSTII-in-EchoedRow-constructor.patch, v1-0001-CASSANDRA-2653-reproduce-regression.txt > > > As reported by Tyler Hobbs as an addendum to CASSANDRA-2401, > {noformat} > ERROR 16:13:38,864 Fatal exception in thread Thread[ReadStage:16,5,main] > java.lang.AssertionError: No data found for SliceQueryFilter(start=java.nio.HeapByteBuffer[pos=10 lim=10 cap=30], finish=java.nio.HeapByteBuffer[pos=17 lim=17 cap=30], reversed=false, count=0] in DecoratedKey(81509516161424251288255223397843705139, 6b657931):QueryPath(columnFamilyName='cf', superColumnName='null', columnName='null') (original filter SliceQueryFilter(start=java.nio.HeapByteBuffer[pos=10 lim=10 cap=30], finish=java.nio.HeapByteBuffer[pos=17 lim=17 cap=30], reversed=false, count=0]) from expression 'cf.626972746864617465 EQ 1' > at org.apache.cassandra.db.ColumnFamilyStore.scan(ColumnFamilyStore.java:1517) > at org.apache.cassandra.service.IndexScanVerbHandler.doVerb(IndexScanVerbHandler.java:42) > at org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:72) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:662) > {noformat} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira