zfs/man/man8
Brian Behlendorf 7c9a42921e
Detect IO errors during device removal
* Detect IO errors during device removal

While device removal cannot verify the checksums of individual
blocks during device removal, it can reasonably detect hard IO
errors from the leaf vdevs.  Failure to perform this error
checking can result in device removal completing successfully,
but moving no data which will permanently corrupt the pool.

Situation 1: faulted/degraded vdevs

In the configuration shown below, the removal of mirror-0 will
permanently corrupt the pool.  Device removal will preferentially
copy data from 'vdev1 -> vdev3' and from 'vdev2 -> vdev4'.  Which
in this case will result in nothing being copied since one vdev
in each of those groups in unavailable.  However, device removal
will complete successfully since all IO errors are ignored.

  tank                DEGRADED     0     0     0
    mirror-0          DEGRADED     0     0     0
      /var/tmp/vdev1  FAULTED      0     0     0  external fault
      /var/tmp/vdev2  ONLINE       0     0     0
    mirror-1          DEGRADED     0     0     0
      /var/tmp/vdev3  ONLINE       0     0     0
      /var/tmp/vdev4  FAULTED      0     0     0  external fault

This issue is resolved by updating the source child selection
logic to exclude unreadable leaf vdevs.  Additionally, unwritable
destination child vdevs which can never succeed are skipped to
prevent generating a large number of write IO errors.

Situation 2: individual hard IO errors

During removal if an unexpected hard IO error is encountered when
either reading or writing the child vdev the entire removal
operation is cancelled.  While it may be possible to reconstruct
the data after removal that cannot be guaranteed.  The only
strictly safe thing to do is to cancel the removal.

As a future improvement we may want to instead suspend the removal
process and allow the damaged region to be retried.  But that work
is left for another time, hard IO errors during the removal process
are expected to be exceptionally rare.

Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #6900
Closes #8161
2018-12-04 09:37:37 -08:00
..
.gitignore Ignore *.o.ur-safe build artifacts 2018-05-13 18:59:02 -07:00
Makefile.am Tunable directory for zfs runtime scripts 2018-06-07 09:59:59 -07:00
fsck.zfs.8 Fix NAME section of manpages zhack and fsck.zfs. 2014-03-10 09:19:17 -07:00
mount.zfs.8 zfs.8 & mount.zfs.8: fix a few typos 2016-05-16 12:26:31 -07:00
vdev_id.8 vdev_id support for device link aliases 2012-12-03 14:04:47 -08:00
zdb.8 OpenZFS 9166 - zfs storage pool checkpoint 2018-06-26 10:07:42 -07:00
zed.8.in Tunable directory for zfs runtime scripts 2018-06-07 09:59:59 -07:00
zfs-mount-generator.8.in Tunable directory for zfs runtime scripts 2018-06-07 09:59:59 -07:00
zfs-program.8 Add JSON output support to channel programs 2018-03-19 12:40:58 -07:00
zfs.8 man/zfs.8: document 'received' property source 2018-11-20 09:59:43 -08:00
zgenhostid.8 Add mdoc style checker 2017-09-16 10:51:24 -07:00
zinject.8 OpenZFS 9403 - assertion failed in arc_buf_destroy() 2018-08-29 11:33:33 -07:00
zpool.8 Detect IO errors during device removal 2018-12-04 09:37:37 -08:00
zstreamdump.8 Add zstreamdump(8) command to examine ZFS send streams. 2012-09-02 14:54:27 -07:00