Skip to content

feat(store): add batch exist support for master #542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

xiaguan
Copy link
Collaborator

@xiaguan xiaguan commented Jun 23, 2025

This change is in preparation for future optimizations like LMCache/LMCache#891. The LMCache scheduler often checks the existence of many keys at once, and using this new interface can significantly reduce latency for those lookups.

Upcoming TODO:

Add support for meta-only clients (which don't need to interact with the actual data).

@xiaguan xiaguan requested a review from Copilot June 23, 2025 09:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for batch existence checks for keys in both server and client code (including a Python interface), which will help reduce latency in high-volume key lookup scenarios. Key changes include:

  • Introducing new methods BatchExistKey/BatchIsExist in MasterService, MasterClient, Client, and their respective tests.
  • Updating related RPC and Python binding interfaces to accommodate batch exist operations.
  • Formatting changes and minor improvements, such as additional key parameter validation.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
mooncake-wheel/tests/test_distributed_object_store.py Added test for batch is_exist operations.
mooncake-store/tests/master_service_test.cpp New tests for BatchExistKey and formatting updates.
mooncake-store/tests/client_integration_test.cpp Added and updated tests for batch is_exist operations.
mooncake-store/src/master_service.cpp Added BatchExistKey and enhanced PutStart validation.
mooncake-store/src/master_client.cpp Implemented BatchExistKey with proper error handling and logging.
mooncake-store/src/client.cpp Added BatchIsExist method with duplicate-check validation.
mooncake-store/include/rpc_service.h Introduced new structure and handler for BatchExistKey.
mooncake-store/include/master_service.h, master_client.h, client.h Updated headers with new batch exist API declarations.
mooncake-integration/store/store_py.h, store_py.cpp Added Python binding for batch exist functionality.
Comments suppressed due to low confidence (1)

mooncake-store/include/rpc_service.h:100

  • The structure name 'BatchExistReponse' appears to be misspelled. Consider renaming it to 'BatchExistResponse' for improved clarity and consistency with common naming conventions.
struct BatchExistReponse {

@xiaguan xiaguan force-pushed the master_batch_exist branch from 84ce245 to 3284749 Compare June 23, 2025 09:58
@xiaguan xiaguan requested a review from ykwd June 23, 2025 10:00
Copy link
Collaborator

@ykwd ykwd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. This pr looks good to me. By the way, since there are many API changes recently, are our docs already obsolete?

@xinranwang17
Copy link
Contributor

I have implemented a similar interface here: #511
The difference is that the return value is a map of <key, is_exist> pair, which is easy for upper level caller to find the existed key without addressing them by index again.
The current sglang l3 cache is using map of <key, is_exist> pair as the return value, it seems LMcache use the different one. Should we have an agreement before merging all related prs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants