{"record":{"id":"4c09e94757a1d6fb","repo":"apache/cassandra","slug":"threshold-value-for-gc-log-threshold-d-must-be","errorCode":null,"errorMessage":"Threshold value for gc_log*_threshold (%d) must be less than gc_warn*_threshold which is currently %d","messagePattern":"Threshold value for gc_log\\*_threshold \\((.+?)\\) must be less than gc_warn\\*_threshold which is currently (.+?)","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":5023,"sourceCode":"    {\n        validateGCParams(threshold, getGCWarnThreshold());\n        conf.gc_log_threshold = new DurationSpec.IntMillisecondsBound(threshold);\n    }\n\n    public static void validateGCParams(long logThreshold, long warnThreshold)\n    {\n        if (logThreshold <= 0)\n            throw new IllegalArgumentException(\"Threshold value for gc_log*_threshold must be greater than 0\");\n        if (logThreshold > Integer.MAX_VALUE)\n            throw new IllegalArgumentException(\"Threshold value for gc_log*_threshold must be less than Integer.MAX_VALUE\");\n\n        if (warnThreshold <= 0)\n            throw new IllegalArgumentException(\"Threshold value for gc_warn*_threshold must be greater than 0\");\n        if (warnThreshold > Integer.MAX_VALUE)\n            throw new IllegalArgumentException(\"Threshold value for gc_warn*_threshold must be less than Integer.MAX_VALUE\");\n\n        if (warnThreshold != 0 && logThreshold > warnThreshold)\n            throw new IllegalArgumentException(\"Threshold value for gc_log*_threshold (\" + logThreshold + \") must be less than gc_warn*_threshold which is currently \"\n                    + warnThreshold);\n    }\n\n    public static EncryptionContext getEncryptionContext()\n    {\n        return encryptionContext;\n\n    }\n\n    public static long getGCWarnThreshold()\n    {\n        return conf.gc_warn_threshold.toMilliseconds();\n    }\n\n    public static void setGCWarnThreshold(long threshold)\n    {\n        if (threshold < 0)\n            throw new IllegalArgumentException(\"Threshold value for gc_warn_threshold must be greater than or equal to 0\");","sourceCodeStart":5005,"sourceCodeEnd":5041,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L5005-L5041","documentation":"Cassandra throws this IllegalArgumentException when the GC log threshold is greater than the GC warn threshold (and warn threshold is non-zero). A pause must be logged before it is warned, so gc_log_threshold must be strictly less than gc_warn_threshold.","triggerScenarios":"Calling validateGCParams(logThreshold, warnThreshold) with warnThreshold != 0 and logThreshold > warnThreshold; also startup validation when cassandra.yaml has gc_log_threshold >= gc_warn_threshold.","commonSituations":"Operators raising the log threshold above the warn threshold while tuning, or swapping the two values in cassandra.yaml.","solutions":["Ensure gc_log_threshold < gc_warn_threshold (e.g. log=200ms, warn=1000ms)","Swap the values if they were entered in the wrong order","Re-validate after changing either threshold via JMX"],"exampleFix":"// before (cassandra.yaml)\ngc_log_threshold: 2000ms\ngc_warn_threshold: 1000ms\n// after\ngc_log_threshold: 200ms\ngc_warn_threshold: 1000ms","handlingStrategy":"validation","validationCode":"if (warnThreshold != 0 && logThreshold >= warnThreshold)\n    throw new IllegalArgumentException(\"gc_log_threshold must be less than gc_warn_threshold\");","typeGuard":null,"tryCatchPattern":"try {\n    DatabaseDescriptor.validateGCParams(logThreshold, warnThreshold);\n} catch (IllegalArgumentException e) {\n    logger.error(\"GC thresholds misordered: log must be < warn\", e);\n}","preventionTips":["Always set log threshold strictly below warn threshold (e.g. 200ms / 1000ms)","Review both values together when editing cassandra.yaml","Call validateGCParams after any runtime GC threshold change"],"tags":["configuration","gc","jvm"],"backgroundTag":"conflicting-config-options","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"}