{"record":{"id":"adfb82acc8caa66a","repo":"apache/cassandra","slug":"write-size-warn-threshold-s-cannot-be-less-than","errorCode":null,"errorMessage":"write_size_warn_threshold (%s) cannot be less than min_tracked_partition_size (%s)","messagePattern":"write_size_warn_threshold \\((.+?)\\) cannot be less than min_tracked_partition_size \\((.+?)\\)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1378,"sourceCode":"\n        validateWriteSizeThreshold(config.write_size_warn_threshold, config.min_tracked_partition_size);\n        validateWriteTombstoneThresholdRange(config.write_tombstone_warn_threshold, config.min_tracked_partition_tombstone_count);\n    }\n\n    private static void validateReadThresholds(String name, DataStorageSpec.LongBytesBound warn, DataStorageSpec.LongBytesBound fail)\n    {\n        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","sourceCodeStart":1360,"sourceCodeEnd":1396,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1360-L1396","documentation":"write_size_warn_threshold cannot be below min_tracked_partition_size: the warn gate must trigger no earlier than partitions start being tracked, otherwise tracking is meaningless. validateWriteSizeThreshold throws this ConfigurationException when writeSizeWarn.toBytes() < minTrackedSize.toBytes().","triggerScenarios":"cassandra.yaml with write_size_warn_threshold smaller than min_tracked_partition_size (both non-null), validated at startup by DatabaseDescriptor.","commonSituations":"Lowering the warn threshold for earlier warnings without realizing it must stay above the tracking floor; units mismatch making the warn value smaller in bytes; upgrading and carrying over older defaults that now conflict.","solutions":["Raise write_size_warn_threshold to be >= min_tracked_partition_size","Lower min_tracked_partition_size below the warn threshold","Verify unit suffixes so the byte comparison matches intent","Use the exception values to see exactly which parsed bounds conflict"],"exampleFix":"// before (cassandra.yaml)\nwrite_size_warn_threshold: 4MiB\nmin_tracked_partition_size: 8MiB\n// after\nwrite_size_warn_threshold: 16MiB\nmin_tracked_partition_size: 8MiB","handlingStrategy":"validation","validationCode":"if (writeSizeWarn != null && minTrackedSize != null && writeSizeWarn.toBytes() < minTrackedSize.toBytes())\n    throw new IllegalArgumentException(\"write_size_warn_threshold < min_tracked_partition_size\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); } catch (ConfigurationException e) { LOG.error(\"Write size thresholds invalid: \" + e.getMessage()); System.exit(1); }","preventionTips":["Keep write_size_warn_threshold >= min_tracked_partition_size","Use consistent units for both settings","Revisit paired thresholds on upgrades","Validate yaml in CI before deploy"],"tags":["configuration","thresholds","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"}