Skip to content

[TENT] Fall back to the control plane when the RDMA notification channel is unavailable - #4068

Merged
alogfans merged 1 commit into
kvcache-ai:mainfrom
xiaodouzi666:feat/tent-notify-rpc-fallback
Sep 20, 2026
Merged

alogfans merged 1 commit into
kvcache-ai:mainfrom
xiaodouzi666:feat/tent-notify-rpc-fallback

Conversation

@xiaodouzi666

@xiaodouzi666 xiaodouzi666 commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

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 as InternalError, 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 with ControlService unless 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:

  • The three "nothing was posted" cases become DeviceNotFound / RdmaError instead of InternalError. getEndpoint() takes an optional Status* failure so 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-plane Notify RPC the peer already answers bootstrap on - the same wire path TcpTransport::sendNotification() uses, and what the classic engine's rdma_notify_oob_fallback does. Any other error is returned untouched. A transport that advertises notifications but returns NotImplemented is skipped on both the send chain and the receive drain. Each fallback is logged with LOG_EVERY_N and a running count.
  • One case is deliberately excluded: when the bootstrap failed because the RPC itself failed, the peer's control plane is not answering, so the status is reported as RpcServiceError and 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 because TcpTransport::receiveNotification() clears its argument. One transport that cannot be read does not stop the drain.
  • construct() registers an in-process notify callback with ControlService before 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 main on its own, using the in-process notification queue that #3464 added there.

Module

  • Transfer Engine (mooncake-transfer-engine)
  • Mooncake Store (mooncake-store)
  • Mooncake Conductor (mooncake-conductor)
  • Reshard (mooncake-reshard)
  • 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?

tent_notification_fallback_test is 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, the NotImplemented skip, 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 existing swapTransportForTest() hook, so no NIC or metadata server is needed. RdmaNotifyFaultTriageTest gains 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 the RpcServiceError branch reddens the exclusion case.

ctest over mooncake-transfer-engine/tent/tests on current main: 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.

Injection before after
none 4000/4000, 0 duplicates; transfer-bound p50/p99 168.9-170.4 / 246.9-249.0 us 4000/4000, 0 duplicates; 170.4 / 247.3 us
initiator's notify QP disabled after 500 sends 500 of 4000, 2000 send errors, END never arrived 4000/4000, 0 duplicates, 0 send errors; standalone p50/p99 67.2 / 120.0 us over RPC
initiator loaded without an RDMA transport 0 of 2000 (queued by the target, never drained) 2000/2000, 0 duplicates; p50/p99 66.6 / 119.5 us
peer frozen before any endpoint exists, two sendNotification() calls 30.009 s, 30.001 s 30.009 s, 30.001 s, no fallback attempted; without the exclusion above, 90.011 s and 60.001 s

Test 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-failure

Test results:

  • Unit tests pass
  • Integration tests pass (if applicable) (tent ctest suite, 64 of 64)
  • Manual testing done (describe below) (the before/after table above)

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 on the files changed in this PR and all hooks pass
  • I have updated the documentation (if applicable) (no TENT design doc covers the notification path; the new key and the fallback semantics are documented in transfer_engine_impl.h. A section can be added if reviewers want one.)
  • I have added tests to prove my changes are effective
  • For changes >500 LOC: I have filed an RFC issue (597 insertions, 437 of them tests, so 160 non-test lines; the series RFC is [RFC]: [TENT] Fault tolerance for the RDMA notification channel #4061)

AI Assistance Disclosure

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

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.

…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.

@alogfans alogfans left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@alogfans
alogfans merged commit 68ce238 into kvcache-ai:main Sep 20, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants