Repository navigation
Conversation
An error callback can finish a partially submitted task while it remains on the QoS chain. The submit loop then completes it again when unlinking. Require the task to be off the chain before publishing completion and reclaiming it.
Add a per-worker control queue using the existing mutex and condition variable. Expose worker-local state through WorkerContext. Snapshot control and I/O queues under the same lock, then process control tasks before I/O tasks outside the lock. This prevents newly queued I/O from overtaking its preceding control task. Release callback captures outside the lock and drain queued control tasks before worker exit. Fail requests if task allocation fails after dequeueing. Signed-off-by: Cage Chen <cage@arcfra.com>
Detect connection failures through I/O and admin polling. Stop submission and drain qpairs on their owner workers before reconnecting the controller, then resume I/O after recovery. Bind segments during Open and let their owner workers create qpairs, advance asynchronous connections, and clean up on shutdown. Signed-off-by: Cage Chen <cage@arcfra.com>
cage-goat
requested review from
XucSh,
YiXR,
stmatengss and
ykwd
as code owners
October 14, 2026 10:37
This was referenced Oct 15, 2026
This branch has not been deployed
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.
Fixes #3863
Description
The NoF client currently lacks a complete controller recovery and I/O qpair reconnection mechanism. After a connection failure or target restart, subsequent I/O cannot recover automatically. This PR adds coordinated controller recovery across multiple namespaces and workers.
Design
Before resetting a controller, all its I/O qpairs must stop submitting requests, drain outstanding I/O, and be freed. Since these qpairs may belong to different workers, recovery must coordinate all affected workers.
The controller coordinates recovery, while each owner worker creates, submits to, polls, and cleans up its own qpairs. A shared controller thread in
SpdkWrapperpolls admin queues and advances controller recovery.Implementation highlights
This PR also includes a prerequisite fix that prevents task completion from being published before the task is removed from its QoS list, avoiding duplicate completion.
The scope is client-side NoF connection recovery. Master heartbeat and segment removal policies are unchanged.
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?
Test commands:
With
USE_NOF=ON,BUILD_UNIT_TESTS=ON, and sufficient hugepages and permissions for the integration test:Test results:
The three control queue tests cover worker affinity and FIFO ordering, posting another task from a callback, and draining queued control tasks during shutdown. All passed, including 20 shuffled repetitions.
The TCP integration test uses an SPDK malloc-bdev target with two namespaces accessed by two workers. It stops the target with I/O outstanding, verifies that requests complete with errors, restarts the target, and verifies controller recovery, qpair reconnection, and successful reads/writes using the original pool and segment handles.
The existing worker-count test is also adjusted to account for the shared controller thread.
Selected complete lines from the latest integration run show fault handling, a retry while the target is unavailable, and successful recovery:
These results cover
92b53949. The subsequent merge with upstream has not yet been revalidated.Checklist
./scripts/code_format.shAI Assistance Disclosure
Codex assisted with design discussions, implementation, code review, and test validation. The human submitter is responsible for understanding and reviewing all changes.