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.