{"record":{"id":"8f0336a9e0d95ee3","repo":"apache/cassandra","slug":"inter-dc-stream-throughput-outbound-is-too-large","errorCode":null,"errorMessage":"inter_dc_stream_throughput_outbound: is too large; it should be less than 2147483647 in megabits/s","messagePattern":"inter_dc_stream_throughput_outbound: is too large; it should be less than 2147483647 in megabits/s","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":3241,"sourceCode":"    public static double getInterDCStreamThroughputOutboundMebibytesPerSec()\n    {\n        return conf.inter_dc_stream_throughput_outbound.toMebibytesPerSecond();\n    }\n\n    public static double getInterDCStreamThroughputOutboundBytesPerSec()\n    {\n        return conf.inter_dc_stream_throughput_outbound.toBytesPerSecond();\n    }\n\n    public static int getInterDCStreamThroughputOutboundMebibytesPerSecAsInt()\n    {\n        return conf.inter_dc_stream_throughput_outbound.toMebibytesPerSecondAsInt();\n    }\n\n    public static void setInterDCStreamThroughputOutboundMebibytesPerSecAsInt(int value)\n    {\n        if (MEBIBYTES_PER_SECOND.toMegabitsPerSecond(value) >= Integer.MAX_VALUE)\n            throw new IllegalArgumentException(\"inter_dc_stream_throughput_outbound: \" + value +\n                                               \" is too large; it should be less than \" +\n                                               Integer.MAX_VALUE + \" in megabits/s\");\n\n        conf.inter_dc_stream_throughput_outbound = new DataRateSpec.LongBytesPerSecondBound(value, MEBIBYTES_PER_SECOND);\n    }\n\n    public static void setInterDCStreamThroughputOutboundBytesPerSec(long value)\n    {\n        conf.inter_dc_stream_throughput_outbound = new DataRateSpec.LongBytesPerSecondBound(value, BYTES_PER_SECOND);\n    }\n\n    public static void setInterDCStreamThroughputOutboundMegabitsPerSec(int value)\n    {\n        conf.inter_dc_stream_throughput_outbound = DataRateSpec.LongBytesPerSecondBound.megabitsPerSecondInBytesPerSecond(value);\n    }\n\n    public static double getEntireSSTableInterDCStreamThroughputOutboundBytesPerSec()\n    {","sourceCodeStart":3223,"sourceCodeEnd":3259,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L3223-L3259","documentation":"setInterDCStreamThroughputOutboundMebibytesPerSecAsInt converts MiB/s to megabits/s and rejects values converting to >= Integer.MAX_VALUE megabits/s, since the DataRateSpec outbound inter-DC bound is limited to the int-representable megabits/s range.","triggerScenarios":"Calling DatabaseDescriptor.setInterDCStreamThroughputOutboundMebibytesPerSecAsInt(value) where MEBIBYTES_PER_SECOND.toMegabitsPerSecond(value) >= 2147483647 (huge values or Integer.MIN_VALUE overflow).","commonSituations":"Max-int sentinels as 'unlimited' inter-DC throttling; unvalidated JMX/script input; unit confusion megabits vs mebibytes.","solutions":["Pass a realistic inter-DC streaming rate in MiB/s below the cap.","Validate the converted megabits/s value before calling.","Clamp or reject sentinel values (Integer.MAX_VALUE/MIN_VALUE) at the call site."],"exampleFix":"// before\nDatabaseDescriptor.setInterDCStreamThroughputOutboundMebibytesPerSecAsInt(Integer.MAX_VALUE);\n// after\nDatabaseDescriptor.setInterDCStreamThroughputOutboundMebibytesPerSecAsInt(100);","handlingStrategy":"validation","validationCode":"long mbits = DataRateSpec.DataRateUnit.MEBIBYTES_PER_SECOND.toMegabitsPerSecond(mibPerSec);\nif (mbits < Integer.MAX_VALUE) DatabaseDescriptor.setInterDCStreamThroughputOutboundMebibytesPerSecAsInt(mibPerSec);","typeGuard":"boolean isValidInterDCStreamMib(int v) { return v >= 0 && DataRateSpec.DataRateUnit.MEBIBYTES_PER_SECOND.toMegabitsPerSecond(v) < Integer.MAX_VALUE; }","tryCatchPattern":"try { DatabaseDescriptor.setInterDCStreamThroughputOutboundMebibytesPerSecAsInt(v); } catch (IllegalArgumentException e) { log.error(\"inter_dc_stream_throughput_outbound too large: {}\", v, e); }","preventionTips":["Model the MiB/s -> megabits/s conversion in tooling","Avoid max/min-int sentinel values","Validate inputs from nodetool/JMX wrappers"],"tags":["configuration","streaming","throughput"],"backgroundTag":"value-out-of-range","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"}