apache/cassandra · warning · RuntimeException
Use the -d flag to quiet this error and get the exact…
Error message
Use the -d flag to quiet this error and get the exact throughput in MiB/s
What it means
GetCompactionThroughput prints the throughput as an integer when -d is absent; if the configured compaction throughput is a non-integer MiB/s value, it throws this RuntimeException telling the operator to use -d. It protects against silently rounding the value.
Solutions
- Run `nodetool getcompactionthroughput -d` to print the exact double value
- Set compaction_throughput_mb_per_sec to an integer in cassandra.yaml
- Update monitoring scripts to pass -d and parse a double
Example fix
// before nodetool getcompactionthroughput // after nodetool getcompactionthroughput -d
Defensive patterns
Strategy: validation
Validate before calling
// pass -d whenever fractional values are possible nodetool getcompactionthroughput -d
Try / catch
try { probe.execute(); } catch (RuntimeException e) { if (e.getMessage().contains("-d flag")) retryWithDoubleFlag(); } Prevention
- Always use -d in automation
- Keep compaction_throughput_mb_per_sec an integer if scripts rely on integer output
- Parse output as double
When it happens
Trigger: Running `nodetool getcompactionthroughput` when compaction_throughput_mb_per_sec in cassandra.yaml is set to a fractional value (e.g. 63.5) without the -d flag.
Common situations: Operators set fractional throughput values for tuning; monitoring scripts parse output and break on the thrown error; versions where the setting became a double.
Understand the failure class
Background: "unknown output mode", "invalid value for flag", "expects true/false": fixing invalid flag value errors in CLI tools — this error's family across 24 libraries.
Related errors
- Use the -d flag to quiet this error and get the exact…
- Use the -d flag to quiet this error and get the exact…
- argument for sort must be one of
- argument for top must be a positive integer.
- arguments for -F are json,yaml only.
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/f880c8d44b0229dd.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/tools/nodetool/GetCompactionThroughput.java:45
import picocli.CommandLine.Option;
@Command(name = "getcompactionthroughput", description = "Print the MiB/s throughput cap for compaction in the system as a rounded number")
public class GetCompactionThroughput extends AbstractCommand
{
@Option(names = { "-d", "--precise-mib" }, description = "Print the MiB/s throughput cap for compaction in the system as a precise number (double)")
private boolean compactionThroughputAsDouble;
@Override
public void execute(NodeProbe probe)
{
double throughput = probe.getCompactionThroughputMebibytesAsDouble();
if (compactionThroughputAsDouble)
probe.output().out.println("Current compaction throughput: " + throughput + " MiB/s");
else
{
if (!DoubleMath.isMathematicalInteger(throughput))
throw new RuntimeException("Use the -d flag to quiet this error and get the exact throughput in MiB/s");
probe.output().out.println("Current compaction throughput: " + probe.getCompactionThroughput() + " MiB/s");
}
Map<String, String> currentCompactionThroughputMetricsMap = probe.getCurrentCompactionThroughputMiBPerSec();
probe.output().out.println("Current compaction throughput (1 minute): " + currentCompactionThroughputMetricsMap.get("1minute") + " MiB/s");
probe.output().out.println("Current compaction throughput (5 minute): " + currentCompactionThroughputMetricsMap.get("5minute") + " MiB/s");
probe.output().out.println("Current compaction throughput (15 minute): " + currentCompactionThroughputMetricsMap.get("15minute") + " MiB/s");
}
}
View on GitHub (pinned to 88fd0f6a0e)