apache/cassandra · warning

Unable to determine block size for commit log directory: {}

Error message

Unable to determine block size for commit log directory: {}

What it means

During startup, DatabaseDescriptor tries to determine the filesystem block size of the commit log directory to pick a sane disk access mode. If probing the disk throws a RuntimeException, Cassandra logs this warning and falls back to defaults instead of failing startup. It indicates the commit log device could not be stat-ed properly.

Source

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

        {
            try
            {
                String commitLogLocation = getCommitLogLocation();

                if (commitLogLocation == null)
                    throw new ConfigurationException("commitlog_directory must be specified", false);

                File commitLogLocationDir = new File(commitLogLocation);
                PathUtils.createDirectoriesIfNotExists(commitLogLocationDir.toPath());
                directIOSupported = FileUtils.isDirectIOSupported(commitLogLocationDir);
            }
            catch (IOError | ConfigurationException ex)
            {
                throw ex;
            }
            catch (RuntimeException e)
            {
                logger.warn("Unable to determine block size for commit log directory: {}", e.getMessage());
            }
        }

        if (providedDiskAccessMode == DiskAccessMode.auto)
        {
            if (compressOrEncrypt)
                providedDiskAccessMode = DiskAccessMode.legacy;
            else
            {
                providedDiskAccessMode = directIOSupported && conf.disk_optimization_strategy == Config.DiskOptimizationStrategy.ssd ? DiskAccessMode.direct
                                                                                                                                     : DiskAccessMode.legacy;
            }
        }

        if (providedDiskAccessMode == DiskAccessMode.legacy)
        {
            providedDiskAccessMode = compressOrEncrypt ? DiskAccessMode.standard : DiskAccessMode.mmap;
        }

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Verify commitlog_directory exists, is writable by the cassandra user, and is on a normal filesystem
  2. Explicitly set disk_access_mode in cassandra.yaml (e.g. mmap or standard) instead of auto so block-size detection is skipped
  3. If the fallback behavior is acceptable, ignore the warning after confirming disk access mode defaults are fine

Example fix

// cassandra.yaml before
disk_access_mode: auto
// after
disk_access_mode: mmap
Defensive patterns

Strategy: validation

Validate before calling

File dir = new File(DatabaseDescriptor.getCommitLogLocation());
if (!dir.exists() || !dir.canRead()) throw new IllegalStateException("Commit log dir unusable: " + dir);

Prevention

When it happens

Trigger: callingDatabaseDescriptor.applyDiskAccessModeWithCommitLogSection() with a commit log directory that is missing, unreadable, or on an unusual filesystem so the block-size probe throws a RuntimeException (not IOError/ConfigurationException, which are rethrown).

Common situations: Commit log path pointing at a nonexistent directory, a bind-mounted or overlay filesystem (containers) where block-size detection fails, or permission problems on the commit log volume.

Understand the failure class

Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.

Related errors


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