{"record":{"id":"2cb2951e9ba91406","repo":"apache/cassandra","slug":"saved-caches-directory-must-not-be-the-same-as-the-2cb295","errorCode":null,"errorMessage":"saved_caches_directory must not be the same as the hints_directory","messagePattern":"saved_caches_directory must not be the same as the hints_directory","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":934,"sourceCode":"            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        }\n        else\n        {\n            logger.warn(\"memtable_cleanup_threshold has been deprecated and should be removed from cassandra.yaml\");","sourceCodeStart":916,"sourceCodeEnd":952,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L916-L952","documentation":"DatabaseDescriptor.applySimpleConfig throws this ConfigurationException when the hints directory equals the saved caches directory. Cassandra requires hints and saved caches to occupy distinct configured paths so hint replay data and cache snapshots never share the same directory.","triggerScenarios":"Set hints_directory equal to saved_caches_directory in cassandra.yaml and start the node; check executes during applySimpleConfig before further startup validation (e.g. memtable_flush_writers checks).","commonSituations":"Operators merging all auxiliary directories into one path on small volumes; copy-pasted cassandra.yaml entries that accidentally matched.","solutions":["Change hints_directory or saved_caches_directory in cassandra.yaml to a distinct path.","Use separate subdirectories under one mount if only a single disk is available.","Verify pairwise uniqueness of all directory settings before restarting the node."],"exampleFix":"// before (cassandra.yaml)\nhints_directory: /data/aux\nsaved_caches_directory: /data/aux\n// after\nhints_directory: /data/aux/hints\nsaved_caches_directory: /data/aux/saved_caches","handlingStrategy":"validation","validationCode":"if (cfg.hints_directory != null && cfg.hints_directory.equals(cfg.saved_caches_directory))\n    throw new IllegalArgumentException(\"hints_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":["Give hints and saved caches separate subdirectories even on one disk","Validate cassandra.yaml in CI with a pairwise-uniqueness assertion","Review copy-pasted directory entries when consolidating onto smaller volumes"],"tags":["config","startup","directory-conflict"],"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-17T15:17:12.973Z"}