apache/cassandra · critical · IllegalArgumentException

Unsupported disk access mode for compaction_read_disk_access

Error message

Unsupported disk access mode for compaction_read_disk_access_mode (options: direct/auto) ${conf.compaction_read_disk_access_mode}

What it means

compaction_read_disk_access_mode accepts only 'auto' and 'direct'; any other resolved value (e.g. mmap or standard, or an unrecognized string that fails the enum parse into something unexpected) makes applySimpleConfig throw this IllegalArgumentException. The option exists so compaction reads can opt into direct I/O independently of the global disk_access_mode.

Source

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

            throw new ConfigurationException(String.format("DiskAccessMode '%s' is not supported", DiskAccessMode.direct));
        }
        else
        {
            indexAccessMode = conf.disk_access_mode;
        }
        logger.info("DiskAccessMode is {}, indexAccessMode is {}", conf.disk_access_mode, indexAccessMode);

        if (DiskAccessMode.auto == conf.compaction_read_disk_access_mode)
        {
            compactionReadDiskAccessMode = conf.disk_access_mode;
        }
        else if (DiskAccessMode.direct == conf.compaction_read_disk_access_mode)
        {
            compactionReadDiskAccessMode = DiskAccessMode.direct;
        }
        else
        {
            throw new IllegalArgumentException("Unsupported disk access mode for compaction_read_disk_access_mode " +
                                               "(options: direct/auto) " + conf.compaction_read_disk_access_mode);
        }
        logger.info("compaction_read_disk_access_mode resolved to: {}", compactionReadDiskAccessMode);

        /* phi convict threshold for FailureDetector */
        if (conf.phi_convict_threshold < 5 || conf.phi_convict_threshold > 16)
        {
            throw new ConfigurationException("phi_convict_threshold must be between 5 and 16, but was " + conf.phi_convict_threshold, false);
        }

        /* Thread per pool */
        if (conf.concurrent_reads < 2)
        {
            throw new ConfigurationException("concurrent_reads must be at least 2, but was " + conf.concurrent_reads, false);
        }

        if (conf.concurrent_writes < 2 && TEST_FAIL_MV_LOCKS_COUNT.getString("").isEmpty())
        {

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Set `compaction_read_disk_access_mode: auto` so compaction reads inherit the appropriate mode.
  2. Set it explicitly to `direct` if compaction reads should bypass the page cache.
  3. Remove the option entirely to use the default behavior.

Example fix

// before (cassandra.yaml)
compaction_read_disk_access_mode: mmap
// after (cassandra.yaml)
compaction_read_disk_access_mode: auto
Defensive patterns

Strategy: validation

Validate before calling

// Java, before toolInitialization()
String v = /* compaction_read_disk_access_mode from yaml */;
if (v != null && !Set.of("auto", "direct").contains(v.toLowerCase()))
    throw new IllegalArgumentException("compaction_read_disk_access_mode must be auto or direct, got: " + v);

Prevention

When it happens

Trigger: Configuring `compaction_read_disk_access_mode` to a value other than auto/direct (e.g. mmap, standard, or a typo) and starting the node via DatabaseDescriptor.toolInitialization/applyAll.

Common situations: Copy-pasting the value from disk_access_mode (which allows mmap/standard); typos like 'direct-io' or 'DIRECT' handled differently by the parser; experimenting with direct-I/O tuning on compaction-heavy nodes.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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