Repository navigation
Split the largest functions; one replication builder - #137
austin-barrington wants to merge 4 commits into
Conversation
The 19 inline replicate arms in PeerQueryService::execute_query become one path over mutation_request_from_statement. The golden test passed unchanged: the builder already matched every arm. Retention policy statements still run locally against their own ON <db>, and a CQ/MV/password build failure is still reported on the statement.
PR SummaryMedium Risk Overview Cluster peer execution ( Query execution moves the bulk of Sharding splits Testing adds Reviewed by Cursor Bugbot for commit ed5c601. Configure here. |
Stacked on #136. Plan:
docs/superpowers/plans/2026-11-03-split-large-functions.md.This splits the three largest functions without changing behaviour:
tests/compat/cluster_replication_tests.rswithtestdata/replicated_mutations.json). It records what each non-Raft cluster statement replicates and each statement's result. It covers all 19 replicating statement kinds, a cross-databaseCREATE RETENTION POLICY, and an invalidSET, and checks that users carry an argon2 hash, never the password. The test was committed before the refactor and passes unchanged after it.PeerQueryService::execute_query, 578 → 84 lines. The 19 inline replicate arms are now one path overmutation_request_from_statement. Retention-policy statements still run locally against their ownON <db>. CQ, MV and password build failures are still reported on the statement.execute_statement, 1,228 → 182 lines. 31 arms moved verbatim intoquery_service/statements/{show_schema,show_catalog,ddl,delete,users,select}.rs.apply_shard_map_op, 426 → 85 lines. One function per op is now indomain/sharding/ops/apply.rs. Themap_versionbump stays in the dispatcher;refused_op_still_bumps_versioncovers it.One narrow change the review found: a CREATE MATERIALIZED VIEW whose source-metadata read fails after the local create now reports a statement error instead of failing the whole request.
Gate: fmt, clippy
-D warnings, unit, integration 376 and CLI 54 tests all pass.