{"record":{"id":"8b8f61fa67424ee5","repo":"apache/cassandra","slug":"saved-caches-directory-must-not-be-the-same-as-the-8b8f61","errorCode":null,"errorMessage":"saved_caches_directory must not be the same as the accord.journal_directory","messagePattern":"saved_caches_directory must not be the same as the accord\\.journal_directory","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":931,"sourceCode":"\n            long freeBytes = tryGetSpace(conf.local_system_data_file_directory, FileStore::getUnallocatedSpace);\n\n            if (freeBytes < ONE_GIB)\n                logger.warn(\"Only {} free in the system data volume. Consider adding more capacity or removing obsolete snapshots\",\n                            FBUtilities.prettyPrintMemory(freeBytes));\n        }\n\n        if (conf.commitlog_directory.equals(conf.accord.journal_directory))\n            throw new ConfigurationException(\"accord.journal_directory must not be the same as the commitlog_directory\", false);\n        if (conf.commitlog_directory.equals(conf.hints_directory))\n            throw new ConfigurationException(\"hints_directory must not be the same as the commitlog_directory\", false);\n        if (conf.commitlog_directory.equals(conf.saved_caches_directory))\n            throw new ConfigurationException(\"saved_caches_directory must not be the same as the commitlog_directory\", false);\n\n        if (conf.accord.journal_directory.equals(conf.hints_directory))\n            throw new ConfigurationException(\"hints_directory must not be the same as the accord.journal_directory\", false);\n        if (conf.accord.journal_directory.equals(conf.saved_caches_directory))\n            throw new ConfigurationException(\"saved_caches_directory must not be the same as the accord.journal_directory\", false);\n\n        if (conf.hints_directory.equals(conf.saved_caches_directory))\n            throw new ConfigurationException(\"saved_caches_directory must not be the same as the hints_directory\", false);\n\n        initializeBackgroundWriteDiskAccessMode();\n\n        if (conf.memtable_flush_writers == 0)\n        {\n            conf.memtable_flush_writers = conf.data_file_directories.length == 1 ? 2 : 1;\n        }\n\n        if (conf.memtable_flush_writers < 1)\n            throw new ConfigurationException(\"memtable_flush_writers must be at least 1, but was \" + conf.memtable_flush_writers, false);\n\n        if (conf.memtable_cleanup_threshold == null)\n        {\n            conf.memtable_cleanup_threshold = (float) (1.0 / (1 + conf.memtable_flush_writers));\n        }","sourceCodeStart":913,"sourceCodeEnd":949,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L913-L949","documentation":"DatabaseDescriptor.applySimpleConfig throws this ConfigurationException when the Accord journal directory equals the saved caches directory. Cassandra enforces that the Accord durable journal does not share a directory with saved cache snapshots to keep durability-critical journal writes isolated.","triggerScenarios":"Set accord.journal_directory equal to saved_caches_directory in cassandra.yaml and start the node; the equality check runs during applySimpleConfig in toolInitialization/applyAll.","commonSituations":"Consolidating less-used directories onto one path; misconfigured provisioning scripts that assign the same default directory to every unused key.","solutions":["Give accord.journal_directory and saved_caches_directory distinct paths in cassandra.yaml.","Use distinct subdirectories under a shared mount if needed.","Run a config uniqueness check before startup."],"exampleFix":"// before (cassandra.yaml)\naccord:\n  journal_directory: /data/cache\nsaved_caches_directory: /data/cache\n// after\naccord:\n  journal_directory: /data/accord_journal\nsaved_caches_directory: /data/saved_caches","handlingStrategy":"validation","validationCode":"if (cfg.accord != null && cfg.accord.journal_directory != null && cfg.accord.journal_directory.equals(cfg.saved_caches_directory))\n    throw new IllegalArgumentException(\"accord.journal_directory must differ from saved_caches_directory\");","typeGuard":"boolean dirsDistinct(String a, String b) { return a == null || b == null || !new File(a).getAbsolutePath().equals(new File(b).getAbsolutePath()); }","tryCatchPattern":"try { DatabaseDescriptor.applyAll(cfg); } catch (ConfigurationException e) { logger.error(\"Directory collision: {}\", e.getMessage()); System.exit(1); }","preventionTips":["Never collapse unused directory keys onto one shared path; use distinct subdirectories","Lint cassandra.yaml for duplicate values before each restart","Keep a canonical reference cassandra.yaml showing intended directory layout"],"tags":["config","startup","directory-conflict","accord"],"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"}