adelapena commented on code in PR #2391: URL: https://github.com/apache/cassandra/pull/2391#discussion_r1221400438
########## src/java/org/apache/cassandra/config/DatabaseDescriptor.java: ########## @@ -1424,9 +1425,20 @@ private static void validateSSTableFormatFactories(Iterable<SSTableFormat.Factor if (selectedFormat == null) throw new ConfigurationException(String.format("Selected sstable format '%s' is not available.", selectedFormatName)); + validateWriteFormatVsStorageCompatibilityMode(selectedFormat, getStorageCompatibilityMode()); + return selectedFormat; } + @VisibleForTesting + public static void validateWriteFormatVsStorageCompatibilityMode(SSTableFormat<?, ?> selectedFormat, StorageCompatibilityMode mode) + { + if (selectedFormat.name().equals(BtiFormat.NAME) && mode != StorageCompatibilityMode.NONE) + throw new ConfigurationException(String.format("Selected sstable format '%s' is not available when in storage compatibility mode '%s'.", Review Comment: Perhaps we could take a guardrail-ish approach and delegate the formatting of the message to `StorageCompatibilityMode`. Something like: https://github.com/adelapena/cassandra/commit/30119694b64beb09d354984738ebc74fb447f7a9 That way we can make sure that all compatibility validation exceptions have a similar formatting. wdyt? -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org