ZFS shouldn't count vdev IO errors on hotplug removal

Description

On FreeBSD, a drive can be pulled from a hot swap bay and the system will recognize that the device has been hotplugged and offline the vdev without counting any IO errors toward it, so when reinserted or replaced by a spare and reslivered, the pool will return to a healthy state.

On Linux, IO errors are being counted for the vdev during removal so the pool ends up in a degraded state when all is said and done. The reason for this needs to be investigated and remedied for feature parity with FreeBSD.

Problem/Justification

None

Impact

None

Activity

Show:

Ryan Moeller September 30, 2022 at 6:57 PM

Ryan Moeller February 4, 2022 at 6:52 PM

ZFS has zed on Linux, a userland "zfs event daemon" that should offline the vdevs in the pool in response to udev disk removal events. But the kernel code should also be able to tell that IO failed because the disk was removed. ZFS uses bdev_check_media_change on 5.10+ to check if a device should be invalidated when IO fails. Errors are counted before that check, if the vdev has not been marked as removed by zed.

On FreeBSD, the kernel invokes a callback on disk removal which ZFS uses to mark the vdevs as being removed. I suppose this is much faster than the udev event bouncing back and forth between kernel and userland. I'm not sure if the timing is the whole explanation for FreeBSD not racking up errors, nor do I know if Linux has or could have some similar functionality in the kernel which would solve the problem. That may be worth experimenting with.

Ryan Moeller December 22, 2021 at 4:52 PM

Nevermind, they are installed correctly after all.

Ryan Moeller December 22, 2021 at 4:01 PM

It seems the udev rules for zfs are not being installed.

Complete

Details

Assignee

Reporter

Labels

Impact

Low

Time remaining

0m

Components

Fix versions

Affects versions

Priority

Katalon Platform

Created July 27, 2021 at 7:44 PM
Updated October 27, 2022 at 6:44 PM
Resolved September 30, 2022 at 6:57 PM

Flag notifications