josh-mckenzie commented on code in PR #1755:
URL: https://github.com/apache/cassandra/pull/1755#discussion_r931355207
##########
src/java/org/apache/cassandra/service/StartupChecks.java:
##########
@@ -571,6 +571,25 @@ public FileVisitResult visitFile(Path path,
BasicFileAttributes attrs)
public FileVisitResult preVisitDirectory(Path dir,
BasicFileAttributes attrs) throws IOException
{
+ String[] nameParts =
dir.toFile().getCanonicalPath().split(java.io.File.separator);
+ if (nameParts.length >= 2)
+ {
+ String tablePart = nameParts[nameParts.length - 1];
+ String ksPart = nameParts[nameParts.length - 2];
+
+ if (tablePart.contains("-"))
+ tablePart = tablePart.split("-")[0];
+
+ // In very old versions of cassandra, we wouldn't
necessarily delete sstables from dropped system tables
+ // which were removed in various major version
upgrades (e.g system.Versions in 1.2)
+ if
(ksPart.equals(SchemaConstants.SYSTEM_KEYSPACE_NAME) &&
!SystemKeyspace.ALL_TABLE_NAMES.contains(tablePart))
Review Comment:
Hm. It probably would yeah. We don't get any extra metadata in the
preVisitDirectory callback to determine keyspace directory structure so no
method to prevent this kind of "false positive" warning immediately arises.
Maybe grepping for the word "snapshot" in the string and slightly tweaking the
log message to indicate it could potentially be a snapshot if we find it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]