refactor(shard): delete CoalescedReadBatch, and let the #416 harness toggle the fast path - #844
Conversation
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe benchmark harness now separates the cross-shard SPSC hop from the default foreign-read fast path. It preloads read keys and reports database size. The unused ChangesCross-shard fast-path measurement and retirement
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant CLI
participant moon_argv
participant MoonServer
participant BenchmarkCell
CLI->>moon_argv: pass extra server arguments
moon_argv->>MoonServer: build initial or retry argv
BenchmarkCell->>MoonServer: start selected fast-path mode
BenchmarkCell->>MoonServer: populate keyspace
BenchmarkCell->>MoonServer: run GET or SET measurement
MoonServer-->>BenchmarkCell: return results and dbsize
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a59a33d to
970d6c2
Compare
…toggle the fast path `CoalescedReadBatch` (src/shard/dispatch.rs) was the xshard-read-fastpath C3 type: N single-key foreign reads from different connections batched into one SPSC message to one owner shard. It was defined with the C1 types in PR #177, deferred at C3, and never wired: no `ShardMessage` arm, no `spsc_handler` arm, no config, no metric. Its only references were its own definition and a type-existence test. In the type index it read as a shipped cross-shard optimisation; it was not one. It is deleted rather than built because the measurement no longer supports building it. Its premise — "a foreign lock-free read is storage-impossible in place, so SPSC is the only door" — ended when L4 made `Database` `Send + Sync` and `try_foreign_db_read` began serving foreign reads on the calling thread (#777, default `auto` since #785). Re-measured at HEAD on moon#773's own fixture (GET p=1 c200, `--shards 8`, keyspace populated to `DBSIZE` 100,000, `keyspace_misses` 0) from a dedicated load generator: 99.0% of foreign reads served in place, `cross_spsc` 0.90% of commands, 0.0089 parks/cmd, against 87.5% / 0.866 parks/cmd with the flag off. Coalescing reduces `msgs/cmd`, the term the cost model fits at ~0, and would leave every remaining park in place (dead end #1); the wake-batching variant D1 was retired by measurement in #778. The re-take also found two things the docs now record (cost model §6, §8.3): the residual is the owner's exclusive guard on its own read paths (the inline GET at blocking.rs:2515 and every SPSC execute arm take `databases.write()`), and a same-host `redis-benchmark --threads 4` inflates that residual 15x (13.5-15.1% vs 0.90%) through lock-holder preemption on the oversubscribed box. §8's "100% in place / 0.0003 parks/cmd" is the c50 light-client number and is now stated as such. `scripts/gcloud-xshard-absolute.sh` (moon#416) passed a fixed server-argument list, so its `s4-c1-GET` cell silently stopped measuring the SPSC hop it is named for once the default flipped to `auto`. `start_moon`/`cell` now take extra server args (`--extra-args` / `MOON_EXTRA_ARGS`), read cells populate the keyspace and report `DBSIZE`, the default cell set measures the hop (`--cross-shard-fast-path off`) and the fast path as two cells of one A/B plus the write hop (`s4-c1-SET`), and `--self-test` fails closed if the passthrough stops reaching the server argv (mutation-tested: dropping `"$@"` fails gate 12). No behaviour changes: nothing constructed, sent or matched on the deleted type. Both runtimes checked with `--all-targets`; clippy clean. Refs: moon#773, moon#416, moon#777, moon#785, moon#778 author: Tin Dang
970d6c2 to
63595a3
Compare
CoalescedReadBatch(src/shard/dispatch.rs) was the xshard-read-fastpath C3type: N single-key foreign reads from different connections batched into one
SPSC message to one owner shard. It was defined with the C1 types in PR #177,
deferred at C3, and never wired: no
ShardMessagearm, nospsc_handlerarm,no config, no metric. Its only references were its own definition and a
type-existence test. In the type index it read as a shipped cross-shard
optimisation; it was not one.
It is deleted rather than built because the measurement no longer supports
building it. Its premise — "a foreign lock-free read is storage-impossible in
place, so SPSC is the only door" — ended when L4 made
DatabaseSend + Syncand
try_foreign_db_readbegan serving foreign reads on the calling thread(#777, default
autosince #785). Re-measured at HEAD on moon#773's ownfixture (GET p=1 c200,
--shards 8, keyspace populated toDBSIZE100,000,keyspace_misses0) from a dedicated load generator: 99.0% of foreign readsserved in place,
cross_spsc0.90% of commands, 0.0089 parks/cmd, against87.5% / 0.866 parks/cmd with the flag off. Coalescing reduces
msgs/cmd, theterm the cost model fits at ~0, and would leave every remaining park in place
(dead end #1); the wake-batching variant D1 was retired by measurement in #778.
The re-take also found two things the docs now record (cost model §6, §8.3):
the residual is the owner's exclusive guard on its own read paths (the inline
GET at blocking.rs:2515 and every SPSC execute arm take
databases.write()),and a same-host
redis-benchmark --threads 4inflates that residual 15x(13.5-15.1% vs 0.90%) through lock-holder preemption on the oversubscribed
box. §8's "100% in place / 0.0003 parks/cmd" is the c50 light-client number
and is now stated as such.
scripts/gcloud-xshard-absolute.sh(moon#416) passed a fixed server-argumentlist, so its
s4-c1-GETcell silently stopped measuring the SPSC hop it isnamed for once the default flipped to
auto.start_moon/cellnow takeextra server args (
--extra-args/MOON_EXTRA_ARGS), read cells populatethe keyspace and report
DBSIZE, the default cell set measures the hop(
--cross-shard-fast-path off) and the fast path as two cells of one A/B plusthe write hop (
s4-c1-SET), and--self-testfails closed if the passthroughstops reaching the server argv (mutation-tested: dropping
"$@"fails gate 12).No behaviour changes: nothing constructed, sent or matched on the deleted type.
Both runtimes checked with
--all-targets; clippy clean.Refs: moon#773, moon#416, moon#777, moon#785, moon#778
author: Tin Dang
Summary by CodeRabbit
Documentation
Chores