josh-mckenzie commented on code in PR #1755:
URL: https://github.com/apache/cassandra/pull/1755#discussion_r931329304


##########
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))
+                        {
+                            logger.warn("Found unknown system directory {}.{} 
at {} - this is likely left over from a previous " +

Review Comment:
   Think it's correct as "left over" as it's not directly modifying a noun: 
https://grammarist.com/spelling/leftover-left-over/#:~:text=The%20one%2Dword%2C%20unhyphenated%20leftover,e.g.%2C%20save%20the%20leftovers).



-- 
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]

Reply via email to