Repository navigation
fix: one unhealthy drive no longer fails its controller's inventory - #107
Conversation
697914a to
4ee0286
Compare
74a8271 to
eb4261b
Compare
| blockDevice, err := s.getBlockDevice(value) | ||
| if err != nil { | ||
| return errors.Wrapf(err, "failed to get block device for %s", value) | ||
| facts.blockDeviceUnknown = true |
There was a problem hiding this comment.
This drops every getBlockDevice error, not just a missing device node. If lsblk is missing, fails for another reason, or its JSON format changes, every drive silently loses its DevicePath and every free drive becomes Unknown, and nothing reports why. That is the "all disks blanked" symptom this PR fixes, now with no error at all. Only degrade when the node is actually gone (for example, check that value exists before calling lsblk), and keep returning the wrapped error otherwise.
4ee0286 to
594d87d
Compare
594d87d to
a1f75a3
Compare
dc6a89b to
da9ef41
Compare
ae2f0cd to
3791dcd
Compare
da9ef41 to
f943de8
Compare
f943de8 to
0d51fda
Compare
a7ab071 to
11b2a13
Compare
0d51fda to
02850ad
Compare
riadelhajjaji-scality
left a comment
There was a problem hiding this comment.
You say in DESIGN.md that a JBOD drive whose by-id link can't be resolved is returned with empty paths. That s true for storcli2 (isPathMissing), but the legacy MegaRAID adapter still fails the whole PhysicalDrives() listing at raidcontroller/megaraid/physicaldrive.go:131. Should we apply the same fix for MegaRAID or scope the DESIGN.md sentence to storcli2 and ssacli ?
f9eec44 to
9673f89
Compare
|
Good catch: the legacy MegaRAID adapter had the same problem, and it was worse, since it looks up the paths of every JBOD drive, failed ones included. A failed or pulled JBOD drive would blank every drive of the controller, which is the ARTESCA-17960 symptom. Our scenarios didn't catch it because the captures only have RAID0 volumes. Fixed in 9673f89 rather than narrowing
The change is in the megaraid commit, and the storcli2 JBOD commit uses the shared check. |
When the drive of a single-drive RAID0 volume fails, the volume goes offline and is no longer a block device of the host: it has no by-id link, and the paths of its failed drive cannot be computed. getPaths returned an error, which failed LogicalVolumes for the whole controller, so the healthy drives of that controller lost their paths too (RD-2154). - An offline or failed volume (OfLn, Fail) gets empty paths without error, whatever its "Exposed to OS" says: no storcli output was captured while a drive was failed, so storcli may still report the volume exposed. - A volume whose "Exposed to OS" is "No" gets empty paths without error. Only this explicit value, spaces trimmed, skips the resolution, as older storcli versions may not report the field. - An offline volume (OfLn) is reported Failed instead of Unknown. - A JBOD drive whose by-id link or device node is missing, such as a failed or pulled drive, is kept with empty paths instead of failing the listing of every drive of the controller. Any other failure, such as a permission error, is still an error. physicaldrive.IsPathMissing tells them apart, and ComputePaths now returns ErrNoPermanentPath for a missing link. - Volume creation still waits for the new volume: a volume listed before it is exposed to the OS has no paths yet, so it is not settled and creation keeps rescanning and retrying. Such a volume no longer stops the search: the offline volume of a failed drive still listing a requested slot must not hide the new, exposed volume. DESIGN.md states that getter read paths degrade gracefully while the create path stays strict. The failed drive scenario of megaraid-disk-failure.feature now reports its expected table: its known bug step is removed. Fixes: ARTESCA-17960
A failed or pulled drive whose device node has disappeared made the lsblk lookup of its Disk Name fail, which aborted the physical drive inventory of the whole controller. The lookup only refines the status, so when it fails and the device node is gone, it no longer aborts the inventory. Instead: - the usage of the device is unknown, and a free drive whose usage is unknown is reported Unknown, never UnassignedGood, so a drive that may carry data is never offered for a new volume; - the device path is dropped, as the kernel can reuse a vanished /dev/sdX name for another disk. Array members and failed drives keep the status ssacli reports. A lookup failure on a device that exists, such as lsblk missing or its output changing, is still an error: ignoring it would silently blank every drive. Refs: ARTESCA-17960
… resolved A JBOD drive whose by-id link cannot be resolved, for instance because udev has not settled yet, failed the physical drive inventory of the whole controller. Keep it with empty paths instead, when its by-id link or device node is missing (physicaldrive.IsPathMissing, as for MegaRAID). Any other failure, such as a permission error, is still an error: ignoring it would silently blank the paths of every JBOD drive. Also cover a degraded RAID volume, whose paths come from the controller output only. Refs: ARTESCA-17960
The storcli2 volume getter read the device path of a volume from its OS drive name and built its permanent path from its NAA Id. The offline RAID0 volume of a failed drive keeps its NAA Id, and may keep a stale OS drive name, but it is not exposed to the OS: it has no block device and no by-id link, so both paths named nothing, or another disk. A volume whose "Exposed to OS" is "No" now has no paths; only this explicit value drops them, as older storcli2 versions may not report the field. An offline or failed volume (OfLn, Fail) has no paths either, whatever its "Exposed to OS" says, as no storcli2 output was captured while a drive was failed. Volume creation used to get the NAA-based path of a new volume listed before it is exposed to the OS. It now gets no paths, so CreateLV waits, like megaraid, until the new volume is exposed or NewVolumeSettleTimeout elapses (60s when zero). DESIGN.md says which failures degrade and which stay errors. The failed drive scenario of storcli2-disk-failure.feature now reports its expected table: its known bug step is removed. Fixes: ARTESCA-17960
129b5d0 to
450b359
Compare
11b2a13 to
8476ff8
Compare
ezekiel-alexrod
left a comment
There was a problem hiding this comment.
See the above claude review comment
… hosts CreateLV waits for a new storcli2 volume to be exposed to the OS, but did not rescan the SCSI bus between checks as megaraid does. If the kernel does not announce the new volume on its own, CreateLV failed after 60s and left the volume on the controller. This wait never ran on storcli2 hardware. - The rescan of megaraid moves to utils.RescanSCSIHosts, which takes the kernel driver of the hosts to rescan, so both adapters share it. - The storcli2 wait rescans the mpi3mr hosts, the driver of the controllers storcli2 drives (MegaRAID 9600 tri-mode, Dell PERC 12), between checks. A rescan failure is not fatal on its own, but it is reported on timeout, as in megaraid. - A new volume is settled only once its by-id link, or its device node when storcli2 reports no NAA Id, exists on the host, as megaraid checks it. storcli2 may report the volume exposed, with its paths, right after "add vd", before the kernel has discovered it: the wait and the rescan would then never run. - StorCLI2.RescanSCSIHosts and StorCLI2.FileExists replace the rescan and the host check in tests; nil rescans the mpi3mr hosts and reads the filesystem. Refs: ARTESCA-17960
450b359 to
38041bd
Compare
|
LGTM! Just waiting on Claude's comment |
7ffc169
into
test/ARTESCA-17960-disk-failure-scenario-gherkin
Commits, one per adapter fix: megaraid, ssacli, storcli2 drives, storcli2 volumes, then the storcli2 wait for a new volume on the host, with a SCSI rescan.
Fixes ARTESCA-17960 (RD-2154). Stacked on #105: it targets #105's branch, so the diff only shows the fix. Retarget it to
mainonce #105 is merged.It supersedes #91.Problem
One unhealthy drive could fail the inventory of its whole controller, so every healthy drive on that controller lost its device paths. On the RD-2154 node this blanked all disks in the UI.
Fixes
OfLn) and is no longer a block device.getPathsstill tried to resolve its paths, failed, and failedLogicalVolumesfor the whole controller.OfLn,Fail) now gets empty paths without error, whatever itsExposed to OSsays. No storcli output was ever captured while a drive was failed (RD-2154 only has the error log), so storcli may still report the volume exposed; withYeskept, the MegaRAID scenario gives the RD-2154 error again without this check.Exposed to OS: Noalso gets empty paths without error. Only this explicit value (spaces trimmed) skips resolution, since older storcli versions may not report the field.OfLnis now reportedFailedinstead ofUnknown.physicaldrive.IsPathMissingholds the rule, and the storcli2 getter uses it too./devnode is gone made thelsblklookup fail, which aborted the whole inventory. When the device node is gone, a lookup failure now marks the device's usage as unknown instead. Any other lookup failure, such aslsblkmissing or failing on a device that exists, is still an error, so it cannot silently blank every drive. A free drive whose usage is unknown is reportedUnknown, neverUnassignedGood, so a drive that may carry data is never offered for a new volume.UsedJBOD drive whose by-id link or device node is missing is kept with empty paths instead of failing the whole inventory. Any other resolution failure, such as a permission error, is still an error.Exposed to OSsays, or a volume reportedExposed to OS: No, now has no paths: neither the permanent path built from its NAA Id, nor a device path from a possibly stale OS drive name.CreateLVused to return a new volume with an NAA-based path even before it was exposed. It now waits, like megaraid and with the same SCSI rescan between checks (onmpi3mrhosts), until the volume is a block device of the host orNewVolumeSettleTimeout(60 s, also when left at zero) elapses. As in megaraid, the volume is settled only once its by-id link (or its device node, when storcli2 reports no NAA Id) exists on the host: storcli2 may report it exposed right afteradd vd, before the kernel has discovered it. An offline volume with the same drives cannot hide the new one.DESIGN.md. Documents the contract that getter read paths degrade gracefully, which failures still are errors, and that the megaraid and storcli2 create paths are deliberately stricter.#91's change for multi-drive megaraid volumes is not carried over, since ARTESCA does not use them.
Tests
megaraid-disk-failure.featureandstorcli2-disk-failure.feature, the scenario "A failed drive does not take the paths of the others" now reports its expected table, so bothknown bug ARTESCA-17960 reports instead:steps are removed. Until they were removed, those steps failed with "the bug looks fixed". All 12 scenarios pass (4 per controller), for example on MegaRAID:getPathswithExposed to OSset toNo(empty paths, no error),Yes, or empty (paths still resolved);volumePaths: anOfLnorFailvolume reported exposed gets empty paths and no error, anOptlorDgrdone still has its paths resolved;OfLn→Failed;lsblklookup does not abort the inventory when the device node is gone, and is still an error when it exists. A free drive whose device could not be inspected is reportedUnknown.volumePaths), a volume not exposed to the OS gets none either, andbyIDPath(formerlypermanentPath) coversExposed to OSset toNo,Yesand missing.CreateLVwaits for a volume exposed on the third listing, gives up on one never exposed, is not hidden by an offline volume with the same drives listed first, and returns at once a volume exposed without an NAA Id.Known risk
The storcli2
CreateLVwait has not run on storcli2 hardware: none is available at the moment. It waits for the new volume's path on the host and rescans thempi3mrSCSI hosts between checks, as megaraid does, with the same sysfs write. If a new storcli2 volume still does not appear,CreateLVfails after 60 s, and the volume stays on the controller (MK8S-467).Delivery
disk-management-agent picks this up once raidmgmt is released and the agent bumps it.