{"record":{"id":"793eb3babce6f239","repo":"apache/cassandra","slug":"s-s-must-be-greater-than-or-equal-to-s-s","errorCode":null,"errorMessage":"%s (%s) must be greater than or equal to %s (%s)","messagePattern":"(.+?) \\((.+?)\\) must be greater than or equal to (.+?) \\((.+?)\\)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1368,"sourceCode":"    static void applyThresholdsValidations(Config config)\n    {\n        // Validate read thresholds\n        validateReadThresholds(\"coordinator_read_size\", config.coordinator_read_size_warn_threshold, config.coordinator_read_size_fail_threshold);\n        validateReadThresholds(\"local_read_size\", config.local_read_size_warn_threshold, config.local_read_size_fail_threshold);\n        validateReadThresholds(\"row_index_read_size\", config.row_index_read_size_warn_threshold, config.row_index_read_size_fail_threshold);\n\n        // Write threshold warning depends on top_partitions tracking\n        if (config.write_thresholds_enabled && !config.top_partitions_enabled)\n            logger.warn(\"Write thresholds require top partitions tracking to be enabled\");\n\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","sourceCodeStart":1350,"sourceCodeEnd":1386,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1350-L1386","documentation":"Read-related failure thresholds must be greater than or equal to their warn thresholds. validateReadThresholds compares fail.toBytes() against warn.toBytes() and throws this formatted ConfigurationException when the fail threshold is smaller than the warn threshold.","triggerScenarios":"Config where e.g. read_size_fail_threshold (in bytes) < read_size_warn_threshold, or coordinator_read_size_fail_threshold < coordinator_read_size_warn_threshold, checked during DatabaseDescriptor threshold validation at startup.","commonSituations":"Setting fail and warn thresholds in different units so the fail value converts smaller (e.g. warn in MiB, fail in KiB); incrementing warn without adjusting fail; copy-paste swapping the two values.","solutions":["Set the *_fail_threshold value >= the corresponding *_warn_threshold value","Check both values' units/suffixes so byte comparison is as intended","Read the exception's formatted values to see the actual parsed bounds","Align warn/fail pairs whenever tuning either one"],"exampleFix":"// before (cassandra.yaml)\nread_size_warn_threshold: 64MiB\nread_size_fail_threshold: 32MiB\n// after\nread_size_warn_threshold: 64MiB\nread_size_fail_threshold: 128MiB","handlingStrategy":"validation","validationCode":"if (readSizeFail != null && readSizeWarn != null && readSizeFail.toBytes() < readSizeWarn.toBytes())\n    throw new IllegalArgumentException(\"fail threshold must be >= warn threshold\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); } catch (ConfigurationException e) { LOG.error(\"Read threshold ordering invalid: \" + e.getMessage()); System.exit(1); }","preventionTips":["Always keep fail >= warn pairs","Write thresholds in the same unit to ease comparison","Review warn/fail pairs in config diffs","Read the formatted exception values to find the pair"],"tags":["configuration","validation","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"}