apache/cassandra · critical · ConfigurationException

commitlog_directory must not be the same as any data_file_di

Error message

commitlog_directory must not be the same as any data_file_directories

What it means

The commit log (write-ahead log) must live on a directory distinct from all data_file_directories so data files and the WAL are not mixed. applySimpleConfig throws ConfigurationException if any data directory string-equals commitlog_directory, refusing startup.

Source

Thrown at src/java/org/apache/cassandra/config/DatabaseDescriptor.java:889

        if (conf.saved_caches_directory == null)
        {
            conf.saved_caches_directory = storagedirFor("saved_caches");
        }
        if (conf.data_file_directories == null || conf.data_file_directories.length == 0)
        {
            conf.data_file_directories = new String[]{ storagedir("data_file_directories") + File.pathSeparator() + "data" };
        }

        long dataFreeBytes = 0;
        /* data file and commit log directories. they get created later, when they're needed. */
        for (String datadir : conf.data_file_directories)
        {
            if (datadir == null)
                throw new ConfigurationException("data_file_directories must not contain empty entry", false);
            if (datadir.equals(conf.local_system_data_file_directory))
                throw new ConfigurationException("local_system_data_file_directory must not be the same as any data_file_directories", false);
            if (datadir.equals(conf.commitlog_directory))
                throw new ConfigurationException("commitlog_directory must not be the same as any data_file_directories", false);
            if (datadir.equals(conf.accord.journal_directory))
                throw new ConfigurationException("accord.journal_directory must not be the same as any data_file_directories", false);
            if (datadir.equals(conf.hints_directory))
                throw new ConfigurationException("hints_directory must not be the same as any data_file_directories", false);
            if (datadir.equals(conf.saved_caches_directory))
                throw new ConfigurationException("saved_caches_directory must not be the same as any data_file_directories", false);

            dataFreeBytes = saturatedSum(dataFreeBytes, tryGetSpace(datadir, FileStore::getUnallocatedSpace));
        }
        if (dataFreeBytes < 64 * ONE_GIB) // 64 GB
            logger.warn("Only {} free across all data volumes. Consider adding more capacity to your cluster or removing obsolete snapshots",
                        FBUtilities.prettyPrintMemory(dataFreeBytes));

        if (conf.local_system_data_file_directory != null)
        {
            if (conf.local_system_data_file_directory.equals(conf.commitlog_directory))
                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))

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Set commitlog_directory to a distinct path (e.g. /var/lib/cassandra/commitlog)
  2. Ideally put commitlog on a separate disk from data for durability/latency benefits
  3. If truly single-volume, use sibling subdirectories (/data and /commitlog), never the same directory

Example fix

# before (cassandra.yaml)
data_file_directories:
  - /var/lib/cassandra
commitlog_directory: /var/lib/cassandra
# after (cassandra.yaml)
data_file_directories:
  - /var/lib/cassandra/data
commitlog_directory: /var/lib/cassandra/commitlog
Defensive patterns

Strategy: validation

Validate before calling

String commitlog = (String) yaml.get("commitlog_directory");
List<String> dirs = (List<String>) yaml.get("data_file_directories");
if (commitlog != null && dirs != null && dirs.contains(commitlog))
    throw new IllegalArgumentException("commitlog_directory must differ from all data_file_directories");

Try / catch

try {
    DatabaseDescriptor.toolInitialization();
} catch (ConfigurationException e) {
    if (e.getMessage().contains("commitlog_directory"))
        throw new StartupConfigError("commitlog_directory overlaps a data directory", e);
    throw e;
}

Prevention

When it happens

Trigger: Setting commitlog_directory in cassandra.yaml to the same path as any data_file_directories entry; validated during DatabaseDescriptor.applySimpleConfig at startup.

Common situations: Single-disk deployments pointing every directory at the same root; misconfigured container images mounting everything at one path; copy-paste config where commitlog path was not changed from the data path.

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


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/ef972777787c43b5. Report an issue: GitHub.