Repository navigation
fix(kv-router): drop emptied entries from the positional indexer - #17962
paolo-perrone wants to merge 1 commit into
Conversation
Signed-off-by: Paolo Perrone <58889145+paoloap-py@users.noreply.github.com>
|
No actionable comments were generated in the recent review. WalkthroughBlock, DP-rank, and worker removal now use a shared helper that removes positional index entries when their ChangesPositional index cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Medium Merge Risk:
|
|
👋 Hi paolo-perrone! Thank you for contributing to ai-dynamo/dynamo. Just a reminder: The 🚀 |
|
/ok to test 0c711ec |
✅ Dynamo PR CI passed — run 41976114117 (attempt 1) on
|
Overview
PositionalIndexernever deletes anything from its(position, local_hash)map. Once the last worker holding a block removes it, the entry stays behind empty, so the map keeps one dead entry for every distinct block it's ever indexed. Under cache churn that's memory that only grows, for anyone using this backend, including thenested-mapindexer in the Mooncake benchmarks.Key Changes
About 16 lines of core logic, plus one test.
remove_from_indexhelper callsDashMap::remove_if_mut. It removes the worker and drops the entry whenSeqEntry::removesays it's empty, in one step under the shard lock.get_mutpluslet _ = entry.remove(..).Validation
SeqEntry::removealready returns true when the entry "is now completely empty and should be removed", and the indexer README lists dropping empty entries as step 4 ofremove_blocks. All three callers just threw that result away. I usedremove_if_mutrather than checking first and callingremoveafter, because a store from another event thread could land in between and get deleted.remove_workerremovals_drop_emptied_index_entriescovers all four rows and fails on main withleft: 3, right: 0.cargo test -p dynamo-kv-router --libpasses (1150 passed), andcargo fmt --checkand pre-commit are clean. Routing doesn't change: lookups already treat an empty entry like a missing one, so this only gives the memory back.Issues and Ongoing Work
Pull Request Checklist
/pr-checklistskill.Summary by CodeRabbit