Repository navigation
feat(disk): write probe catches a root filesystem that stopped taking writes - #59
Merged
Merged
Conversation
… writes On 2026-10-06 a1ubr720p02's boot RAID VD dropped off the controller. Writes to / returned EROFS/EIO and kubelet died, but node-doctor kept reporting DiskHealthy=True. Three reasons: the statfs ST_RDONLY check cannot see an ext4 that shut down after errors (Linux >= 6.7 no longer sets SB_RDONLY), it statted the container's own /, and the chart's ReadOnly alert matched a condition_type no monitor emits. - system-disk: new writeProbePaths / writeProbeTimeout (default 10s). Each check creates, writes, fsyncs and unlinks a file. An error or a timeout sets ReadonlyFilesystem=True (reason WriteProbeFailed) and emits an event. While a probe is still blocked no new one starts, so a hung device cannot pile up goroutines. The probe reports one condition for all paths and never reports False over a statfs True. - chart: monitors.disk.writeProbe (enabled by default) mounts /var/lib/node-doctor/write-probe read-write at /host-write-probe and configures it. - chart: NodeDoctorReadOnlyFilesystem now matches condition_type="ReadonlyFilesystem" (the old expression matched ReadOnlyFilesystem and could never fire). Refs: cluster-services-831
…s explicitly make helm-generate output for the monitors.disk.writeProbe block added to values.yaml.template (Helm Chart CI job failed on helm-verify-generated). Assign the best-effort f.Close() in the write/fsync error paths to _ so gosec G104 (alerts 591/592) is satisfied; the write/fsync error remains the probe verdict.
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.
On 2026-10-06 (cluster-services-831 postmortem) a1ubr720p02's boot RAID virtual disk dropped off the PERC controller. Writes to
/returned EROFS/EIO and kubelet died. node-doctor kept reportingDiskHealthy=Truefor three reasons:ST_RDONLYcheck cannot see an ext4 filesystem that shut down after errors. Since Linux 6.7 that case no longer setsSB_RDONLY, and the nodes run kernel 7.0./, not the host's.NodeDoctorReadOnlyFilesystemrule matchedcondition_type="ReadOnlyFilesystem", which no monitor emits. The live label values confirm it:ReadonlyFilesystemnever appears, andReadOnlyFilesystemdoesn't exist. The rule could never fire.Changes
writeProbePathsandwriteProbeTimeout(default 10s). On every check the monitor creates, writes, fsyncs and unlinks a file in each path.ReadonlyFilesystem=Truewith reasonWriteProbeFailedand emits an event.Falseover aTruefrom the statfs check.monitors.disk.writeProbesetting, enabled by default. It mounts the host's/var/lib/node-doctor/write-probe(DirectoryOrCreate) read-write at/host-write-probeand configures the probe. The rest of the host root stays read-only.NodeDoctorReadOnlyFilesystemnow matchesReadonlyFilesystem.Tests
disk_write_probe_test.gocovers:Falseover a statfsTrue;Mutation-checked: removing the in-flight guard or the failure branch makes the tests fail.
go test -race ./pkg/monitors/system/andgo test ./pkg/...pass.helm lintpasses, and the render was checked with the probe enabled and disabled.This change is independent of #58 (condition ownership). With #58 merged, the node condition is written as
NodeDoctorReadonlyFilesystem.Refs: cluster-services-831