{"record":{"id":"55afe066d7429ec8","repo":"apache/cassandra","slug":"accord-cache-size-option-was-set-incorrectly-to","errorCode":null,"errorMessage":"accord.cache_size option was set incorrectly to '<value>', supported values are <integer> >= 0.","messagePattern":"accord\\.cache_size option was set incorrectly to '<value>', supported values are <integer> >= 0\\.","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1060,"sourceCode":"        catch (NumberFormatException e)\n        {\n            throw new ConfigurationException(\"paxos_cache_size option was set incorrectly to '\"\n                                             + conf.paxos_cache_size + \"', supported values are <integer> >= 0.\", false);\n        }\n\n        try\n        {\n            // if accordCacheSizeInMiB option was set to \"auto\" then size of the cache should be \"max(10% of Heap (in MB), 1MB)\n            accordCacheSizeInMiB = (conf.accord.cache_size == null)\n                                  ? Math.max(1, (int) ((Runtime.getRuntime().totalMemory() * 0.10) / 1024 / 1024))\n                                  : conf.accord.cache_size.toMebibytes();\n\n            if (accordCacheSizeInMiB < 0)\n                throw new NumberFormatException(); // to escape duplicating error message\n        }\n        catch (NumberFormatException e)\n        {\n            throw new ConfigurationException(\"accord.cache_size option was set incorrectly to '\"\n                                             + conf.accord.cache_size + \"', supported values are <integer> >= 0.\", false);\n        }\n\n        try\n        {\n            // if accordWorkingSetSizeInMiB option was set to \"auto\" then size of the working set should be \"max(5% of Heap (in MB), 1MB)\n            // if negative, there is no limit\n            accordWorkingSetSizeInMiB = (conf.accord.working_set_size == null)\n                                  ? Math.max(1, (int) ((Runtime.getRuntime().totalMemory() * 0.05) / 1024 / 1024))\n                                  : conf.accord.working_set_size.toMebibytes();\n        }\n        catch (NumberFormatException e)\n        {\n            throw new ConfigurationException(\"accord.working_set_size option was set incorrectly to '\"\n                                             + conf.accord.working_set_size + \"', supported values are <integer> >= 0.\", false);\n        }\n\n        try","sourceCodeStart":1042,"sourceCodeEnd":1078,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1042-L1078","documentation":"accord.cache_size must be a non-negative integer (MiB) or 'auto'. applySimpleConfig converts any parse failure or negative value into ConfigurationException naming the accord.cache_size option and its accepted format.","triggerScenarios":"Node startup with accord.cache_size in cassandra.yaml that is negative, non-numeric, or unit-suffixed (common with Accord/transactional config newly added in this version).","commonSituations":"Fresh Accord configuration copied with units ('512MB'); a leftover negative placeholder from tooling; YAML value accidentally quoted as a string with extra text.","solutions":["Set accord.cache_size to a plain non-negative integer of MiB, e.g. 512","Use 'auto' for max(10% of heap, 1MiB)","Remove the key if Accord cache tuning is not needed","Restart the node"],"exampleFix":"// before (cassandra.yaml)\naccord:\n  cache_size: 512MB\n// after\naccord:\n  cache_size: 512\n// or\naccord:\n  cache_size: auto","handlingStrategy":"validation","validationCode":"Object v = yaml.get(\"accord\").get(\"cache_size\");\nif (v != null && !\"auto\".equals(v) && Long.parseLong(v.toString()) < 0) throw new IllegalArgumentException(v);","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); }\ncatch (ConfigurationException e) { LOG.fatal(e.getMessage()); System.exit(1); }","preventionTips":["For nested accord settings, keep cache_size as a bare MiB integer or 'auto'","When adopting Accord config, copy from the version's shipped cassandra.yaml example","Validate the full YAML against the Config schema before restart"],"tags":["cassandra","configuration","cache","accord"],"backgroundTag":"invalid-config-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"}