Repository navigation
quest: settle #4761 follow-ups #4765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,13 +4,16 @@ | |
|
|
||
| A route change under a prefix (join, withdraw, re-price, restale) makes the | ||
| origin driver act only on the fronts that could change their selection: | ||
| fronts still waiting for a source, and fronts the changed route serves or is | ||
| requesting through. Today it wakes every front below the prefix, so one | ||
| equal-cost pool member joining or leaving a prefix that serves 10k paths | ||
| costs the driver 100 to 600 ms of single-threaded work while no front | ||
| switches (`origin/pool_churn`, #4607). A root claim, such as an archive's | ||
| catch-all, makes every front on the relay pay for every change to it. Done | ||
| when `origin/pool_churn` is flat in served paths. | ||
| fronts still waiting for a source, fronts the changed route serves or is | ||
| requesting through, and, on a join or re-price, the serving fronts the | ||
| changed route could now win. Today it wakes every front below the prefix, | ||
| so one equal-cost pool member joining or leaving a prefix that serves 10k | ||
| paths costs the driver 100 to 600 ms of single-threaded work while few | ||
| fronts switch (`origin/pool_churn`, #4607). A root claim, such as an | ||
| archive's catch-all, makes every front on the relay pay for every change to | ||
| it. Done when a leave in `origin/pool_churn` is flat in served paths, and a | ||
| join or re-price costs one cheap rehash per front below the prefix, with | ||
| no `select`, track poll, or deadline scan for a front that keeps its route. | ||
|
|
||
| ## Plan | ||
|
|
||
|
|
@@ -21,7 +24,8 @@ Facts from the wildcard line (`rs/moq-net/src/model/origin.rs` there): | |
| below the prefix, so a woken front cannot tell what changed. Each re-runs | ||
| `select` under the table read lock (`retain_routes`, then `best_route`, | ||
| which hashes every pool member unless a serving front's route still | ||
| serves), then the driver polls every track and rescans deadlines. | ||
| serves; that `Pin::Stay` short-circuit goes with the follow-the-best-route | ||
| rule below), then the driver polls every track and rescans deadlines. | ||
| - `route_order` is rendezvous-style: FNV over the path and hop ids, lowest | ||
| wins. A join moves only paths the newcomer wins, a leave only paths the | ||
| leaver was winning. | ||
|
|
@@ -45,20 +49,21 @@ Decisions: | |
| them when it closes. The lookup walks descendants but skips subtrees whose | ||
| waiting set is empty, keeping cost in woken fronts rather than served | ||
| paths. | ||
| - A serving front stays on its route while it serves, per the wildcard line's | ||
| Stay decision, so a join or re-price never wakes it; it moves only on | ||
| failover. (2026-09-30) | ||
| - A serving front follows the best route, per the wildcard line (decided | ||
| 2026-10-04, replacing Stay). A join or re-price must rehash every front | ||
| below the prefix, since rendezvous moves exactly the paths the changed | ||
| route now wins; only those fronts re-select. A leave wakes only the fronts | ||
|
Comment on lines
+53
to
+55
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚀 Performance & Scalability | 🟠 Major | 🏗️ Heavy lift 🔎 Supported by static analysis🏁 Script executed: sed -n '10,18p;35,57p;60,69p' quest/m1/route-wakes.md
sed -n '125,145p' rs/moq-net/src/model/weak_cache.rsRepository: moq-dev/moq Length of output: 3216 🏁 Script executed: git diff --no-ext-diff --unified=4 51fb087117e56979b0f96689fa07abbb4209a3fb 2b9342140a532dc804b2aa7b011c0a885d86f73c -- quest/m1/route-wakes.md | sed -n '1,180p'
printf '\n--- origin fronts declaration ---\n'
sed -n '3364,3380p' rs/moq-net/src/model/origin.rs
printf '\n--- route entry declaration ---\n'
sed -n '846,943p' rs/moq-net/src/model/origin.rs
printf '\n--- weak cache iteration ---\n'
sed -n '125,145p' rs/moq-net/src/model/weak_cache.rsRepository: moq-dev/moq Length of output: 9972 Add a prefix-scoped index of active fronts. The route associations and waiter sets do not include active fronts that a joining or repriced route may newly win. Suggested fix- only its waiting fronts and `routed_broadcast` waiters. A payload filter
+ only its waiting fronts and `routed_broadcast` waiters. Add a separate
+ active-front index for prefix enumeration, maintained as fronts select and
+ close. A payload filter
would still walk every watch under the prefix, which stays linear in paths.🤖 Prompt for AI Agents |
||
| the leaver served or was requesting through. | ||
|
Comment on lines
+55
to
+56
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -euo pipefail
ast-grep outline rs/moq-net/src/model/origin.rs --items all
rg -n -C 4 'routed_broadcast|poke_below|sync_route|withdraw|wait' rs/moq-net/src/model/origin.rs
rg -n -C 4 'advertise.only|parked|waiter|withdraw' rs/moq-netRepository: moq-dev/moq Length of output: 45665 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- doc lines 1-90 ---'
cat -n quest/m1/route-wakes.md | sed -n '1,95p'
printf '%s\n' '--- merge-base to head doc diff ---'
git diff --unified=5 51fb087117e56979b0f96689fa07abbb4209a3fb 2b9342140a532dc804b2aa7b011c0a885d86f73c -- quest/m1/route-wakes.md
printf '%s\n' '--- route table and route sync ---'
sed -n '3035,3248p' rs/moq-net/src/model/origin.rs
sed -n '3340,3650p' rs/moq-net/src/model/origin.rs
printf '%s\n' '--- directly relevant tests ---'
rg -n -C 8 'advertise.only|parked|withdraw.*wait|wait.*withdraw|unroutable|withdrawn_route_no_longer_covers_requests|route_changes_preserve_each_cursors_visible_winner' rs/moq-net/src/model/origin.rsRepository: moq-dev/moq Length of output: 42292 🤖 get_repo_knowledge executed:
Length of output: 9019 🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 18 'fn sync_route|fn watch\(|fn poke_below\(|pub async fn routed_broadcast|async fn routed_broadcast_|fn withdraw\(' rs/moq-net/src/model/origin.rs
printf '%s\n' '--- routed broadcast retry test ---'
sed -n '7440,7470p' rs/moq-net/src/model/origin.rs
printf '%s\n' '--- route change retry tests ---'
sed -n '7488,7520p' rs/moq-net/src/model/origin.rsRepository: moq-dev/moq Length of output: 20377 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- routed_broadcast request/watch loop ---'
sed -n '4396,4448p' rs/moq-net/src/model/origin.rs
printf '%s\n' '--- route retraction ---'
sed -n '2035,2094p' rs/moq-net/src/model/origin.rs
printf '%s\n' '--- route removal and sync calls ---'
rg -n -C 5 'sync_route\(prefix|fn retract|routes\.remove\(' rs/moq-net/src/model/origin.rsRepository: moq-dev/moq Length of output: 7387 Include parked waiters in leave wakeups.
Suggested wording- A leave wakes only the fronts
- the leaver served or was requesting through.
+ A leave wakes waiting fronts and `routed_broadcast` waiters below the prefix,
+ plus fronts the leaver served or was requesting through.🤖 Prompt for AI Agents |
||
| - Builds on shared-fronts' keying, so the index hangs off the final front | ||
| identity. `origin-front-parks.md` replaces the `routed_broadcast` retry | ||
| loop, one of the watch consumers here; whichever lands second adapts it. | ||
| (2026-09-30) | ||
|
|
||
| Verification: `origin/pool_churn` flat in served paths at every pool width | ||
| it already sweeps, and a unit test that counts `select` calls per route | ||
| change and asserts only affected fronts re-select, with zero serving fronts | ||
| for an unrelated route's join and leave, and a parked waiter retrying when a | ||
| deeper advertise-only claim over a served root is withdrawn. Keep | ||
| `pool_resolve` unchanged. | ||
| Verification: `origin/pool_churn` leaves flat in served paths at every pool | ||
| width it already sweeps, and a unit test that counts `select` calls per | ||
| route change: zero for an unrelated route's leave, only the won paths on a | ||
| join, and a parked waiter retrying when a deeper advertise-only claim over a | ||
| served root is withdrawn. Keep `pool_resolve` unchanged. | ||
|
|
||
| Public API: none. Wire: none. | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win
Align route selection with the route-wakes contract.
The route-wakes contract in the PR context rehashes every front but runs
selectonly for paths that move. This wording requires re-selecting every front, including fronts whose winning route stays unchanged. Change it to require rehashing every front and selecting only paths that move.Proposed wording
🤖 Prompt for AI Agents