zfs/tests/zfs-tests/cmd
Paul Dagnelie 30af21b025 Implement Redacted Send/Receive
Redacted send/receive allows users to send subsets of their data to 
a target system. One possible use case for this feature is to not 
transmit sensitive information to a data warehousing, test/dev, or 
analytics environment. Another is to save space by not replicating 
unimportant data within a given dataset, for example in backup tools 
like zrepl.

Redacted send/receive is a three-stage process. First, a clone (or 
clones) is made of the snapshot to be sent to the target. In this 
clone (or clones), all unnecessary or unwanted data is removed or
modified. This clone is then snapshotted to create the "redaction 
snapshot" (or snapshots). Second, the new zfs redact command is used 
to create a redaction bookmark. The redaction bookmark stores the 
list of blocks in a snapshot that were modified by the redaction 
snapshot(s). Finally, the redaction bookmark is passed as a parameter 
to zfs send. When sending to the snapshot that was redacted, the
redaction bookmark is used to filter out blocks that contain sensitive 
or unwanted information, and those blocks are not included in the send 
stream.  When sending from the redaction bookmark, the blocks it 
contains are considered as candidate blocks in addition to those 
blocks in the destination snapshot that were modified since the 
creation_txg of the redaction bookmark.  This step is necessary to 
allow the target to rehydrate data in the case where some blocks are 
accidentally or unnecessarily modified in the redaction snapshot.

The changes to bookmarks to enable fast space estimation involve 
adding deadlists to bookmarks. There is also logic to manage the 
life cycles of these deadlists.

The new size estimation process operates in cases where previously 
an accurate estimate could not be provided. In those cases, a send 
is performed where no data blocks are read, reducing the runtime 
significantly and providing a byte-accurate size estimate.

Reviewed-by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Prashanth Sreenivasa <pks@delphix.com>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: George Wilson <george.wilson@delphix.com>
Reviewed-by: Chris Williamson <chris.williamson@delphix.com>
Reviewed-by: Pavel Zhakarov <pavel.zakharov@delphix.com>
Reviewed-by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed-by: Prakash Surya <prakash.surya@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes #7958
2019-06-19 09:48:12 -07:00
..
chg_usr_exec Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
devname2devid Fedora 28: Fix misc bounds check compiler warnings 2018-04-04 10:16:47 -07:00
dir_rd_update Use cstyle -cpP in `make cstyle` check 2016-12-12 10:46:26 -08:00
file_check Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
file_trunc Enable remaining tests 2017-05-22 12:34:32 -04:00
file_write OpenZFS 4185 - add new cryptographic checksums to ZFS: SHA-512, Skein, Edon-R 2016-10-03 14:51:15 -07:00
get_diff Implement Redacted Send/Receive 2019-06-19 09:48:12 -07:00
largest_file Use sigaction(2) instead of sigset(3) for portability 2019-04-30 20:45:17 -07:00
libzfs_input_check Implement Redacted Send/Receive 2019-06-19 09:48:12 -07:00
mkbusy Fedora 28: Fix misc bounds check compiler warnings 2018-04-04 10:16:47 -07:00
mkfile Fix calloc(3) arguments order 2018-04-12 10:50:39 -07:00
mkfiles Add support for user/group dnode accounting & quota 2016-10-07 09:45:13 -07:00
mktree Fedora 28: Fix misc bounds check compiler warnings 2018-04-04 10:16:47 -07:00
mmap_exec Enable remaining tests 2017-05-22 12:34:32 -04:00
mmap_libaio Fix mmap / libaio deadlock 2018-03-28 10:19:22 -07:00
mmapwrite deadlock between mm_sem and tx assign in zfs_write() and page fault 2018-10-16 11:11:24 -07:00
nvlist_to_lua OpenZFS 7431 - ZFS Channel Programs 2018-02-08 15:28:18 -08:00
randfree_file Fix coverity defects: CID 147692, 147693, 147694 2016-10-13 14:38:59 -07:00
randwritecomp OpenZFS 9166 - zfs storage pool checkpoint 2018-06-26 10:07:42 -07:00
readmmap Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
rename_dir Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
rm_lnkcnt_zero_file Fix file permissions 2016-10-08 14:57:56 -07:00
stride_dd Implement Redacted Send/Receive 2019-06-19 09:48:12 -07:00
threadsappend Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
user_ns_exec Take user namespaces into account in policy checks 2018-03-07 15:40:42 -08:00
xattrtest Fix handling of maxblkid for raw sends 2019-03-13 10:52:01 -07:00
Makefile.am Implement Redacted Send/Receive 2019-06-19 09:48:12 -07:00
file_common.h Enable remaining tests 2017-05-22 12:34:32 -04:00