{"record":{"id":"9f834a49089c5256","repo":"apache/cassandra","slug":"multiple-sstable-format-implementations-with-the-s","errorCode":null,"errorMessage":"Multiple sstable format implementations with the same name %s: %s and %s","messagePattern":"Multiple sstable format implementations with the same name (.+?): (.+?) and (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1938,"sourceCode":"        {\n            throw new ConfigurationException(\"commitlog_disk_access_mode = \" + accessModeDirectIoPair.left + \" is not supported. Please use 'auto' when unsure.\", false);\n        }\n    }\n\n    private static void validateSSTableFormatFactories(Iterable<SSTableFormat.Factory> factories)\n    {\n        Map<String, SSTableFormat.Factory> factoryByName = new HashMap<>();\n        for (SSTableFormat.Factory factory : factories)\n        {\n            if (factory.name() == null)\n                throw new ConfigurationException(String.format(\"SSTable format name in %s cannot be null\", factory.getClass().getCanonicalName()));\n\n            if (!factory.name().matches(\"^[a-z]+$\"))\n                throw new ConfigurationException(String.format(\"SSTable format name for %s must be non-empty, lower-case letters only string\", factory.getClass().getCanonicalName()));\n\n            SSTableFormat.Factory prev = factoryByName.put(factory.name(), factory);\n            if (prev != null)\n                throw new ConfigurationException(String.format(\"Multiple sstable format implementations with the same name %s: %s and %s\", factory.name(), factory.getClass().getCanonicalName(), prev.getClass().getCanonicalName()));\n        }\n    }\n\n    private static ImmutableMap<String, Supplier<SSTableFormat<?, ?>>> validateAndMatchSSTableFormatOptions(Iterable<SSTableFormat.Factory> factories, Map<String, Map<String, String>> options)\n    {\n        ImmutableMap.Builder<String, Supplier<SSTableFormat<?, ?>>> providersBuilder = ImmutableMap.builder();\n        if (options == null)\n            options = ImmutableMap.of();\n        for (SSTableFormat.Factory factory : factories)\n        {\n            Map<String, String> formatOptions = options.getOrDefault(factory.name(), ImmutableMap.of());\n            providersBuilder.put(factory.name(), () -> factory.getInstance(ImmutableMap.copyOf(formatOptions)));\n        }\n        ImmutableMap<String, Supplier<SSTableFormat<?, ?>>> providers = providersBuilder.build();\n        if (options != null)\n        {\n            Sets.SetView<String> unknownFormatNames = Sets.difference(options.keySet(), providers.keySet());\n            if (!unknownFormatNames.isEmpty())","sourceCodeStart":1920,"sourceCodeEnd":1956,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1920-L1956","documentation":"During DatabaseDescriptor's static sstable-format registration, each SSTableFormat.Factory is registered by its lowercase name in a map; if two factories declare the same name, the second registration finds a previous entry and throws this ConfigurationException. It exists to keep the sstable format registry unambiguous, since format names are used in config and sstable metadata to select implementations.","triggerScenarios":"Registering (via the applySSTableFormats registration loop) two format factories whose name() returns the same string, e.g. a custom format named 'big' or a classpath containing two third-party format providers with clashing names.","commonSituations":"Shipping a custom SSTableFormat whose name collides with a built-in (big, bti) or with another plugin on the classpath; copy-pasting a format implementation and forgetting to change its NAME; duplicate jars of the same format library on the classpath.","solutions":["Rename your custom format's name() (NAME constant) to a unique lowercase string not used by any other registered format","Check the classpath for duplicate format-provider jars and remove the stale one","If the collision is with a built-in format, do not register a factory with name 'big' or 'bti'; extend or configure the existing one instead"],"exampleFix":"// before\npublic static final String NAME = \"big\"; // collides with built-in BigFormat\n// after\npublic static final String NAME = \"mycustom\";","handlingStrategy":"validation","validationCode":"Set<String> names = new HashSet<>();\nfor (SSTableFormat.Factory f : myFactories) {\n    if (!names.add(f.name()))\n        throw new IllegalStateException(\"Duplicate sstable format name: \" + f.name());\n}","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); }\ncatch (ConfigurationException e) {\n    if (e.getMessage().startsWith(\"Multiple sstable format implementations\"))\n        log.error(\"Format name collision: {}\", e.getMessage());\n}","preventionTips":["Give every custom format a unique lowercase NAME","Keep a registry test asserting all format names are distinct","Avoid shipping two jars containing format providers with the same name"],"tags":["configuration","sstable","startup"],"backgroundTag":"conflicting-config-options","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}