cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Coli (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-4021) CFS.scrubDataDirectories tries to delete nonexistent orphans
Date Mon, 30 Jul 2012 22:50:34 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-4021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425340#comment-13425340
] 

Robert Coli commented on CASSANDRA-4021:
----------------------------------------

I don't especially "expect" Cassandra to cope with arbitrary user-created files in the directories
it is supposed to have control over. The purpose of my comment was primarily to assist any
other operator who might have accidentally created such a file, who would then google the
exception and be confused because this ticket was marked no-repro.

However.. the comment for scrubDataDirectories says the following :
"
     * Removes unnecessary files from the cf directory at startup: these include temp files,
orphans, zero-length files
     * and compacted sstables. Files that cannot be recognized will be ignored.
"

So it is a goal to "recognize" files properly, and to "ignore" files that are not "recognized"
properly.

Further in the code we see..
"
if (!"snapshots".equals(name) && !"backups".equals(name) && !name.contains(".json"))
"

Which suggests that had my file not happened to have had suffix .json, it would have been
"recognized" and at least logged an error about being an invalid file, even if it were not
"ignored," I would have had a chance of reading a relevant log message ...

I agree that the practice of creating arbitrary files named like sstables, but with an additional
"-" in them should be considered hazardous!

But as we can easily "recognize" that any file with more "-" delimited elements in them than
possible are not sstables, I continue to suggest that the user might prefer to discover this
before Cassandra has tried and failed to treat such a file as a sstable, and refused to start
as a result of trying to scrub the broken sstable. :D
                
> 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
>
>
> 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message