{"record":{"id":"c0c8b213efc9b686","repo":"apache/cassandra","slug":"batch-sync-specified-but-commitlog-sync-period-fo","errorCode":null,"errorMessage":"Batch sync specified, but commitlog_sync_period found.","messagePattern":"Batch sync specified, but commitlog_sync_period found\\.","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":645,"sourceCode":"            {\n                autoSnapshoTtl = new DurationSpec.IntSecondsBound(conf.auto_snapshot_ttl);\n            }\n            catch (IllegalArgumentException e)\n            {\n                throw new ConfigurationException(\"Invalid value of auto_snapshot_ttl: \" + conf.auto_snapshot_ttl, false);\n            }\n        }\n\n        if (conf.commitlog_sync == null)\n        {\n            throw new ConfigurationException(\"Missing required directive CommitLogSync\", false);\n        }\n\n        if (conf.commitlog_sync == CommitLogSync.batch)\n        {\n            if (conf.commitlog_sync_period.toMilliseconds() != 0)\n            {\n                throw new ConfigurationException(\"Batch sync specified, but commitlog_sync_period found.\", false);\n            }\n            logger.debug(\"Syncing log with batch mode\");\n        }\n        else if (conf.commitlog_sync == CommitLogSync.group)\n        {\n            if (conf.commitlog_sync_group_window.toMilliseconds() == 0)\n            {\n                throw new ConfigurationException(\"Missing value for commitlog_sync_group_window.\", false);\n            }\n            else if (conf.commitlog_sync_period.toMilliseconds() != 0)\n            {\n                throw new ConfigurationException(\"Group sync specified, but commitlog_sync_period found. Only specify commitlog_sync_group_window when using group sync\", false);\n            }\n            logger.debug(\"Syncing log with a group window of {}\", conf.commitlog_sync_period.toString());\n        }\n        else\n        {\n            if (conf.commitlog_sync_period.toMilliseconds() == 0)","sourceCodeStart":627,"sourceCodeEnd":663,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L627-L663","documentation":"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.","triggerScenarios":"cassandra.yaml sets 'commitlog_sync: batch' together with a non-zero commitlog_sync_period_in_ms; applySimpleConfig detects the conflict at startup.","commonSituations":"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.","solutions":["Remove commitlog_sync_period_in_ms from cassandra.yaml, or","Set commitlog_sync_period_in_ms: 0 while using batch sync","Choose 'periodic' instead if you want a sync period"],"exampleFix":"# before (cassandra.yaml)\ncommitlog_sync: batch\ncommitlog_sync_period_in_ms: 10000\n# after\ncommitlog_sync: batch","handlingStrategy":"validation","validationCode":"if (\"batch\".equals(conf.commitlog_sync.toString()) && conf.commitlog_sync_period.toMilliseconds() != 0) throw new IllegalArgumentException(\"commitlog_sync=batch requires zero period\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); } catch (ConfigurationException e) { log.error(\"conflicting commitlog directives: {}\", e.getMessage()); }","preventionTips":["When switching periodic->batch, remove commitlog_sync_period_in_ms in the same change","Set period to 0 instead of deleting the line if tooling requires it","Review commitlog directives as a set, not individually"],"tags":["cassandra","config","commitlog","conflicting-options"],"backgroundTag":"conflicting-config-options","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}