{"record":{"id":"4d169b2d8c6a25a4","repo":"apache/cassandra","slug":"write-tombstone-warn-threshold-d-cannot-be-less","errorCode":null,"errorMessage":"write_tombstone_warn_threshold (%d) cannot be less than min_tracked_partition_tombstone_count (%d)","messagePattern":"write_tombstone_warn_threshold \\((.+?)\\) cannot be less than min_tracked_partition_tombstone_count \\((.+?)\\)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1388,"sourceCode":"                                                           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)\n        {\n            throw new ConfigurationException(\"Invalid guardrails configuration: \" + e.getMessage(), e);\n        }","sourceCodeStart":1370,"sourceCodeEnd":1406,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1370-L1406","documentation":"When enabled (not -1), write_tombstone_warn_threshold must be >= min_tracked_partition_tombstone_count; warning about tombstones that fall below the tracking floor is contradictory. validateWriteTombstoneThresholdRange throws this ConfigurationException otherwise.","triggerScenarios":"cassandra.yaml where write_tombstone_warn_threshold (>=0) < min_tracked_partition_tombstone_count, validated at startup by DatabaseDescriptor.","commonSituations":"Raising min_tracked_partition_tombstone_count to reduce overhead but leaving the old warn threshold; tuning one knob in one upgrade and not the paired one; units confusion (thresholds are counts, easy to mix with size settings).","solutions":["Raise write_tombstone_warn_threshold to >= min_tracked_partition_tombstone_count","Lower min_tracked_partition_tombstone_count below the warn threshold","Set write_tombstone_warn_threshold to -1 if you want no warn gate","Keep the two values reviewed together when tuning"],"exampleFix":"// before (cassandra.yaml)\nwrite_tombstone_warn_threshold: 1000\nmin_tracked_partition_tombstone_count: 5000\n// after\nwrite_tombstone_warn_threshold: 10000\nmin_tracked_partition_tombstone_count: 5000","handlingStrategy":"validation","validationCode":"if (conf.write_tombstone_warn_threshold != -1\n    && conf.write_tombstone_warn_threshold < conf.min_tracked_partition_tombstone_count)\n    throw new IllegalArgumentException(\"warn threshold below min tracked tombstone count\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); } catch (ConfigurationException e) { LOG.error(\"Tombstone thresholds invalid: \" + e.getMessage()); System.exit(1); }","preventionTips":["Tune write_tombstone_warn_threshold and min_tracked_partition_tombstone_count together","Keep warn >= tracked floor","Document the pairing in ops runbooks","Check both after upgrades"],"tags":["configuration","tombstones","thresholds"],"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"}