Repository navigation
Gate test-only helpers; fix and enable clippy performance lints - #138
austin-barrington wants to merge 9 commits into
Conversation
PR SummaryLow Risk Overview Test surface cleanup: helpers that are unit-test-only are Lint-driven refactors across lib, benches, and tests: drop redundant Reviewed by Cursor Bugbot for commit 985270c. Configure here. |
consensus.propose returns Ok for a committed op that the apply refused (a stale epoch). Drain ignored ClusterResponse.ok, so a refused TransferPrimary counted as handed off. Check it, as the shard scheduler does.
flushed_through started at 0 on open, while last_sequence is restored from disk. Only the flush truncates, so every entry below the oldest one left was flushed. With the mark at 0, every DELETE and DROP SERIES on a restarted node that had nothing left to flush waited the full 15 s for it, inside the Raft apply on replicated nodes.
drop_series wiped the measurement's series metadata, then built the delete predicate, which refuses a field or an unknown tag. A refused DROP SERIES returned an error and left SHOW SERIES empty. Build every predicate first. DROP SERIES with no FROM deleted rows only on a sharded node; on a single node it dropped the series and kept every row, which tombstones no longer hide. It now deletes them everywhere.
A peer deletes a DELETE's rows from its whole table after waiting up to 15 s for its WAL to flush. The coordinator sent one request per region on the 5 s peer timeout: a peer leading K regions ran K full-table deletes, and under steady ingest the coordinator timed out and reported a failed delete that the peer then carried out. Send each primary one request, with the flush wait plus the peer timeout to answer in.
is_unknown_table matched "Code: 60", which codes 600-609 also start with, and a delete that failed with one reported success. is_unknown_column matched "Code: 47" (470-479), and a replica stored such a failed delete as a tombstone. Match "Code: 60." and "Code: 47.".
The deep-dive and developer guides still pointed at adapters/cluster/sync_client.rs, which became CatchUpService in application/cluster/catch_up.rs. Also drop a repeated #[doc(hidden)] and a repeated doc line, and move apply_shard_map_op's doc comment from `mod apply;` onto the function.
Stacked on #137. Plan:
docs/superpowers/plans/2026-11-03-lint-and-test-support-cleanup.md.Test-only helpers leave production builds.
#[cfg(test)], along with one private function and one import that only they used.#[doc(hidden)]and a "Test support." line.Clippy performance findings are fixed:
Box::pinned;needless_collect, nowany;or(...)calls, now lazy;take_qps: the guard ends atremove;batching_wal'sdrain(..)stays, with a reason: the buffer is reused.[lints.clippy]in all three crates:redundant_clone,large_futures,needless_collect,iter_with_drainandor_fun_call, made errors by CI's-D warnings.significant_drop_tighteningstays off.No behaviour change. Gate: fmt,
clippy --workspace --all-targets -D warnings, unit, integration 376 and CLI 54 tests all pass.