Repository navigation
[TENT] Fall back to the control plane when the RDMA notification channel is unavailable - #4068
Merged
alogfans merged 1 commit intoSep 20, 2026
Conversation
…el is unavailable Three failures in RdmaTransport::sendNotification() mean nothing left the host - no endpoint could be brought up for the peer, the endpoint has no connected notify QP (the peer has none, or it was disabled after a fault by kvcache-ai#3475), or the post was refused - and all three surfaced as an InternalError that TransferEngineImpl::sendNotification() dropped. Report them as DeviceNotFound / RdmaError and let the engine try the next notification transport and, when none is left, the control-plane RPC the peer answers bootstrap on (the path TcpTransport::sendNotification() already uses), the way the classic engine's rdma_notify_oob_fallback does. Any other error is still returned untouched, and a transport that advertises notifications without implementing them (SunriseLink) is skipped on both the send chain and the receive drain. One case is deliberately excluded: when the endpoint could not be brought up because the bootstrap RPC itself failed, the peer's control plane is not answering, so RdmaTransport reports RpcServiceError and the engine returns it as is instead of stacking a second RPC timeout on the polling thread. Every other reason (no context, allocation, QP setup, a stale segment) still falls back. receiveNotification() only drained the first transport that supports notifications, so a notification that arrived over RPC and was queued by the TCP transport was never handed out; drain every transport plus the in-process queue. Nothing registered a notify callback with ControlService unless a TCP transport was loaded, so RPC-delivered notifications were dropped on arrival; register an in-process one before the transports install (the TCP transports still take over the slot). notification/rpc_fallback (default true) turns the fallback off. What this does and does not change: - Cost: the fallback is a synchronous RPC at the same call sites the TCP notification path already uses today, including the poll that fires a transfer-bound notification. With the peer process alive and only its channel broken it is a millisecond affair (p50 ~67 us over loopback); with the control plane unreachable the exclusion above keeps it at the one bootstrap timeout the caller paid before. - Mixed versions: delivery over the fallback needs the receiver to run this change or to have a TCP transport loaded. An older RDMA-only receiver drops the RPC notification in onNotify() and still answers the RPC, so the result is what it is today (lost), only no longer reported as an error. - A payload larger than the notify slot (64 KB) now reaches the peer over RPC instead of failing. - Ordering holds within one path only: in one poll, notifications that came over RPC are handed out after the ones the notify QP carried. Only failures where nothing was posted are covered: a notification lost in flight after a successful post is not resent, since that needs receiver-side deduplication first.
xiaodouzi666
requested review from
00fish0,
alogfans,
chestnut-Q,
doujiang24,
dtcccc and
staryxchen
as code owners
September 12, 2026 15:10
2 of 3 tasks
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.
Description
Three failures in
RdmaTransport::sendNotification()mean nothing left the host: no endpoint could be brought up for the peer, the endpoint has no connected notify QP, or the post was refused. All three surfaced asInternalError, which the engine handed back as the final answer, so the notification was simply gone. Two gaps sat behind it:receiveNotification()drained only the first transport that supports notifications, so anything the TCP transport had queued from the control plane was never handed out; and no notify callback was registered withControlServiceunless a TCP transport was loaded, so an RDMA-only engine dropped every RPC-delivered notification.Measured with a two-process probe: disabling the initiator's notify QP after 500 sends left the target with 500 of 4000 notifications and no END marker, and an initiator loaded without an RDMA transport delivered 0 of 2000 to a target that had one.
Change:
DeviceNotFound/RdmaErrorinstead ofInternalError.getEndpoint()takes an optionalStatus* failureso the reason for a missing endpoint is not lost; the default argument keeps its signature source-compatible.TransferEngineImpl::sendNotification()tries every loaded notification transport in slot order, skips the ones whose channel is unavailable, and when all are, sends over the control-planeNotifyRPC the peer already answers bootstrap on - the same wire pathTcpTransport::sendNotification()uses, and what the classic engine'srdma_notify_oob_fallbackdoes. Any other error is returned untouched. A transport that advertises notifications but returnsNotImplementedis skipped on both the send chain and the receive drain. Each fallback is logged withLOG_EVERY_Nand a running count.RpcServiceErrorand the engine returns it as is rather than stacking a second RPC timeout on the polling thread. Every other reason still falls back.receiveNotification()drains every notification transport plus the in-process queue, each into its own vector becauseTcpTransport::receiveNotification()clears its argument. One transport that cannot be read does not stop the drain.construct()registers an in-process notify callback withControlServicebefore the transports install, so RPC-delivered notifications are queued even without a TCP transport;deconstruct()clears it.notification/rpc_fallback(default true) turns the whole thing off.Worth knowing: the fallback is a synchronous RPC at call sites that already do one, roughly 67 us on a live peer over loopback; a payload larger than the 64 KB slot now reaches the peer over RPC instead of failing; ordering holds within one path, so notifications that came over RPC are handed out after the ones the notify QP carried in the same poll; and delivery over the fallback needs the receiver to run this change or to have a TCP transport, otherwise the result is what it is today, only no longer reported as an error. Only failures where nothing was posted are covered - a notification lost after a successful post needs receiver-side deduplication first, which comes later in the series. No wire-format and no default timeout change.
This is the third of seven PRs on notification fault tolerance, described in the series RFC (#4061). It applies to
mainon its own, using the in-process notification queue that #3464 added there.Module
mooncake-transfer-engine)mooncake-store)mooncake-conductor)mooncake-reshard)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
tent_notification_fallback_testis new: 10 cases covering the fallback chain (both unavailable statuses), the statuses that must not fall back, the unreachable control plane returned as is, the last transport's error winning over the RPC leg, every transport being unavailable and the RPC leg taking it, theNotImplementedskip, the config switch, the merged receive drain, a drain that continues past a failing transport, and an RPC notification landing between two engines that have no TCP transport. Stand-in transports are swapped in through the existingswapTransportForTest()hook, so no NIC or metadata server is needed.RdmaNotifyFaultTriageTestgains two cases for the bootstrap-failure exclusion.Negative controls, each reverted afterwards: removing the fallback loop reddens 5 of the new cases; draining only the first transport, 3; dropping the in-process callback and not skipping
NotImplemented, one each; removing theRpcServiceErrorbranch reddens the exclusion case.ctestovermooncake-transfer-engine/tent/testson currentmain: 63 of 63 unpatched, 64 of 64 with this change, which adds one test binary.Measured on one host with two BlueField-3 integrated ConnectX-7 VFs over RoCE v2, two processes, 2000 transfer-bound plus 2000 standalone notifications per run. The injection hooks and the probe are test-only and not part of this PR.
sendNotification()callsTest commands:
cmake -S . -B build -G Ninja -DUSE_TENT=ON -DUSE_HTTP=ON -DBUILD_UNIT_TESTS=ON \ -DUSE_CUDA=OFF -DWITH_STORE=OFF -DWITH_STORE_RUST=OFF -DYLT_ENABLE_IBV=ON cmake --build build ctest --test-dir build/mooncake-transfer-engine/tent/tests --output-on-failureTest results:
Checklist
./scripts/code_format.shtransfer_engine_impl.h. A section can be added if reviewers want one.)AI Assistance Disclosure
The code, tests and measurements in this PR were produced with Claude Code as a coding assistant. The author reviewed every change and checked every measurement against the logs.