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 ED89CD0E9 for ; Mon, 12 Nov 2012 21:51:12 +0000 (UTC) Received: (qmail 62513 invoked by uid 500); 12 Nov 2012 21:51:12 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 62484 invoked by uid 500); 12 Nov 2012 21:51:12 -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 62475 invoked by uid 99); 12 Nov 2012 21:51:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Nov 2012 21:51:12 +0000 Date: Mon, 12 Nov 2012 21:51:12 +0000 (UTC) From: "Jonathan Ellis (JIRA)" To: commits@cassandra.apache.org Message-ID: <2144346854.103151.1352757072669.JavaMail.jiratomcat@arcas> In-Reply-To: <822056571.39349.1331227438484.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CASSANDRA-4021) CFS.scrubDataDirectories tries to delete nonexistent orphans 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-4021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495662#comment-13495662 ] Jonathan Ellis commented on CASSANDRA-4021: ------------------------------------------- That's odd, because here's the code causing that assertion: {code} . File dataFile = new File(desc.filenameFor(Component.DATA)); if (components.contains(Component.DATA) && dataFile.length() > 0) // everything appears to be in order... moving on. continue; // missing the DATA file! all components are orphaned logger.warn("Removing orphans for {}: {}", desc, components); for (Component component : components) { FileUtils.deleteWithConfirm(desc.filenameFor(component)); } {code} I must be missing something because these are the possibilities I see: # .db exists and is non-empty. we don't try to delete it. # .db exists and is empty. we delete it, and do not get a "file does not exist" failure # .db does not exist (is not part of components), so we do not try to delete it > CFS.scrubDataDirectories tries to delete nonexistent orphans > ------------------------------------------------------------ > > Key: CASSANDRA-4021 > URL: https://issues.apache.org/jira/browse/CASSANDRA-4021 > Project: Cassandra > Issue Type: Bug > Components: Core > Affects Versions: 0.7 beta 2 > Reporter: Brandon Williams > Assignee: Brandon Williams > Priority: Minor > Labels: datastax_qa > Attachments: 4021.txt, node1.log > > > The check only looks for a missing data file, then deletes all other components, however it's possible for the data file and another component to be missing, causing an error: > {noformat} > WARN 17:19:28,765 Removing orphans for /var/lib/cassandra/data/system/HintsColumnFamily/system-HintsColumnFamily-hd-24492: [Index.db, Filter.db, Digest.sha1, Statistics.db, Data.db] > ERROR 17:19:28,766 Exception encountered during startup > java.lang.AssertionError: attempted to delete non-existing file system-HintsColumnFamily-hd-24492-Index.db > at org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:49) > at org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:44) > at org.apache.cassandra.db.ColumnFamilyStore.scrubDataDirectories(ColumnFamilyStore.java:357) > at org.apache.cassandra.service.AbstractCassandraDaemon.setup(AbstractCassandraDaemon.java:167) > at org.apache.cassandra.service.AbstractCassandraDaemon.activate(AbstractCassandraDaemon.java:352) > at org.apache.cassandra.thrift.CassandraDaemon.main(CassandraDaemon.java:105) > java.lang.AssertionError: attempted to delete non-existing file system-HintsColumnFamily-hd-24492-Index.db > at org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:49) > at org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:44) > at org.apache.cassandra.db.ColumnFamilyStore.scrubDataDirectories(ColumnFamilyStore.java:357) > at org.apache.cassandra.service.AbstractCassandraDaemon.setup(AbstractCassandraDaemon.java:167) > at org.apache.cassandra.service.AbstractCassandraDaemon.activate(AbstractCassandraDaemon.java:352) > at org.apache.cassandra.thrift.CassandraDaemon.main(CassandraDaemon.java:105) > Exception encountered during startup: attempted to delete non-existing file system-HintsColumnFamily-hd-24492-Index.db > {noformat} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira