Repository navigation
Split the largest functions; one replication builder - #137
Conversation
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. |
ed5c601 to
db6be71
Compare
21d2124 to
5ed2d30
Compare
db6be71 to
40d6bbe
Compare
There was a problem hiding this comment.
Approved. Cursor Bugbot was not present on this head after the first check poll, so that signal was skipped; Format, Clippy, Test, and Doc links all passed, and no approval policy on the base branch required human review. No prior approval from this automation was in place to keep or dismiss.
Sent by Cursor Approval Agent: Pull Request Router and Approver
40d6bbe to
7d5c8f1
Compare
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.


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.