tursodatabase/turso · error
--queries requires --benchmark search
Error message
--queries requires --benchmark search
What it means
The throughput benchmark is time-based and derives its workload from --seconds, not a query count. ensure! at perf/fts/src/main.rs:93 rejects --queries when --benchmark throughput is selected, since a fixed query count contradicts the run-until-duration model.
Solutions
- Remove --queries when running --benchmark throughput
- Keep --queries and switch back to --benchmark search (the default)
- Make the wrapper script pass --queries only for search mode
Example fix
// before fts-bench --benchmark throughput --queries 1000 --seconds 10 // after fts-bench --benchmark throughput --seconds 10
Defensive patterns
Strategy: validation
Validate before calling
if benchmark == Throughput && queries.is_some() { panic!("--queries only applies to the search benchmark"); } Prevention
- Use template commands per benchmark mode instead of one parameterized line
- Pass --queries conditionally in wrapper scripts based on benchmark
- Run the binary with --help when flags stop being accepted
When it happens
Trigger: Running `fts-bench --benchmark throughput --queries 1000`: ensure! fires because args.queries.is_some() in the Throughput branch. Happens whenever a search-style invocation is switched to throughput without dropping --queries.
Common situations: Reusing a search-benchmark command line for throughput runs; scripts parameterizing both --queries and --seconds and passing both unconditionally.
Understand the failure class
Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.
Related errors
- first-query latency requires one query per connection
- need at least one query per connection
- seconds must be finite and positive
- --seconds requires --benchmark throughput
- throughput requires --state warm
AI-assisted analysis of tursodatabase/turso@8d4a589f8d (2026-09-20).
Data as JSON: /api/errors/a265ff9bed991f80.
Report an issue: GitHub.
Appendix: source
Thrown at perf/fts/src/main.rs:93
let queries = args
.queries
.unwrap_or(if matches!(args.state, QueryState::First) {
args.connections
} else {
10_000
});
ensure!(
queries >= args.connections,
"need at least one query per connection"
);
ensure!(
!matches!(args.state, QueryState::First) || queries == args.connections,
"first-query latency requires one query per connection"
);
(queries, 0.0)
}
Benchmark::Throughput => {
ensure!(
args.queries.is_none(),
"--queries requires --benchmark search"
);
ensure!(
matches!(args.state, QueryState::Warm),
"throughput requires --state warm"
);
let seconds = args.seconds.unwrap_or(5.0);
ensure!(
seconds.is_finite() && seconds > 0.0,
"seconds must be finite and positive"
);
(0, seconds)
}
};
#[cfg(all(feature = "flamegraph", any(target_os = "linux", target_os = "macos")))]
let profiled = args.flamegraph.is_some();
#[cfg(not(all(feature = "flamegraph", any(target_os = "linux", target_os = "macos"))))]View on GitHub (pinned to 8d4a589f8d)