freebsd-skq/common
Alexander Motin 79a23a6944 7614 zfs device evacuation/removal
illumos/illumos-gate@5cabbc6b49

https://www.illumos.org/issues/7614:
This project allows top-level vdevs to be removed from the storage pool with
“zpool remove”, reducing the total amount of storage in the pool. This
operation copies all allocated regions of the device to be removed onto other
devices, recording the mapping from old to new location. After the removal is
complete, read and free operations to the removed (now “indirect”) vdev must
be remapped and performed at the new location on disk. The indirect mapping
table is kept in memory whenever the pool is loaded, so there is minimal
performance overhead when doing operations on the indirect vdev.

The size of the in-memory mapping table will be reduced when its entries
become “obsolete” because they are no longer used by any block pointers in
the pool. An entry becomes obsolete when all the blocks that use it are
freed. An entry can also become obsolete when all the snapshots that
reference it are deleted, and the block pointers that reference it have been
“remapped” in all filesystems/zvols (and clones). Whenever an indirect block
is written, all the block pointers in it will be “remapped” to their new
(concrete) locations if possible. This process can be accelerated by using
the “zfs remap” command to proactively rewrite all indirect blocks that
reference indirect (removed) vdevs.

Note that when a device is removed, we do not verify the checksum of the data
that is copied. This makes the process much faster, but if it were used on
redundant vdevs (i.e. mirror or raidz vdevs), it would be possible to copy
the wrong data, when we have the correct data on e.g. the other side of the
mirror. Therefore, mirror and raidz devices can not be removed.

Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Richard Laager <rlaager@wiktel.com>
Reviewed by: Tim Chase <tim@chase2k.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Prashanth Sreenivasa <pks@delphix.com>
2018-02-18 01:21:52 +00:00
..
acl 6762 POSIX write should imply DELETE_CHILD on directories - and 2016-05-11 12:58:12 +00:00
atomic 5043 remove deprecated atomic functions' prototypes 2014-08-20 06:20:06 +00:00
avl 6091 avl_add doesn't assert on non-debug builds 2015-09-11 20:43:14 +00:00
ctf 4474 DTrace Userland CTF Support 2014-06-03 01:24:46 +00:00
list Update vendor-sys/opensolaris to last OpenSolaris state (13149:b23a4dab3d50) 2012-07-18 08:12:04 +00:00
nvpair 7812 Remove gender specific language 2017-04-14 18:22:42 +00:00
unicode Update vendor-sys/opensolaris to last OpenSolaris state (13149:b23a4dab3d50) 2012-07-18 08:12:04 +00:00
util OS-1723 DTrace should speak JSON 2014-06-26 19:48:59 +00:00
zfs 7614 zfs device evacuation/removal 2018-02-18 01:21:52 +00:00