Skip to content

fix(pnfs): recreate an MDS pod that stays unready after it has served - #910

Closed
boddumanohar wants to merge 1 commit into
mainfrom
fix/mds-recreate-stuck-pod
Closed

boddumanohar wants to merge 1 commit into
mainfrom
fix/mds-recreate-stuck-pod

Conversation

@boddumanohar

Copy link
Copy Markdown
Member

Problem

RCA pnfs_mds_stays_dead_after_state_disk_journal_abort_rca_20261112: an MDS lost its storage paths and stayed 0/1 for 19 h 39 m. #909 makes the runner exit when a booted guest stays unhealthy, but that restarts only the container. On cluster 111 the restarted container crash-looped:

qemu-system-x86_64: -drive id=state,file=/dev/mds-state,...: Could not open '/dev/mds-state': No such device or address

The host removed the state volume's NVMe device after its 60 s loss timeout, the CSI node plugin's reconnect monitor gave up on it ("assuming it's gone"), and a container restart does not make kubelet stage the volume again. Deleting the pod by hand recovered the MDS in 22 s, and the client resumed I/O without being restarted.

Changes

  • internal/controllers/driver/mds_watchdog.go: MDSReadinessWatchdog, a leader-elected Runnable modeled on controlplane/webapiwatchdog.go. Every 30 s it lists pods carrying storage.simplyblock.io/cluster-id.
    • It marks a pod with storage.simplyblock.io/mds-was-ready once the pod has been ready.
    • It deletes a marked pod that has been unready for 3 minutes, which is past the runner's 90 s deadline. The delete is preconditioned on the pod's UID and comes with an MDSPodStuck warning event. The StatefulSet then creates a new pod.
    • A pod that never turned ready is left to the runner's boot deadline.
  • cmd/main.go: registers the watchdog.

No RBAC change: the operator already has patch and delete on pods.

This recovers MDS pods running images without #909 as well, since it only reads the pod's Ready condition.

Unit tests

  • TestAnMDSPodUnreadyPastTheThresholdIsRecreated (O-53) failed against a stub before the fix: the MDS pod stayed after four minutes unready: nothing recovers the pNFS data path.
  • O-54 covers the negatives: a pod unready only briefly, one never ready, a ready one, and a pod that isn't an MDS.

go test -race ./internal/controllers/driver/, make -C operator lint, and the house-style gate pass. make manifests generate and make helm-sync produce no diff.

Follow-ups

  • The web API watchdog and this one share their shape; a shared core can be extracted.
  • CSI: the node plugin gives up on a block volume whose device the kernel removed. Reconnecting it, or ctrl_loss_tmo=-1 for the MDS state volume, would let a container restart recover without a new pod.

Cluster test

Pending: the port-4426 fault on 111, with this operator and #909's MDS image.

Related: #909.

An MDS that lost its storage paths stayed unready for 19 h 39 m. The runner
now restarts its container (#909), but on cluster 111 the restarted
container crash-looped on a missing /dev/mds-state: the host had removed the
state volume's device, and only a new pod stages the volume again. Deleting
the pod by hand recovered the MDS in 22 s.

MDSReadinessWatchdog marks an MDS pod once it has been ready, and deletes a
marked pod that has been unready for 3 minutes, preconditioned on its UID,
with an MDSPodStuck event. The StatefulSet creates the replacement. A pod
that never turned ready is left to the runner's boot deadline.

Regression: 2026-11-12-pnfs-mds-stays-dead-after-state-disk-journal-abort
@boddumanohar

Copy link
Copy Markdown
Member Author

Merged into #909 (commit d6c12cb), which now carries the runner, agent, and operator changes for the same RCA.

@boddumanohar
boddumanohar deleted the fix/mds-recreate-stuck-pod branch November 12, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant