I have (had, it's already been swapped out, asking this for future use) a drive that is indicating pending failure with internal SMART tests and bad block remaps.
It is straightforward to mdadm --fail
the soon to be bad drive and rebuild to a hot spare, or to pull the drive and put a new one in, then rebuild to that drive.
The problem is this takes the array to degraded state for the entire period of that resync, incurring both the additional failure risk and the performance overhead of running degraded. That's expected if you actually have a drive failure, but it is an unnecessary exposure if the drive hasn't actually failed yet.
How can I pre-emptively replace/rebuild that single drive to a hot spare without taking it out of service first?