9e052db462
Mirrors are supposed to provide redundancy in the face of whole-disk failure and silent damage (e.g. some data on disk is not right, but ZFS hasn't detected the whole device as being broken). However, the current device removal implementation bypasses some of the mirror's redundancy. Note that in no case is incorrect data returned, but we might get a checksum error when we should have been able to find the right data. There are two underlying problems: 1. When we remove a mirror device, we only read one side of the mirror. Since we can't verify the checksum, this side may be silently bad, but the good data is on the other side of the mirror (which we didn't read). This can cause the removal to "bake in" the busted data – all copies of the data in the new location are the same, busted version, while we left the good version behind. The fix for this is to read and copy both sides of the mirror. If the old and new vdevs are mirrors, we will read both sides of the old mirror, and write each copy to the corresponding side of the new mirror. (If the old and new vdevs have a different number of children, we will do this as best as possible.) Even though we aren't verifying checksums, this ensures that as long as there's a good copy of the data, we'll have a good copy after the removal, even if there's silent damage to one side of the mirror. If we're removing a mirror that has some silent damage, we'll have exactly the same damage in the new location (assuming that the new location is also a mirror). 2. When we read from an indirect vdev that points to a mirror vdev, we only consider one copy of the data. This can lead to reduced effective redundancy, because we might read a bad copy of the data from one side of the mirror, and not retry the other, good side of the mirror. Note that the problem is not with the removal process, but rather after the removal has completed (having copied correct data to both sides of the mirror), if one side of the new mirror is silently damaged, we encounter the problem when reading the relocated data via the indirect vdev. Also note that the problem doesn't occur when ZFS knows that one side of the mirror is bad, e.g. when a disk entirely fails or is offlined. The impact is that reads (from indirect vdevs that point to mirrors) may return a checksum error even though the good data exists on one side of the mirror, and scrub doesn't repair all data on the mirror (if some of it is pointed to via an indirect vdev). The fix for this is complicated by "split blocks" - one logical block may be split into two (or more) pieces with each piece moved to a different new location. In this case we need to read all versions of each split (one from each side of the mirror), and figure out which combination of versions results in the correct checksum, and then repair the incorrect versions. This ensures that we supply the same redundancy whether you use device removal or not. For example, if a mirror has small silent errors on all of its children, we can still reconstruct the correct data, as long as those errors are at sufficiently-separated offsets (specifically, separated by the largest block size - default of 128KB, but up to 16MB). Porting notes: * A new indirect vdev check was moved from dsl_scan_needs_resilver_cb() to dsl_scan_needs_resilver(), which was added to ZoL as part of the sequential scrub work. * Passed NULL for zfs_ereport_post_checksum()'s zbookmark_phys_t parameter. The extra parameter is unique to ZoL. * When posting indirect checksum errors the ABD can be passed directly, zfs_ereport_post_checksum() is not yet ABD-aware in OpenZFS. Authored by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Tim Chase <tim@chase2k.com> Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov> Ported-by: Tim Chase <tim@chase2k.com> OpenZFS-issue: https://illumos.org/issues/9290 OpenZFS-commit: https://github.com/openzfs/openzfs/pull/591 Closes #6900 |
||
---|---|---|
.. | ||
crypto | ||
fm | ||
fs | ||
lua | ||
sysevent | ||
abd.h | ||
arc_impl.h | ||
arc.h | ||
avl_impl.h | ||
avl.h | ||
blkptr.h | ||
bplist.h | ||
bpobj.h | ||
bptree.h | ||
bqueue.h | ||
dbuf.h | ||
ddt.h | ||
dmu_impl.h | ||
dmu_objset.h | ||
dmu_send.h | ||
dmu_traverse.h | ||
dmu_tx.h | ||
dmu_zfetch.h | ||
dmu.h | ||
dnode.h | ||
dsl_bookmark.h | ||
dsl_crypt.h | ||
dsl_dataset.h | ||
dsl_deadlist.h | ||
dsl_deleg.h | ||
dsl_destroy.h | ||
dsl_dir.h | ||
dsl_pool.h | ||
dsl_prop.h | ||
dsl_scan.h | ||
dsl_synctask.h | ||
dsl_userhold.h | ||
edonr.h | ||
efi_partition.h | ||
frame.h | ||
hkdf.h | ||
Makefile.am | ||
metaslab_impl.h | ||
metaslab.h | ||
mmp.h | ||
mntent.h | ||
multilist.h | ||
nvpair_impl.h | ||
nvpair.h | ||
pathname.h | ||
policy.h | ||
range_tree.h | ||
refcount.h | ||
rrwlock.h | ||
sa_impl.h | ||
sa.h | ||
sdt.h | ||
sha2.h | ||
skein.h | ||
spa_boot.h | ||
spa_checksum.h | ||
spa_impl.h | ||
spa.h | ||
space_map.h | ||
space_reftree.h | ||
sysevent.h | ||
trace_acl.h | ||
trace_arc.h | ||
trace_common.h | ||
trace_dbgmsg.h | ||
trace_dbuf.h | ||
trace_dmu.h | ||
trace_dnode.h | ||
trace_multilist.h | ||
trace_txg.h | ||
trace_vdev.h | ||
trace_zil.h | ||
trace_zio.h | ||
trace_zrlock.h | ||
trace.h | ||
txg_impl.h | ||
txg.h | ||
u8_textprep_data.h | ||
u8_textprep.h | ||
uberblock_impl.h | ||
uberblock.h | ||
uio_impl.h | ||
unique.h | ||
uuid.h | ||
vdev_disk.h | ||
vdev_file.h | ||
vdev_impl.h | ||
vdev_indirect_births.h | ||
vdev_indirect_mapping.h | ||
vdev_raidz_impl.h | ||
vdev_raidz.h | ||
vdev_removal.h | ||
vdev.h | ||
xvattr.h | ||
zap_impl.h | ||
zap_leaf.h | ||
zap.h | ||
zcp_global.h | ||
zcp_iter.h | ||
zcp_prop.h | ||
zcp.h | ||
zfeature.h | ||
zfs_acl.h | ||
zfs_context.h | ||
zfs_ctldir.h | ||
zfs_debug.h | ||
zfs_delay.h | ||
zfs_dir.h | ||
zfs_fuid.h | ||
zfs_ioctl.h | ||
zfs_onexit.h | ||
zfs_project.h | ||
zfs_ratelimit.h | ||
zfs_rlock.h | ||
zfs_sa.h | ||
zfs_stat.h | ||
zfs_vfsops.h | ||
zfs_vnops.h | ||
zfs_znode.h | ||
zil_impl.h | ||
zil.h | ||
zio_checksum.h | ||
zio_compress.h | ||
zio_crypt.h | ||
zio_impl.h | ||
zio_priority.h | ||
zio.h | ||
zpl.h | ||
zrlock.h | ||
zvol.h |