Repository navigation
[Store] Reopen DFS shard once on POSIX I/O failure before surfacing error - #4512
Merged
ykwd merged 1 commit intoOct 14, 2026
Conversation
codenaut-919
requested review from
XucSh,
YiXR,
stmatengss and
ykwd
as code owners
October 8, 2026 11:55
codenaut-919
force-pushed
the
dfs-supports-write-fail-reopen-and-read-fail-clear-master-metadata
branch
from
October 10, 2026 03:37
1a5da28 to
8e8a2c3
Compare
codenaut-919
force-pushed
the
dfs-supports-write-fail-reopen-and-read-fail-clear-master-metadata
branch
from
October 10, 2026 06:57
8e8a2c3 to
cb8fabb
Compare
fcczzz
approved these changes
Oct 12, 2026
fcczzz
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. The reopen and retry paths are serialized correctly with shard I/O, and retries remain bounded.
ykwd
approved these changes
Oct 14, 2026
codenaut-919
deleted the
dfs-supports-write-fail-reopen-and-read-fail-clear-master-metadata
branch
October 14, 2026 02:35
14 of 20 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
In DFS filesystem shard mode, each shard is a preallocated fixed-size file (dfs_shard_NNNN.data) whose fd is opened on first use and cached for long-lived reuse. When the fd goes stale underneath (e.g. NFS ESTALE, a reclaimed handle), the cached fd keeps failing every pwritev/preadv even though the underlying file is fine.
Before this change the backend surfaced the I/O error on the first hard failure and never touched the cached fd. So once a shard's fd went stale, every subsequent read/write to that shard reused the same bad fd and kept failing until the process restarted — amplifying a single stale fd into an outage for every key mapped to that shard.
what's changed
Add a single-shot reopen-and-retry on the DFS shard read/write paths(only posix mode): when WriteAt/ReadAt returns a hard error, close and reopen the shard's fd inside the per-shard critical section and retry the I/O exactly once; only if the retry also fails is the error surfaced.
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:
Test results:
Checklist
./scripts/code_format.shAI Assistance Disclosure