apache/cassandra · critical · ConfigurationException

Batch sync specified, but commitlog_sync_period found.

Error message

Batch sync specified, but commitlog_sync_period found.

What it means

When commitlog_sync is set to 'batch', the commitlog_sync_period must not be set (writes are synced synchronously per batch, no periodic window). If the configured period is non-zero, Cassandra throws ConfigurationException because the two options conflict.

Source

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

            {
                autoSnapshoTtl = new DurationSpec.IntSecondsBound(conf.auto_snapshot_ttl);
            }
            catch (IllegalArgumentException e)
            {
                throw new ConfigurationException("Invalid value of auto_snapshot_ttl: " + conf.auto_snapshot_ttl, false);
            }
        }

        if (conf.commitlog_sync == null)
        {
            throw new ConfigurationException("Missing required directive CommitLogSync", false);
        }

        if (conf.commitlog_sync == CommitLogSync.batch)
        {
            if (conf.commitlog_sync_period.toMilliseconds() != 0)
            {
                throw new ConfigurationException("Batch sync specified, but commitlog_sync_period found.", false);
            }
            logger.debug("Syncing log with batch mode");
        }
        else if (conf.commitlog_sync == CommitLogSync.group)
        {
            if (conf.commitlog_sync_group_window.toMilliseconds() == 0)
            {
                throw new ConfigurationException("Missing value for commitlog_sync_group_window.", false);
            }
            else if (conf.commitlog_sync_period.toMilliseconds() != 0)
            {
                throw new ConfigurationException("Group sync specified, but commitlog_sync_period found. Only specify commitlog_sync_group_window when using group sync", false);
            }
            logger.debug("Syncing log with a group window of {}", conf.commitlog_sync_period.toString());
        }
        else
        {
            if (conf.commitlog_sync_period.toMilliseconds() == 0)

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Remove commitlog_sync_period_in_ms from cassandra.yaml, or
  2. Set commitlog_sync_period_in_ms: 0 while using batch sync
  3. Choose 'periodic' instead if you want a sync period

Example fix

# before (cassandra.yaml)
commitlog_sync: batch
commitlog_sync_period_in_ms: 10000
# after
commitlog_sync: batch
Defensive patterns

Strategy: validation

Validate before calling

if ("batch".equals(conf.commitlog_sync.toString()) && conf.commitlog_sync_period.toMilliseconds() != 0) throw new IllegalArgumentException("commitlog_sync=batch requires zero period");

Try / catch

try { DatabaseDescriptor.daemonInitialization(); } catch (ConfigurationException e) { log.error("conflicting commitlog directives: {}", e.getMessage()); }

Prevention

When it happens

Trigger: cassandra.yaml sets 'commitlog_sync: batch' together with a non-zero commitlog_sync_period_in_ms; applySimpleConfig detects the conflict at startup.

Common situations: Switching from 'periodic' to 'batch' but forgetting to remove/zero the sync period left from the previous configuration, or copying directives from mixed example configs.

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/c0c8b213efc9b686. Report an issue: GitHub.