revert(router): keep session affinity local [DYN-3249] - #11217
Conversation
Signed-off-by: PeaBrane <yanrpei@gmail.com>
WalkthroughThis PR replaces the distributed, claim-based session affinity model with a simplified router-local binding model. The ChangesSession affinity model simplification
Unrelated storage/runtime fixes
Estimated code review effort: 5 (Critical) | ~120 minutes Related PRs: None specified. Suggested labels: area/router, area/session-affinity, breaking-change, needs-rust-review Suggested reviewers: Reviewers familiar with the kv_router and session_affinity crates in lib/llm and lib/runtime discovery modules. 🐰 A claim once bound the session tight, 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/runtime/src/storage/kv/file.rs`:
- Line 493: The delete handling in the event match is too narrow because
`notify` on macOS can report removals as `RemoveKind::Any`, so
`WatchEvent::Delete` may be missed. Update the match arm in the `file.rs` event
processing logic around `EventKind::Remove(...)` to treat both
`RemoveKind::File` and `RemoveKind::Any` as delete events, keeping the existing
watch-stream behavior consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 9ac19023-fa20-45d1-abf6-b15a6071ba51
⛔ Files ignored due to path filters (4)
Cargo.lockis excluded by!**/*.locklib/bindings/kvbm/Cargo.lockis excluded by!**/*.locklib/bindings/python/Cargo.lockis excluded by!**/*.locklib/runtime/examples/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (20)
components/src/dynamo/common/configuration/groups/router_args.pydocs/agents/session-ids.mddocs/components/frontend/nvext.mddocs/components/router/router-configuration.mdlib/llm/src/kv_router/push_router.rslib/llm/src/kv_router/push_router/request_guard.rslib/llm/src/kv_router/push_router/selection.rslib/llm/src/session_affinity/coordinator.rslib/llm/src/session_affinity/mod.rslib/llm/src/session_affinity/push_router.rslib/llm/src/session_affinity/tests.rslib/runtime/Cargo.tomllib/runtime/src/discovery/kube.rslib/runtime/src/discovery/kv_store.rslib/runtime/src/discovery/mod.rslib/runtime/src/pipeline/network/egress/push_router.rslib/runtime/src/storage/kv.rslib/runtime/src/storage/kv/file.rstests/router/common.pytests/router/test_router_e2e_with_mockers.py
💤 Files with no reviewable changes (3)
- lib/runtime/src/storage/kv.rs
- lib/runtime/src/pipeline/network/egress/push_router.rs
- lib/runtime/src/discovery/mod.rs
Signed-off-by: PeaBrane <yanrpei@gmail.com>
Signed-off-by: PeaBrane <yanrpei@gmail.com>
Summary
AffinityTargetpropagation, and the explicit prefill DP-rank path.Validation
cargo test -p dynamo-llm --no-default-features session_affinity(28 passed).venv/bin/python -m pytest tests/router/test_router_e2e_with_mockers.py::test_mocker_session_affinity -q(2 passed)/cleanforlib/runtimeandlib/llm(cargo clippy --no-default-features -- -D warningsandcargo fmt)cargo metadata --locked --no-depsfor the workspace and standalone Python/KVBM/runtime-example lockfilesSummary by CodeRabbit
Bug Fixes
Documentation