{"record":{"id":"0073f4a83b04db56","repo":"apache/cassandra","slug":"threshold-value-for-gc-concurrent-phase-warn-thres-0073f4","errorCode":null,"errorMessage":"Threshold value for gc_concurrent_phase_warn_threshold (%d) must be greater than gc_concurrent_phase_log_threshold which is currently %d","messagePattern":"Threshold value for gc_concurrent_phase_warn_threshold \\((.+?)\\) must be greater than gc_concurrent_phase_log_threshold which is currently (.+?)","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":5084,"sourceCode":"            throw new IllegalArgumentException(\"Threshold value for gc_concurrent_phase_log_threshold (\" + threshold + \") must be less than gc_concurrent_phase_warn_threshold which is currently \"\n                                               + gcConcurrentPhaseWarnThresholdInMs);\n\n        conf.gc_concurrent_phase_log_threshold = new DurationSpec.IntMillisecondsBound(threshold);\n    }\n\n    public static int getGCConcurrentPhaseWarnThreshold()\n    {\n        return conf.gc_concurrent_phase_warn_threshold.toMilliseconds();\n    }\n\n    public static void setGCConcurrentPhaseWarnThreshold(int threshold)\n    {\n        if (threshold < 0)\n            throw new IllegalArgumentException(\"Threshold value for gc_concurrent_phase_warn_threshold must be greater than or equal to 0\");\n\n        long gcConcurrentPhaseLogThresholdInMs = getGCConcurrentPhaseLogThreshold();\n        if (threshold != 0 && threshold <= gcConcurrentPhaseLogThresholdInMs)\n            throw new IllegalArgumentException(\"Threshold value for gc_concurrent_phase_warn_threshold (\" + threshold + \") must be greater than gc_concurrent_phase_log_threshold which is currently \"\n                                               + gcConcurrentPhaseLogThresholdInMs);\n\n        conf.gc_concurrent_phase_warn_threshold = new DurationSpec.IntMillisecondsBound(threshold);\n    }\n\n    public static boolean isCDCEnabled()\n    {\n        return conf.cdc_enabled;\n    }\n\n    @VisibleForTesting\n    public static void setCDCEnabled(boolean cdc_enabled)\n    {\n        conf.cdc_enabled = cdc_enabled;\n    }\n\n    public static boolean getCDCBlockWrites()\n    {","sourceCodeStart":5066,"sourceCodeEnd":5102,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L5066-L5102","documentation":"setGCConcurrentPhaseWarnThreshold requires that a non-zero warn threshold be strictly greater than the current gc_concurrent_phase_log_threshold, mirroring the log-threshold check. A warn threshold <= the log threshold would make the warning impossible to trigger before logging, so it is rejected.","triggerScenarios":"Calling setGCConcurrentPhaseWarnThreshold(threshold) where threshold != 0 and threshold <= getGCConcurrentPhaseLogThreshold(); e.g. warn=5000 with log=10000.","commonSituations":"Config edits where gc_concurrent_phase_warn_threshold was lowered below or set equal to gc_concurrent_phase_log_threshold; programmatic setters called out of order.","solutions":["Raise the warn threshold strictly above getGCConcurrentPhaseLogThreshold()","Lower the log threshold first via setGCConcurrentPhaseLogThreshold","Set the warn threshold to 0 to disable it"],"exampleFix":"// before\nDatabaseDescriptor.setGCConcurrentPhaseLogThreshold(10000);\nDatabaseDescriptor.setGCConcurrentPhaseWarnThreshold(5000); // throws\n// after\nDatabaseDescriptor.setGCConcurrentPhaseWarnThreshold(20000);\nDatabaseDescriptor.setGCConcurrentPhaseLogThreshold(10000);","handlingStrategy":"validation","validationCode":"if (warnMs != 0 && warnMs <= DatabaseDescriptor.getGCConcurrentPhaseLogThreshold()) throw new IllegalArgumentException(\"gc_concurrent_phase_warn_threshold must exceed log threshold\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.setGCConcurrentPhaseWarnThreshold(warn); } catch (IllegalArgumentException e) { logger.error(\"gc threshold ordering violated: {}\", e.getMessage()); }","preventionTips":["Set warn threshold before log threshold, or re-read current values first","Enforce warn > log ordering in config validation","Document that 0 disables the warn threshold"],"tags":["config","validation","gc","conflicting-config-options"],"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-17T15:17:12.973Z"}