[store]feat:add kv-event info via kv cache meta#2876
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the StoreEventInfo structure and associated APIs to allow cache-aware clients to supply optional per-block metadata (such as model name, block size, hashes, and token IDs) during batch put operations. It also enhances the KvEventPublisher to track and publish detailed, medium-specific availability events (stored, removed, and cleared) and integrates state synchronization across various master service lifecycle operations. A critical issue was identified in BatchReplicaClear where the tenant ID is hardcoded to "default", which would cause events for non-default tenants to be published to the wrong stream.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| } else { | ||
| SyncKvObjectState(key, metadata, "default", previous_kv_media); | ||
| } |
There was a problem hiding this comment.
In BatchReplicaClear, the tenant ID is hardcoded to "default" when calling SyncKvObjectState. If the object belongs to a non-default tenant, this will publish the event to the wrong tenant stream. Please use metadata.tenant_id instead of "default".
} else {
SyncKvObjectState(key, metadata, metadata.tenant_id, previous_kv_media);
}* [store]feat:add kv-event info via kv cache meta --------- Co-authored-by: j00628475 <jiangzexu144@huawei.com>
Description
This PR completes Mooncake Store KV Event publishing across the object lifecycle and connector metadata paths.
Publish RFC [RFC]: Kv Events API Standardization #1527 stored, removed, and cleared events for Put/Upsert, remove, eviction, replica cleanup, and medium migration.
Parse vLLM and vLLM Ascend Mooncake keys inside the publisher without requiring connector-side API changes.
Publish model, cache namespace, KV group, parallel ranks, layer ID, and connector hash metadata derived from object keys.
Preserve the complete connector hash in connector_block_hash while retaining low-64-bit seq_hashes and
legacy block_hashes compatibility.
Populate fixed model_name, block_size, additional_salt, lora_name, and dp_rank context from Publisher
Config. Key-derived model and per-object tenant values take precedence.
Keep unavailable token_ids, parent_hash, and base_block_idx fields as nil.
Add ZMQ wire tests covering store, remove, cleared, Upsert refresh, medium transitions, full hashes, Config
fallback, and event/batch DP rank.
Update Publisher, Subscriber, and Indexer design documentation.
Leave Conductor business logic unchanged.
Module
mooncake-transfer-engine)mooncake-store)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Test commands:
# Example: bash scripts/run_ci_test.shTest results:
Checklist
./scripts/code_format.shpre-commit run --all-filesand all hooks passAI Assistance Disclosure