{"record":{"id":"2b5344208c3f2312","repo":"apache/cassandra","slug":"unknown-commitlog-service-type-commitlogsync","errorCode":null,"errorMessage":"Unknown commitlog service type: <commitLogSync>","messagePattern":"Unknown commitlog service type: <commitLogSync>","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/db/commitlog/CommitLog.java","lineNumber":129,"sourceCode":"                                               DatabaseDescriptor.getCommitLogWriteDiskAccessMode());\n        DatabaseDescriptor.createAllDirectories();\n\n        this.archiver = archiver;\n        metrics = new CommitLogMetrics();\n\n        switch (DatabaseDescriptor.getCommitLogSync())\n        {\n            case periodic:\n                executor = new PeriodicCommitLogService(this);\n                break;\n            case batch:\n                executor = new BatchCommitLogService(this);\n                break;\n            case group:\n                executor = new GroupCommitLogService(this);\n                break;\n            default:\n                throw new IllegalArgumentException(\"Unknown commitlog service type: \" + DatabaseDescriptor.getCommitLogSync());\n        }\n\n        segmentManager = segmentManagerProvider.apply(this);\n\n        // register metrics\n        metrics.attach(executor, segmentManager);\n    }\n\n    /**\n     * Tries to start the CommitLog if not already started.\n     */\n    synchronized public CommitLog start()\n    {\n        if (started)\n            return this;\n\n        try\n        {","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/commitlog/CommitLog.java#L111-L147","documentation":"CommitLog's constructor creates a CommitLogExecutorService based on the configured commitlog_sync mode (periodic, batch, group). If DatabaseDescriptor.getCommitLogSync() returns a value with no matching case, it throws IllegalArgumentException \"Unknown commitlog service type\". This guards against unhandled enum values, e.g. from a newer config parsed by an older binary.","triggerScenarios":"Setting an invalid or unsupported commitlog_sync value in cassandra.yaml, or a config from a newer Cassandra version whose new sync mode is not understood by the running binary.","commonSituations":"Typo like commitlog_sync: Periodic (case-sensitive enum parse) or an unknown mode name; rolling back a version downgrade where the new mode persisted in config is unsupported; hand-edited yaml with an invented value.","solutions":["Set commitlog_sync in cassandra.yaml to one of: periodic, batch, or group (matching your Cassandra version's supported values)","Check the exact spelling/case of the value; compare against Config.CommitLogSync in your binary's version","Remove config values inherited from a newer Cassandra version if you downgraded, or upgrade the binary instead","Validate config with the target version's documentation before deployment"],"exampleFix":"// before (cassandra.yaml)\ncommitlog_sync: twync\n// after\ncommitlog_sync: periodic","handlingStrategy":"validation","validationCode":"Set<String> valid = Set.of(\"periodic\", \"batch\", \"group\");\nString mode = yaml.get(\"commitlog_sync\");\nif (!valid.contains(mode)) throw new IllegalArgumentException(\"Unsupported commitlog_sync: \" + mode);","typeGuard":"null","tryCatchPattern":"try { startCassandra(); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"Unknown commitlog service type\")) { /* correct commitlog_sync value and restart */ } else throw e; }","preventionTips":["Validate commitlog_sync against the running binary's supported enum before upgrade/downgrade","Keep cassandra.yaml in sync with the Cassandra version (downgrades especially)","Use schema/JSON validation on generated configs in automation"],"tags":["commitlog","configuration","enum","startup"],"backgroundTag":"invalid-enum-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}