[event] add transactional engine cache event subscriber - #246
Draft
putaopi7 wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a standalone subscriber that synchronizes RTP-LLM or vLLM local KV-cache state into KVCM.
ST_EVENT_REPORTmetadata-only storage type.Data flow
Source.preparecreates a candidate state without advancing its committed cursor. A KVCM failure therefore applies backpressure to the source instead of allowing unbounded local event accumulation or acknowledging data that was not persisted.Design
Dedicated event-report storage
Engine-local GPU cache is represented by a new
ST_EVENT_REPORT = 8storage type andevent-report://locations.This backend owns node liveness and cache-location metadata only. It does not read, write, or delete the actual KV data, which remains owned by RTP-LLM or vLLM.
event_reporting_storage_candidates.Authoritative snapshot semantics
EVENT_BLOCK_SNAPSHOTreplaces the complete block set for oneinstance_id + host_ip_port. An empty snapshot clears that host without affecting other hosts or instances.Snapshots, deltas, and asynchronous host cleanup for the same instance and host are serialized by striped mutexes. Generation and availability fences prevent stale timeout cleanup from removing locations after a node has recovered or re-registered.
Transactional subscriber
NODE_REGISTER -> snapshot ACK -> source commit -> HEARTBEAT.HOST_DOWN, re-registers, and retries the same uncommitted snapshot.HOST_DOWNbefore exit.Small snapshots use one replacement request. Large snapshots use an empty replacement followed by chunked
ADDrequests to stay within the request-size limit. A failed transfer is retried from the empty replacement and eventually converges, although the host can be partially visible while chunks are being applied.RTP-LLM source
dp_sizedistinct endpoints to avoid silently missing a DP rank.vLLM source
0or afterAllBlocksCleared.int64, matching the legacy integer event representation.dp_size = 1; multi-publisher aggregation is left for a separate change.Configuration
KVCM needs a dedicated event-report storage:
{ "global_unique_name": "engine_cache_events", "event_report": { "heartbeat_timeout_ms": 30000, "cleanup_grace_ms": 300000, "liveness_check_interval_ms": 5000 } }The corresponding instance group must include
engine_cache_eventsinevent_reporting_storage_candidates. It must not be added to ordinarystorage_candidates.Example RTP subscriber:
The vLLM path additionally requires
msgspecandpyzmq; the RTP path has no source-specific Python dependency.Compatibility
instance_id.Validation
manager_message_proto_utilbuilds successfully with the updated protobuf contract.InstanceGroupTest.EventReportStorageProtoRoundTrip: passed.StorageConfigTest: passed.EventReportBackendTest: passed.CacheManagerTest.ReportEventSnapshotAuthoritativelyReplacesHostBlocks: passed.CacheReclaimerTest.TestFilterLocationNeverReclaimsEventReportedStorage: passed.MetaIndexerfilter cases: passed.DataStorageManagerTest.RegisterEventReportStorage: passed.git diff --check: passed.Known limitations and follow-ups
int64key domain.Companion PR
alibaba/rtp-llm#1214