mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #4674] [Bug]: [TransferEngine] HTTP metadata server rejects valid rpc_meta republish as duplicate #1189
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#1189
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?
Originally created by @thrower01 on GitHub (Oct 15, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/4674
Bug Report
Context
The Python HTTP metadata backend (
python/mooncake/http_metadata_server.py) is a lightweight alternative to etcd/Redis for Mooncake Transfer Engine deployments. On the C++ side,TransferMetadata::rePublishRpcMetaEntry(inmooncake-transfer-engine/src/transfer_metadata.cpp:1928) implements a versioned idempotency rule: if the same(ip_or_host_name, rpc_port)publishes again, the client bumpsmetadata_versionand PUTs the new JSON. This is the normal path for process restart, multi-worker duplicate registration, and any republish scenario.The current Python server gates
rpc_metakeys with two bugs, and together they make a legitimate republish always fail.Bug 1 — substring match is too broad
if key.find("rpc_meta") != -1 and key in self.store:A key such as
mooncake/segment_rpc_meta_cache/xis NOT an rpc_meta key, but the substring check pulls it into the gate. Non-rpc_meta business keys whose names happen to containrpc_metacan no longer be overwritten.Bug 2 — byte-level equality rejects version bumps
if self.store[key] == data: return 200 return 400 "Duplicate rpc_meta key not allowed"The C++ client always increments
metadata_versionon republish, so the new payload bytes are never byte-identical to the existing value. Every valid republish is treated as a duplicate conflict.Impact
Any cluster using the HTTP metadata server will get 400 responses when clients republish their own rpc_meta (process restart, duplicate registration), forcing the client into retry or misleading the operator into thinking the metadata backend is broken. Non-rpc_meta keys whose name merely contains the substring can also stop being writable.
Fix direction
/, require"rpc_meta"as a literal segment.metadata_versionstrictly increasing and(ip_or_host_name, rpc_port)unchanged → accept overwritemetadata_versionrollback or identity-field conflict → 400 with a machine-readable reasonScope of fix
The same broken gate is also copied into
mooncake-transfer-engine/example/http-metadata-server-python/bootstrap_server.py(the example had the older version that rejected ALL duplicate rpc_meta keys, not even allowing idempotent same-byte writes). Both need updating.Acceptance
TransferMetadata::rePublishRpcMetaEntry.Before submitting...
@github-actions[bot] commented on GitHub (Oct 15, 2026):
Thanks for opening this issue, @thrower01!
340463471A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide