Repository navigation
Conversation
XingLiu1
force-pushed
the
liuxing/mooncake-remote2h-deferred-insert
branch
from
July 24, 2026 02:27
c687ca4 to
e606102
Compare
XingLiu1
marked this pull request as ready for review
July 29, 2026 13:18
…te2h-deferred-insert # Conflicts: # flexkv/cache/cache_engine.py # flexkv/common/transfer.py # flexkv/kvtask.py # flexkv/transfer/transfer_engine.py # flexkv/transfer/worker.py # flexkv/transfer_manager.py
…te2h-deferred-insert # Conflicts: # flexkv/kvtask.py # flexkv/transfer/worker.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
REMOTE2Huntil completion, publishing only the longest contiguous successfully loaded prefixWhy
The previous flow published an unready radix node before transfer and marked it ready afterward. A partial Mooncake load failure could therefore expose blocks that were never loaded successfully.
Moving PUT insertion into the completion callback fixes that failure mode, but a callback must not reuse the match captured during planning. Two duplicate or overlapping PUTs can both reserve blocks before either finishes; if the later callback inserts with that stale match, it can replace an existing radix child and leak the displaced allocation.
Publication is now serialized by the cache-tree lock. Each callback rematches the local tree, recycles duplicate staging, handles concurrent splits, inserts only the unmatched suffix, and marks it ready before releasing the lock. The radix layer also rejects stale anchors before any split or child mutation, leaving block ownership with the caller.
User impact
Tests
compileall: passedgit diff --check: passedFull native runtime integration was not available on the local macOS host because
libcudart.so.11, the compiledflexkv.c_ext, and the Mooncake SDK are unavailable.