Repository navigation
[Store] Expose standalone soft-pin and unpin controls - #4858
Conversation
Expose batched object-level soft-pin updates through the existing admin HTTP service. Reuse write-time deadline transitions and expiration without transferring KV data or tracking session references. Set the default maximum soft-pin TTL to seven days and align CLI defaults, example configurations, and documentation. Signed-off-by: MagicYang1573 <1328657938@qq.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
stmatengss
left a comment
There was a problem hiding this comment.
These three whitespace-only suggestions fix the Check code format failure. Applying all three to c8efd8d16e1d6522950aec754ec42710178415e8 locally passed ./scripts/code_format.sh --check --changed-lines --base origin/main with clang-format 20.1.8 and all applicable pre-commit hooks across the 17 PR files. The suggestions can be applied together in one batch. Prepared with OpenAI Codex.
Description
Expose standalone soft-pin controls for existing Mooncake Store objects, so a serving controller can retain or release KV after a request completes without rewriting the objects or attaching retention settings to another write.
The implementation reuses the existing write-time soft-pin deadline, accounting, and expiration machinery. The master admin HTTP service exposes:
POST /api/v1/soft_pin:{"tenant_id":"default","keys":["object-key"],"ttl_ms":60000}POST /api/v1/soft_unpin:{"tenant_id":"default","keys":["object-key"]}Both return per-key results, e.g.
{"results":[{"key":"object-key","error_code":0}]}. The admin service uses its existing port (default 9003).Pin sets the deadline to the master's current time plus the requested TTL; renewal and shortening both work. Unpin clears soft protection immediately, without counting session references. Payloads, read leases, hard pins, and session tags retain their existing behavior. Retention policy and coordination between sessions belong to the caller. Existing pressure-eviction settings still apply.
The default maximum soft-pin TTL is now 7 days (604800000 ms), with CLI/configuration examples and documentation aligned. Requests are bounded to 4096 keys and preserve per-key missing/unfinished-object errors. Malformed JSON, including trailing garbage or concatenated values, is rejected before any pin state changes.
Related work
Suggested Merge Priority
Module
mooncake-store)Type of Change
How Has This Been Tested?
Test commands:
Test results:
Full inference E2E passed on the committed Mooncake
c8efd8d16e1d6522950aec754ec42710178415e8and Dynamo204759d1965c8b000fb1358994a1b2201066a1e4builds, with open-source SGLang779adb4b82243e7743be60a305dc62ca3bee3a3a, Qwen3-0.6B, one GPU / TP1, HiCache write-through, and Mooncake TCP:A 512-token prompt generated 8 tokens and produced 8 indexed blocks / 16 MHA K/V objects. All 9 E2E checks passed: real event-to-key resolution; hash/session/frontier helper paths and invalid selections; malformed JSON without mutation; seven-day TTL boundary; one unpin despite two session references; partial failures, renewal, shortening and expiration; unchanged KV payloads; preserved read leases; and removal events invalidating key resolution. No synthetic events or manual SPI insertion were used.
This run exercised upstream SGLang's HiCache path, not the direct-linker branch in #44611. The local E2E harness is not included in this PR. TP>1, RDMA, memory-pressure eviction, HA, load testing, and the stock OpenAI frontend were not covered.
Checklist
./scripts/code_format.shFormatting was checked through the changed-file pre-commit hooks.
AI Assistance Disclosure