Repository navigation
fix(pnfs): make an MDS move clean and short, and hold the MDS in maintenance - #904
Merged
Merged
Conversation
boddumanohar
force-pushed
the
fix/mds-forwarder-outlives-guest
branch
from
November 12, 2026 07:55
ecd2076 to
d43b8ac
Compare
The guest could never power down. The host-path forwarder, which carries the
guest's NVMe/TCP connections to the storage nodes through the mds-proxy, was
served under the runner's stop-signal context, so SIGTERM closed it, and every
spliced connection, at the moment the supervisor pressed the power button. The
guest then hung unmounting the exported XFS ("no usable path - requeuing I/O")
and never powered down: on every MDS move the runner logged "guest did not
power down within 20s, killed QEMU", and every pNFS client stalled for those
20 s on top of the restart and grace period. The supervisor now starts the
storage path itself, under a context that outlives the stop signal and ends
only once QEMU has exited.
A drain evicted the MDS freely. The maintenance window's budget held the SPDK
pod, the management API, and FoundationDB, and nothing else, so draining a
worker evicted the MDS at once, even while the control plane refused or
deferred the maintenance the drain was for; the RCA
pnfs_mds_not_in_eviction_targets_rca_20261111 saw this three times in a day.
evictionTargets is now a list of label selectors, and the MDS is selected by
the presence of storage.simplyblock.io/cluster-id, which only its pods carry,
so its pod template is unchanged and an upgrade does not move it.
boddumanohar
force-pushed
the
fix/mds-forwarder-outlives-guest
branch
from
November 12, 2026 11:48
d43b8ac to
94c7fa0
Compare
mxsrc
approved these changes
Nov 12, 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.
Problem
Moving the pNFS metadata server (MDS) stalled every pNFS client for far longer than it needed to. RCA
pnfs_mds_not_in_eviction_targets_rca_20261111measured 93 s per move, against the e2e suite's 40 s I/O ceiling, three times in a day. Three defects contribute:no usable path - requeuing I/O), and the runner loggedguest did not power down within 20s, killed QEMUon every move.lease-time=15,grace-time=15), not here.Changes
csi-driver/internal/mds/runner/supervisor.go,cmd/mds-runner/main.go): the supervisor starts the guest's storage path under a context that outlives the stop signal and ends only once QEMU has exited.operator/internal/controllers/node/workload.go):evictionTargetsis a list of label selectors, and the MDS is selected by the presence ofstorage.simplyblock.io/cluster-id, which only its pods carry. Its pod template is unchanged, so an upgrade does not move it.Unit tests
Each regression test failed against the unfixed code and passes after the fix:
TestTheGuestKeepsItsStorageUntilItHasPoweredDown(U-116): before,pressing the power button: the guest's storage path is gone, killed QEMU.TestTheWindowHoldsThePNFSMetadataServer(O-52): before,the metadata server on the drained worker is not held by the window's budget.go test -race ./internal/mds/..., the operator's./internal/...suite with envtest, golangci-lint, the Linux build and vet ofcmd/mds-runner, and the house-style gate all pass. CI on the PR is green.Cluster tests
Run on a four-node k3s cluster (three storage nodes) with images built from this branch, #906 (activation of a guest that boots as a standby), and the guest of vela-os#32 (
pnfsos-95b667b), through the throwaway branchtest/mds-forwarder-111. The guest image onpnfs-minimalboots as a standby, so testing this PR with a current guest needs #906. One pNFS RWX volume had one writer pod per node doing 4 KiB fsync'd writes and logging any write over 1 s.1. The guest boots and serves. With #906, nfsd logged
starting 15-second grace period, and the grace ended early once all clients had reclaimed. The export was Ready.2. Evicting the MDS (the eviction API, as a drain does; restarted on the same node, 4 writers):
killed QEMUafter 20 s, hung unmounting the export XFSMDS guest shut downafter 4 s3. Maintenance window and drain (3 writers, the MDS moved to another node):
HostMaintenance. The window labeled the MDS (storage.simplyblock.io/maintenance-worker) together with the SPDK and FoundationDB pods, under amaxUnavailable: 0budget.OperationSucceeded, all storage nodes and the cluster returned to Online, and the export was Ready.Not verified: that the budget blocks a drain while the window holds. The first drain stopped at the SPDK pod, which has no controller and needs
--force, before it tried to evict anything. The label and budget were in place, and the unit test covers the selection.Remaining cost and scope
A cross-node move now costs about 23 s with 3–4 clients: the drain, a clean shutdown, about 18 s to reschedule and boot, and a short grace. The RCA's run had 36 clients, whose reclaim takes longer, so
PnfsRwxRapidNoGapK8sshould be rerun at that scale to confirm the 40 s ceiling holds. The reschedule and boot cost is what the warm standby removes, and it comes as a separate PR.Related: #906 (activate a guest that boots as a standby; pNFS on
mainneeds it independently of this PR) and simplyblock/vela-os#32 (15 s lease and grace).