{"record":{"id":"f99b3f321743e0eb","repo":"apache/cassandra","slug":"snapshot-links-per-second-must-be-0","errorCode":null,"errorMessage":"snapshot_links_per_second must be >= 0","messagePattern":"snapshot_links_per_second must be >= 0","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1170,"sourceCode":"        if (conf.client_encryption_options != null)\n            conf.client_encryption_options.applyConfig();\n\n        if (conf.jmx_server_options == null)\n        {\n            conf.jmx_server_options = JMXServerOptions.createParsingSystemProperties();\n        }\n        else if (JMXServerOptions.isEnabledBySystemProperties())\n        {\n                throw new ConfigurationException(\"Configure either jmx_server_options in cassandra.yaml and comment out \" +\n                                                 \"configure_jmx function call in cassandra-env.sh or keep cassandra-env.sh \" +\n                                                 \"to call configure_jmx function but you have to keep jmx_server_options \" +\n                                                 \"in cassandra.yaml commented out.\");\n        }\n\n        conf.jmx_server_options.jmx_encryption_options.applyConfig();\n\n        if (conf.snapshot_links_per_second < 0)\n            throw new ConfigurationException(\"snapshot_links_per_second must be >= 0\");\n\n        if (conf.max_value_size.toMebibytes() == 0)\n            throw new ConfigurationException(\"max_value_size must be positive\", false);\n        else if (conf.max_value_size.toMebibytes() >= 2048)\n            throw new ConfigurationException(\"max_value_size must be smaller than 2048, but was \"\n                                             + conf.max_value_size.toString(), false);\n\n        switch (conf.disk_optimization_strategy)\n        {\n            case ssd:\n                diskOptimizationStrategy = new SsdDiskOptimizationStrategy(conf.disk_optimization_page_cross_chance);\n                break;\n            case spinning:\n                diskOptimizationStrategy = new SpinningDiskOptimizationStrategy();\n                break;\n        }\n\n        if (conf.compressed_read_ahead_buffer_size.toKibibytes() > 0 && conf.compressed_read_ahead_buffer_size.toKibibytes() < 256)","sourceCodeStart":1152,"sourceCodeEnd":1188,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1152-L1188","documentation":"snapshot_links_per_second rate-limits hard-link creation during snapshots (null-device/snapshot throttling). DatabaseDescriptor rejects negative values at startup with this ConfigurationException, since a negative link rate is meaningless.","triggerScenarios":"cassandra.yaml sets snapshot_links_per_second to a negative number and DatabaseDescriptor.applySimpleConfig runs during startup/configuration load.","commonSituations":"Typo or accidental minus sign when tuning snapshot throttling; templating bug that substitutes an empty/placeholder value with '-1'; copying a partial line from a tuning guide.","solutions":["Set snapshot_links_per_second to 0 (or omit it) to disable rate limiting","Set it to a positive integer appropriate for your filesystem"],"exampleFix":"# before (cassandra.yaml)\nsnapshot_links_per_second: -10\n# after\nsnapshot_links_per_second: 0","handlingStrategy":"validation","validationCode":"if (conf.snapshot_links_per_second < 0) throw new IllegalArgumentException(\"snapshot_links_per_second must be >= 0\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.applyConfig(conf); } catch (ConfigurationException e) { if (e.getMessage().startsWith(\"snapshot_links_per_second\")) { /* fix the yaml value */ } }","preventionTips":["Use 0 to disable snapshot link throttling rather than negative numbers","Template-render configs with explicit defaults so unset variables never become -1","Lint cassandra.yaml numeric fields for non-negativity"],"tags":["cassandra","configuration","snapshot"],"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"}