{"record":{"id":"095a4c753cd33761","repo":"apache/cassandra","slug":"accord-working-set-size-option-was-set-incorrectly","errorCode":null,"errorMessage":"accord.working_set_size option was set incorrectly to '<value>', supported values are <integer> >= 0.","messagePattern":"accord\\.working_set_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":1074,"sourceCode":"                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\n        {\n            // if consensusMigrationCacheSizeInMiB option was set to \"auto\" then size of the cache should be \"min(1% of Heap (in MB), 50MB)\n            consensusMigrationCacheSizeInMiB = (conf.consensus_migration_cache_size == null)\n                                               ? Math.min(Math.max(1, (int) (Runtime.getRuntime().totalMemory() * 0.01 / 1024 / 1024)), 50)\n                                               : conf.consensus_migration_cache_size.toMebibytes();\n\n            if (consensusMigrationCacheSizeInMiB < 0)\n                throw new NumberFormatException(); // to escape duplicating error message\n        }\n        catch (NumberFormatException e)\n        {\n            throw new ConfigurationException(\"consensus_migration_cache_size option was set incorrectly to '\"\n                                             + conf.consensus_migration_cache_size + \"', supported values are <integer> >= 0.\", false);\n        }","sourceCodeStart":1056,"sourceCodeEnd":1092,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1056-L1092","documentation":"Thrown by DatabaseDescriptor.applySimpleConfig when the accord.working_set_size config value cannot be parsed into a valid mebibyte integer (>= 0). Cassandra validates all simple config settings at startup, before the node can serve traffic. This is a ConfigurationException with a friendly message identifying the offending value.","triggerScenarios":"cassandra.yaml contains accord.working_set_size set to a value that fails toMebibytes() parsing (e.g. non-numeric string, negative number, malformed size string like '5x' or '-1mib'), or negative numeric value caught by the surrounding NumberFormatException handler.","commonSituations":"Operators enabling Accord (transactional) features hand-edit cassandra.yaml and mistype the size; config copied from an older/newer version with a different accepted syntax; automation templates injecting negative or placeholder values.","solutions":["Fix accord.working_set_size in cassandra.yaml to a non-negative integer of mebibytes (e.g. 64) or remove the option entirely to let Cassandra auto-size it to max(1, 5% of heap in MiB).","If set to 'auto' or empty intent, delete the key rather than leaving an unparseable token.","Restart the node; validation runs in applySimpleConfig during startup/toolInitialization."],"exampleFix":"# before (cassandra.yaml)\naccord:\n  working_set_size: -5mib\n# after\naccord:\n  working_set_size: 64MiB","handlingStrategy":"validation","validationCode":"// before deploy, parse cassandra.yaml and check\nString v = yaml.get(\"accord.working_set_size\");\nif (v != null && (v.trim().isEmpty() || v.contains(\"-\") || !v.matches(\"[0-9]+\\\\s*(MiB|MB)?\")))\n    throw new IllegalArgumentException(\"accord.working_set_size must be a non-negative integer mebibyte value, got: \" + v);","typeGuard":"boolean isValidWorkingSetSize(Object v) {\n    return v == null || (v instanceof Number && ((Number) v).longValue() >= 0);\n}","tryCatchPattern":"try {\n    DatabaseDescriptor.applySimpleConfig();\n} catch (ConfigurationException e) {\n    if (e.getMessage().contains(\"accord.working_set_size\")) {\n        logger.error(\"Fix accord.working_set_size in cassandra.yaml: {}\", e.getMessage());\n        // fall back to removing the key and restarting\n    }\n}","preventionTips":["Leave accord.working_set_size unset unless you have a sizing reason; the 5%-of-heap default is sane","Only use plain non-negative integers of MiB","Lint cassandra.yaml in CI before rolling config changes"],"tags":["config","startup","validation"],"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"}