Repository navigation
fix(pnfs): restart the MDS only when nfsd stops completing requests (SFAM-2857) - #927
Merged
Merged
Conversation
…SFAM-2857) Since #909 a stuck nfsd makes the metadata server guest unhealthy, and the runner restarts the pod 90s later. The watchdog counted a thread as stuck when it sat on the same wchan for three ticks, without asking whether requests completed meanwhile. Under heavy writes every request a thread serves blocks in the same place, so a busy nfsd looked stuck, and restarting the singleton MDS put write EIO on every pNFS volume in the cluster. StuckFor now reports a stall only while nfsd completes no RPC calls: work arriving with none processed, or a thread on one wait with the call counter flat. A thread on one wait while calls advance still logs and dumps stacks, but no longer counts toward health. Without RPC statistics the old rule applies. SimplyblockDriver.spec.pnfs.mds.unhealthyDeadline passes --unhealthy-deadline to the runner, so the restart can be delayed or turned off (0s) without pinning an older image.
boddumanohar
marked this pull request as ready for review
November 17, 2026 14:49
noctarius
approved these changes
Nov 17, 2026
mxsrc
approved these changes
Nov 17, 2026
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 SFAM-2857.
Problem
Since #909 a stuck nfsd makes the MDS guest unhealthy, and
mds-runnerrestarts the pod after--unhealthy-deadline(90s). The watchdog marked a thread stuck when it sat on the same wchan for three 15s ticks, without checking whether requests completed in between. Under sustained writes each request blocks in the same place (XFS log, writeback), so a busy nfsd looked stuck. 3m stuck limit + 90s deadline = the 4m30s in the incident log, and the singleton MDS restart put write EIO on all 12 volumes.Change
csi-driver/internal/mds/agent/nfsd_watchdog.go:StuckFor()now reports a stall only while nfsd completes no RPC calls: the existing "not draining" rule, or a thread on one wait with/proc/net/rpc/nfsdcalls flat. Same-wchan threads with calls advancing still warn and dump stacks, but no longer affect health. Without RPC statistics the previous rule applies, so fix(pnfs): recover an MDS that loses its storage, and report it on NFSExport #909's recovery case is unchanged.SimplyblockDriver.spec.pnfs.mds.unhealthyDeadline(optionalmetav1.Duration) is passed to the runner as--unhealthy-deadline.0sdisables the restart. Unset keeps the runner default.Tests (red first)
TestAThreadOnOneWaitWhileRequestsCompleteIsNotStuckForHealth: failed onmainwithStuckFor = 4m30s while requests keep completing, want 0. Passes now.TestAThreadOnOneWaitWithNoRequestCompletingIsStuckForHealth: a real stall still counts.TestMDSRunnerTakesTheUnhealthyDeadline/...KeepsItsDefault: failed to build before the field existed.go test ./internal/mds/...(csi-driver) and./internal/controllers/driver/...,./api/...(operator) pass, and the quality gate passes.Live test (cluster 111, 2026-11-17)
Operator and MDS on this branch's CI images; 12 RWX
sb66-pnfsvolumes, each with a 4-job 1 MiB random-write fio, for about 30 minutes.Dinsubmit_bio_wait,folio_wait_bit_common, orxlog_force_lsnwhile requests completed: the pattern from the ticket.guest unhealthy: nfsdline, MDS restart count 0.mainthat reachesnfsdStuckLimitand turns the guest unhealthy; here it did not. It ended before the 90s deadline, somainwould not have restarted the pod either: this lab does not reach the 4m30s of the ticket.ENOSPC: the test wrote 4 x 8 GiB to 20 GiB volumes. That is the test's sizing, not the change.volumes/<id>/connect, the tracker's 5-minute refresh over 13 exports), not the ~30/s of ticket item 5.Not covered
PnfsRwxRapidNoGapK8son the ticket's cluster with this branch's MDS image, which is where the restart reproduces.Simplyblock client createdlog flood; no code path found that produces it in steady state, needs the pod's timestamped log) are out of scope.