{"record":{"id":"e1c88232486448d1","repo":"apache/cassandra","slug":"write-tombstone-warn-threshold-d-must-be-1-di","errorCode":null,"errorMessage":"write_tombstone_warn_threshold (%d) must be -1 (disabled) or >= 0","messagePattern":"write_tombstone_warn_threshold \\((.+?)\\) must be -1 \\(disabled\\) or >= 0","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1385,"sourceCode":"        if (fail != null && warn != null && fail.toBytes() < warn.toBytes())\n            throw new ConfigurationException(String.format(\"%s (%s) must be greater than or equal to %s (%s)\",\n                                                           name + \"_fail_threshold\", fail,\n                                                           name + \"_warn_threshold\", warn));\n    }\n\n    private static void validateWriteSizeThreshold(DataStorageSpec.LongBytesBound writeSizeWarn, DataStorageSpec.LongBytesBound minTrackedSize)\n    {\n        if (writeSizeWarn != null && minTrackedSize != null)\n        {\n            if (writeSizeWarn.toBytes() < minTrackedSize.toBytes())\n                throw new ConfigurationException(String.format(\"write_size_warn_threshold (%s) cannot be less than min_tracked_partition_size (%s)\", writeSizeWarn, minTrackedSize));\n        }\n    }\n\n    private static void validateWriteTombstoneThresholdRange(int writeTombstoneWarn, long minTrackedTombstoneCount)\n    {\n        if (writeTombstoneWarn < -1)\n            throw new ConfigurationException(String.format(\"write_tombstone_warn_threshold (%d) must be -1 (disabled) or >= 0\", writeTombstoneWarn));\n\n        if (writeTombstoneWarn != -1 && writeTombstoneWarn < minTrackedTombstoneCount)\n            throw new ConfigurationException(String.format(\"write_tombstone_warn_threshold (%d) cannot be less than min_tracked_partition_tombstone_count (%d)\",\n                                                           writeTombstoneWarn, minTrackedTombstoneCount));\n    }\n\n    public static GuardrailsOptions getGuardrailsConfig()\n    {\n        return guardrails;\n    }\n\n    private static void applyGuardrails()\n    {\n        try\n        {\n            guardrails = new GuardrailsOptions(conf);\n        }\n        catch (IllegalArgumentException e)","sourceCodeStart":1367,"sourceCodeEnd":1403,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1367-L1403","documentation":"Startup validation error for the write_tombstone_warn_threshold setting: the value must be -1 (threshold disabled) or a non-negative quantity. Any value below -1 is rejected during DatabaseDescriptor config validation, before the threshold is used to warn on oversized writes.","triggerScenarios":"cassandra.yaml (or Config) with write_tombstone_warn_threshold set to -2 or any negative value other than -1, during DatabaseDescriptor validation.","commonSituations":"Operator using a negative number intending 'disable' but writing e.g. -100; scripted config generation emitting -1-with-offset values; misunderstanding that only exactly -1 disables the check.","solutions":["Set write_tombstone_warn_threshold to -1 to disable, or 0 or a positive count","Correct any accidental extra digits in a negative literal","Re-run startup after the fix"],"exampleFix":"// before (cassandra.yaml)\nwrite_tombstone_warn_threshold: -100\n// after\nwrite_tombstone_warn_threshold: -1","handlingStrategy":"validation","validationCode":"int t = conf.write_tombstone_warn_threshold;\nif (t < -1) throw new IllegalArgumentException(\"write_tombstone_warn_threshold must be -1 or >= 0: \" + t);","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); } catch (ConfigurationException e) { LOG.error(\"Bad tombstone warn threshold: \" + e.getMessage()); System.exit(1); }","preventionTips":["Use exactly -1 to disable; never other negatives","Constrain generated configs to {-1} ∪ [0,∞)","Review tombstone settings when tuning repair","Validate config in CI"],"tags":["configuration","tombstones","validation"],"backgroundTag":"value-out-of-range","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"}