mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[PR #1191] [MERGED] [Store] feat: Add BatchReplicaClear API for manual cache cleanup #2063
Labels
No labels
ascend
auto-closed
bug
bug
CI/Build
Common
documentation
enhancement
feature request
good first issue
help wanted
high priority
MetaX
nightly-failure
pull-request
PyTorch Backend
question
RFC
Roadmap
stale
Store
Tests
Transfer Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/Mooncake#2063
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/Mooncake/pull/1191
Author: @Bo-Vincent
Created: 12/10/2025
Status: ✅ Merged
Merged: 12/12/2025
Merged by: @stmatengss
Base:
main← Head:vin/replicaclear📝 Commits (2)
89d1efe[Store] feat: Add BatchReplicaClear API for manual cache cleanupd4c5216[Store] feat: Fix BatchReplicaClear monitor issues📊 Changes
15 files changed (+915 additions, -25 deletions)
View changed files
📝
doc/en/mooncake-store.md(+39 -6)📝
doc/zh/mooncake-store.md(+46 -13)📝
docs/source/design/mooncake-store.md(+39 -6)📝
mooncake-store/include/client_service.h(+14 -0)📝
mooncake-store/include/master_client.h(+14 -0)📝
mooncake-store/include/master_metric_manager.h(+13 -0)📝
mooncake-store/include/master_service.h(+16 -0)📝
mooncake-store/include/rpc_service.h(+4 -0)📝
mooncake-store/src/client_service.cpp(+8 -0)📝
mooncake-store/src/master_client.cpp(+20 -0)📝
mooncake-store/src/master_metric_manager.cpp(+71 -0)📝
mooncake-store/src/master_service.cpp(+125 -0)📝
mooncake-store/src/rpc_service.cpp(+41 -0)📝
mooncake-store/tests/client_integration_test.cpp(+122 -0)📝
mooncake-store/tests/master_service_test.cpp(+343 -0)📄 Description
Implement the BatchReplicaClear API to allow clients to manually clear cached object replicas. This feature enables explicit storage management by deleting replicas for specified keys. The implementation is end-to-end, from the client to the master service.
Description
This pull request introduces a new RPC endpoint,
BatchReplicaClear, designed to provide a deterministic way for applications or cleanup jobs to manually clear cached object replicas. This is particularly useful for reclaiming storage space from stale or unused entries that may persist beyond their intended lifecycle.The implementation includes the following key aspects:
BatchReplicaClearmethod is exposed through theClient,MasterClient, andMasterService, with a corresponding RPC handler.segment_name).client_idowns the object, preventing unauthorized data deletion.Putoperations.WARNINGlevel for better visibility.Type of Change
How Has This Been Tested?
This feature has been thoroughly tested through a combination of unit and integration tests:
master_service_test.cpp): A comprehensive suite of tests has been added to validate the core logic inMasterService. These tests cover numerous scenarios, including:client_integration_test.cpp): End-to-end tests have been implemented to verify the full functionality through theClientinterface. These tests confirm that the RPC call works as expected and correctly handles lease expiration by using a reliable polling mechanism.All new and existing tests pass successfully.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.