{"record":{"id":"06ce8175fc7a110c","repo":"apache/cassandra","slug":"selected-sstable-format-s-is-not-available-when","errorCode":null,"errorMessage":"Selected sstable format '%s' is not available when in storage compatibility mode '%s'.","messagePattern":"Selected sstable format '(.+?)' is not available when in storage compatibility mode '(.+?)'\\.","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/utils/StorageCompatibilityMode.java","lineNumber":84,"sourceCode":"    public static StorageCompatibilityMode current()\n    {\n        return DatabaseDescriptor.getStorageCompatibilityMode();\n    }\n\n    public boolean disabled()\n    {\n        return this == NONE;\n    }\n\n    public boolean isBefore(int major)\n    {\n        return this.major < major;\n    }\n\n    public void validateSstableFormat(SSTableFormat<?, ?> selectedFormat)\n    {\n        if (selectedFormat.name().equals(BtiFormat.NAME) && this == StorageCompatibilityMode.CASSANDRA_4)\n            throw new ConfigurationException(String.format(\"Selected sstable format '%s' is not available when in storage compatibility mode '%s'.\",\n                                                           selectedFormat.name(),\n                                                           this));\n    }\n}\n","sourceCodeStart":66,"sourceCodeEnd":89,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/utils/StorageCompatibilityMode.java#L66-L89","documentation":"StorageCompatibilityMode.validateSstableFormat rejects an SSTable format selection that is incompatible with the active storage compatibility mode. Specifically, selecting BTI format while running in CASSANDRA_4 compatibility mode throws this ConfigurationException, since BTI is not readable/writable when emulating 4.x storage.","triggerScenarios":"Setting sstable format to 'bti' in cassandra.yaml or via CREATE TABLE options while storage compatibility mode is CASSANDRA_4, or upgrading config files that enable BTI before switching the compatibility mode.","commonSituations":"Upgrades from Cassandra 4.x where operators pre-configure BTI tables, mixed-version clusters pinned in CASSANDRA_4 mode, or copy-pasted table options from newer clusters.","solutions":["Either change the table's sstable format back to 'bige' while in CASSANDRA_4 mode","Or complete the storage compatibility-mode upgrade (switch mode off CASSANDRA_4) before using BTI","Check cassandra.yaml / schema for 'bti' occurrences and remove them until the mode is upgraded","Plan the upgrade path: finish 4.x compatibility phase, then enable BTI per table"],"exampleFix":"// before (cassandra.yaml / schema)\nsstable_format: bti   # with storage_compatibility_mode: CASSANDRA_4\n// after\nsstable_format: bige  # then switch compatibility mode before using bti","handlingStrategy":"validation","validationCode":"if (\"bti\".equalsIgnoreCase(selectedFormat) && StorageCompatibilityMode.current() == StorageCompatibilityMode.CASSANDRA_4)\n    throw new ConfigurationException(\"bti format requires exiting CASSANDRA_4 compatibility mode\");","typeGuard":null,"tryCatchPattern":"try { mode.validateSstableFormat(format); } catch (ConfigurationException e) { logger.error(e.getMessage()); /* fall back to bige or abort startup */ }","preventionTips":["Audit cassandra.yaml and schemas for 'bti' before planning a 4.x upgrade","Only enable BTI after completing compatibility-mode progression","Document the upgrade order: bige on 4-mode → switch mode → bti","Validate config in CI before rolling out upgrades"],"tags":["configuration","sstable-format","upgrade-compatibility"],"backgroundTag":"incompatible-source-type","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}