{"record":{"id":"83db4fcf001197c0","repo":"apache/cassandra","slug":"hints-directory-must-not-be-the-same-as-the-commit","errorCode":null,"errorMessage":"hints_directory must not be the same as the commitlog_directory","messagePattern":"hints_directory must not be the same as the commitlog_directory","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":924,"sourceCode":"                throw new ConfigurationException(\"local_system_data_file_directory must not be the same as the commitlog_directory\", false);\n            if (conf.local_system_data_file_directory.equals(conf.accord.journal_directory))\n                throw new ConfigurationException(\"local_system_data_file_directory must not be the same as the accord.journal_directory\", false);\n            if (conf.local_system_data_file_directory.equals(conf.saved_caches_directory))\n                throw new ConfigurationException(\"local_system_data_file_directory must not be the same as the saved_caches_directory\", false);\n            if (conf.local_system_data_file_directory.equals(conf.hints_directory))\n                throw new ConfigurationException(\"local_system_data_file_directory must not be the same as the hints_directory\", false);\n\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","sourceCodeStart":906,"sourceCodeEnd":942,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L906-L942","documentation":"DatabaseDescriptor.applySimpleConfig throws this ConfigurationException when the hints directory equals the commitlog directory. Hints and commitlog are both latency-sensitive append-only stores; sharing a directory is disallowed to isolate I/O and per-volume free-space accounting.","triggerScenarios":"Set hints_directory to the same path as commitlog_directory in cassandra.yaml and start the node; the equality check runs during applySimpleConfig before the node finishes initialization.","commonSituations":"Consolidating all writes onto one fast NVMe without creating distinct paths; mis-edited cassandra.yaml where a single variable substituted both directory values.","solutions":["Change hints_directory to a distinct path in cassandra.yaml.","Use distinct subdirectories under a shared mount if hardware is constrained.","Add a config lint step that asserts all *_directory values are pairwise unique before startup."],"exampleFix":"// before (cassandra.yaml)\ncommitlog_directory: /wal\nhints_directory: /wal\n// after\ncommitlog_directory: /wal/commitlog\nhints_directory: /wal/hints","handlingStrategy":"validation","validationCode":"if (cfg.hints_directory != null && cfg.hints_directory.equals(cfg.commitlog_directory))\n    throw new IllegalArgumentException(\"hints_directory must differ from commitlog_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":["Always template hints_directory and commitlog_directory with distinct values","Check generated cassandra.yaml diffs for duplicated path strings","Use per-subsystem mount points or at minimum distinct subdirectories"],"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-14T16:17:12.679Z"}