apache/cassandra · error · ConfigurationException
hints_directory must not be the same as the commitlog_direct
Error message
hints_directory must not be the same as the commitlog_directory
What it means
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.
Source
Thrown at src/java/org/apache/cassandra/config/DatabaseDescriptor.java:924
throw new ConfigurationException("local_system_data_file_directory must not be the same as the commitlog_directory", false);
if (conf.local_system_data_file_directory.equals(conf.accord.journal_directory))
throw new ConfigurationException("local_system_data_file_directory must not be the same as the accord.journal_directory", false);
if (conf.local_system_data_file_directory.equals(conf.saved_caches_directory))
throw new ConfigurationException("local_system_data_file_directory must not be the same as the saved_caches_directory", false);
if (conf.local_system_data_file_directory.equals(conf.hints_directory))
throw new ConfigurationException("local_system_data_file_directory must not be the same as the hints_directory", false);
long freeBytes = tryGetSpace(conf.local_system_data_file_directory, FileStore::getUnallocatedSpace);
if (freeBytes < ONE_GIB)
logger.warn("Only {} free in the system data volume. Consider adding more capacity or removing obsolete snapshots",
FBUtilities.prettyPrintMemory(freeBytes));
}
if (conf.commitlog_directory.equals(conf.accord.journal_directory))
throw new ConfigurationException("accord.journal_directory must not be the same as the commitlog_directory", false);
if (conf.commitlog_directory.equals(conf.hints_directory))
throw new ConfigurationException("hints_directory must not be the same as the commitlog_directory", false);
if (conf.commitlog_directory.equals(conf.saved_caches_directory))
throw new ConfigurationException("saved_caches_directory must not be the same as the commitlog_directory", false);
if (conf.accord.journal_directory.equals(conf.hints_directory))
throw new ConfigurationException("hints_directory must not be the same as the accord.journal_directory", false);
if (conf.accord.journal_directory.equals(conf.saved_caches_directory))
throw new ConfigurationException("saved_caches_directory must not be the same as the accord.journal_directory", false);
if (conf.hints_directory.equals(conf.saved_caches_directory))
throw new ConfigurationException("saved_caches_directory must not be the same as the hints_directory", false);
initializeBackgroundWriteDiskAccessMode();
if (conf.memtable_flush_writers == 0)
{
conf.memtable_flush_writers = conf.data_file_directories.length == 1 ? 2 : 1;
}
View on GitHub (pinned to 88fd0f6a0e)
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.
Example fix
// before (cassandra.yaml) commitlog_directory: /wal hints_directory: /wal // after commitlog_directory: /wal/commitlog hints_directory: /wal/hints
Defensive patterns
Strategy: validation
Validate before calling
if (cfg.hints_directory != null && cfg.hints_directory.equals(cfg.commitlog_directory))
throw new IllegalArgumentException("hints_directory must differ from commitlog_directory"); Type guard
boolean dirsDistinct(String a, String b) { return a == null || b == null || !new File(a).getAbsolutePath().equals(new File(b).getAbsolutePath()); } Try / catch
try { DatabaseDescriptor.applyAll(cfg); } catch (ConfigurationException e) { logger.error("Directory collision: {}", e.getMessage()); System.exit(1); } Prevention
- 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
When it happens
Trigger: 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.
Common situations: Consolidating all writes onto one fast NVMe without creating distinct paths; mis-edited cassandra.yaml where a single variable substituted both directory values.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- local_system_data_file_directory must not be the same as the
- local_system_data_file_directory must not be the same as the
- local_system_data_file_directory must not be the same as the
- accord.journal_directory must not be the same as the commitl
- saved_caches_directory must not be the same as the commitlog
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/83db4fcf001197c0.
Report an issue: GitHub.