Repository navigation
fix(pnfs): activate a metadata server guest that boots as a standby - #906
Merged
Merged
Conversation
The guest image moved to a warm-standby boot (vela-os 7eee8a4): the state disk is no longer mounted at boot, and nfs-server, nfs-mountd, and nfsdcld wait for /run/mds/active, which only a promotion creates. Nothing in this operator promotes the guest, so every metadata server built from the moving pnfsos tag reported "the state disk is not mounted" until its boot deadline restarted the pod, and pNFS was down on every cluster that picked the image up. mds-agent now activates the guest at startup: it mounts the state disk (formatting it only when blkid reports no filesystem, never when blkid fails), recreates what the mount hides, creates the gate file, and starts the nfsd units, retrying until that succeeds. On an image that still mounts the state disk and starts nfsd at boot, every step finds its work done. Promotion, fencing, and the reservation key stay with the standby implementation, which replaces this self-activation.
geoffrey1330
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
pNFS is down on
main. Every MDS image built from the movingspdkcsi:pnfsostag since vela-ospnfs-minimalmerged the warm-standby boot (7eee8a4, PR #30) never becomes healthy:The standby guest no longer mounts its state disk at boot, and nfs-server, nfs-mountd, and nfsdcld wait for
/run/mds/active, which only a promotion creates.mds-agentis built from this repository and written into the guest disk, and the agent onmainnever promotes, so the guest waits forever and the runner restarts the pod at its boot deadline.Fix
mds-agentactivates the guest at startup, retrying until it succeeds:/dev/disk/by-id/virtio-pnfs-state) at/var/lib/nfsas ext4 withnoatime, as the old image's fstab did. It is formatted only whenblkidexits 2 (no filesystem). Ablkidthat fails otherwise fails the attempt, so an unreadable disk is never formatted over the client-recovery database.systemd-tmpfiles --create /usr/lib/tmpfiles.d/pnfs.conf, which recreates what the mount hides./run/mds/active.nfsdcld,nfs-mountd, andnfs-server, in that order.On an older image that mounts the state disk and starts nfsd at boot, every step finds its work done, so the agent works with both guests. The change is minimal on purpose: promotion, fencing, and the reservation key belong to the warm-standby implementation, a separate PR that replaces this self-activation with operator-driven promotion.
Tests
TestAGuestBootedAsAStandbyIsActivated,TestABlankStateDiskIsFormattedFirst, andTestAnUnreadableStateDiskIsNeverFormatted(regression, U-117) failed against a stub that did nothing and pass with the fix.TestAGuestAlreadyServingIsLeftAsItIscovers the older image.go test -race ./internal/mds/agent/, a Linux build and vet ofcmd/mds-agent, golangci-lint, and the house-style gate pass.pnfsos-95b667b,pnfs-minimalplus pnfs-common: shorten the metadata server's NFSv4 lease and grace time to 15 s vela-os#32). The agent loggedthe guest is active: state disk mounted at /var/lib/nfs, nfsd started, nfsd started, the export went Ready, and four pNFS writers ran with no stalls. The MDS was then evicted, and later moved to another node by a drain, and came up active each time. The same cluster withmain's agent and the same guest generation never turned healthy.