Skip to content

[store]feat:add kv-event info via kv cache meta#2876

Merged
Chase-Rong merged 2 commits into
kvcache-ai:dev/conductorfrom
Misak2333:dev/conductor
Jul 14, 2026
Merged

[store]feat:add kv-event info via kv cache meta#2876
Chase-Rong merged 2 commits into
kvcache-ai:dev/conductorfrom
Misak2333:dev/conductor

Conversation

@Misak2333

@Misak2333 Misak2333 commented Jul 13, 2026

Copy link
Copy Markdown

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

  • Transfer Engine (mooncake-transfer-engine)
  • Mooncake Store (mooncake-store)
  • Mooncake EP (mooncake-ep)
  • Mooncake PG (mooncake-pg)
  • Integration (mooncake-integration)
  • P2P Store (mooncake-p2p-store)
  • Python Wheel (mooncake-wheel)
  • Common (mooncake-common)
  • Mooncake RL (mooncake-rl)
  • CI/CD
  • Docs
  • Other

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Breaking change
  • Documentation update
  • Performance improvement
  • Other

How Has This Been Tested?

Test commands:

# Example: bash scripts/run_ci_test.sh

Test results:

  • Unit tests pass
  • Integration tests pass (if applicable)
  • Manual testing done (describe below)

Checklist

  • I have performed a self-review of my own code
  • I have formatted my code using ./scripts/code_format.sh
  • I have run pre-commit run --all-files and all hooks pass
  • I have updated the documentation (if applicable)
  • I have added tests to prove my changes are effective
  • For changes >500 LOC: I have filed an RFC issue

AI Assistance Disclosure

  • No AI tools were used
  • AI tools were used (specify below)

@github-actions github-actions Bot added documentation Improvements or additions to documentation run-ci Store Integration labels Jul 13, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +2476 to 2478
} else {
SyncKvObjectState(key, metadata, "default", previous_kv_media);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

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);
            }

@Chase-Rong
Chase-Rong merged commit 2449b9d into kvcache-ai:dev/conductor Jul 14, 2026
2 checks passed
Chase-Rong pushed a commit that referenced this pull request Jul 15, 2026
* [store]feat:add kv-event info via kv cache meta

---------

Co-authored-by: j00628475 <jiangzexu144@huawei.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation Integration run-ci Store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants