{"record":{"id":"32152c144431d24e","repo":"apache/cassandra","slug":"threshold-value-for-gc-concurrent-phase-log-thresh","errorCode":null,"errorMessage":"Threshold value for gc_concurrent_phase_log_threshold (%d) must be less than gc_concurrent_phase_warn_threshold which is currently %d","messagePattern":"Threshold value for gc_concurrent_phase_log_threshold \\((.+?)\\) must be less than gc_concurrent_phase_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":5066,"sourceCode":"            throw new IllegalArgumentException(\"Threshold value for gc_warn_threshold (\" + threshold + \") must be greater than gc_log_threshold which is currently \"\n                                               + gcLogThresholdInMs);\n\n        conf.gc_warn_threshold = new DurationSpec.IntMillisecondsBound(threshold);\n    }\n\n    public static int getGCConcurrentPhaseLogThreshold()\n    {\n        return conf.gc_concurrent_phase_log_threshold.toMilliseconds();\n    }\n\n    public static void setGCConcurrentPhaseLogThreshold(int threshold)\n    {\n        if (threshold <= 0)\n            throw new IllegalArgumentException(\"Threshold must be greater than 0\");\n\n        long gcConcurrentPhaseWarnThresholdInMs = getGCConcurrentPhaseWarnThreshold();\n        if (gcConcurrentPhaseWarnThresholdInMs != 0 && threshold > gcConcurrentPhaseWarnThresholdInMs)\n            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 \"","sourceCodeStart":5048,"sourceCodeEnd":5084,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L5048-L5084","documentation":"setGCConcurrentPhaseLogThreshold enforces ordering with the warn threshold: when a warn threshold is active (non-zero), the log threshold must be strictly less than it. A log threshold >= warn threshold is rejected because it would never fire before the warn condition.","triggerScenarios":"Calling setGCConcurrentPhaseLogThreshold(threshold) while getGCConcurrentPhaseWarnThreshold() is non-zero and threshold >= that warn threshold; e.g. log=20000 with warn=10000.","commonSituations":"cassandra.yaml where gc_concurrent_phase_log_threshold was raised above or set equal to gc_concurrent_phase_warn_threshold, or programmatic updates applied in the wrong order.","solutions":["Lower the log threshold to be strictly less than getGCConcurrentPhaseWarnThreshold()","Raise gc_concurrent_phase_warn_threshold first via setGCConcurrentPhaseWarnThreshold","Set the warn threshold to 0 to disable the cross-check"],"exampleFix":"// before\nDatabaseDescriptor.setGCConcurrentPhaseWarnThreshold(10000);\nDatabaseDescriptor.setGCConcurrentPhaseLogThreshold(20000); // throws\n// after\nDatabaseDescriptor.setGCConcurrentPhaseWarnThreshold(30000);\nDatabaseDescriptor.setGCConcurrentPhaseLogThreshold(20000);","handlingStrategy":"validation","validationCode":"if (logMs >= DatabaseDescriptor.getGCConcurrentPhaseWarnThreshold() && DatabaseDescriptor.getGCConcurrentPhaseWarnThreshold() != 0) throw new IllegalArgumentException(\"gc_concurrent_phase_log_threshold must be < warn threshold\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.setGCConcurrentPhaseLogThreshold(log); } catch (IllegalArgumentException e) { logger.error(\"gc threshold ordering violated: {}\", e.getMessage()); }","preventionTips":["Set the warn threshold first, then the log threshold","Enforce log < warn invariant in your config validation layer","Keep gc_concurrent_phase_warn_threshold > gc_concurrent_phase_log_threshold in cassandra.yaml"],"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"}