]> git.proxmox.com Git - mirror_zfs.git/commit
Implement Redacted Send/Receive
authorPaul Dagnelie <pcd@delphix.com>
Wed, 19 Jun 2019 16:48:13 +0000 (09:48 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 19 Jun 2019 16:48:12 +0000 (09:48 -0700)
commit30af21b02569ac192f52ce6e6511015f8a8d5729
treee5f1091c2d3a6e511bbd2414782e490c18e0f59c
parentc1b5801bb5af0055e5f3d263beaa07026103e212
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
103 files changed:
cmd/zdb/zdb.c
cmd/zfs/zfs_main.c
cmd/zstreamdump/zstreamdump.c
configure.ac
include/libzfs.h
include/libzfs_core.h
include/sys/Makefile.am
include/sys/bqueue.h
include/sys/dbuf.h
include/sys/dmu.h
include/sys/dmu_impl.h
include/sys/dmu_recv.h
include/sys/dmu_redact.h [new file with mode: 0644]
include/sys/dmu_send.h
include/sys/dmu_traverse.h
include/sys/dsl_bookmark.h
include/sys/dsl_dataset.h
include/sys/dsl_destroy.h
include/sys/fs/zfs.h
include/sys/objlist.h [new file with mode: 0644]
include/sys/spa.h
include/sys/zfs_context.h
include/sys/zfs_ioctl.h
include/sys/zfs_vfsops.h
include/zfeature_common.h
lib/libzfs/libzfs_dataset.c
lib/libzfs/libzfs_iter.c
lib/libzfs/libzfs_mount.c
lib/libzfs/libzfs_sendrecv.c
lib/libzfs/libzfs_util.c
lib/libzfs_core/libzfs_core.c
lib/libzpool/Makefile.am
lib/libzpool/kernel.c
man/man5/zfs-module-parameters.5
man/man5/zpool-features.5
man/man8/zfs.8
module/zcommon/zfeature_common.c
module/zcommon/zfs_namecheck.c
module/zcommon/zfs_prop.c
module/zfs/Makefile.in
module/zfs/arc.c
module/zfs/bptree.c
module/zfs/bqueue.c
module/zfs/dbuf.c
module/zfs/dmu.c
module/zfs/dmu_diff.c
module/zfs/dmu_objset.c
module/zfs/dmu_recv.c
module/zfs/dmu_redact.c [new file with mode: 0644]
module/zfs/dmu_send.c
module/zfs/dmu_traverse.c
module/zfs/dsl_bookmark.c
module/zfs/dsl_dataset.c
module/zfs/dsl_deadlist.c
module/zfs/dsl_destroy.c
module/zfs/dsl_pool.c
module/zfs/dsl_scan.c
module/zfs/objlist.c [new file with mode: 0644]
module/zfs/refcount.c
module/zfs/spa.c
module/zfs/txg.c
module/zfs/zfs_ioctl.c
module/zfs/zfs_vfsops.c
module/zfs/zio.c
tests/runfiles/linux.run
tests/zfs-tests/cmd/Makefile.am
tests/zfs-tests/cmd/get_diff/Makefile.am [new file with mode: 0644]
tests/zfs-tests/cmd/get_diff/get_diff.c [new file with mode: 0644]
tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c
tests/zfs-tests/cmd/stride_dd/.gitignore [new file with mode: 0644]
tests/zfs-tests/cmd/stride_dd/Makefile.am [new file with mode: 0644]
tests/zfs-tests/cmd/stride_dd/stride_dd.c [new file with mode: 0644]
tests/zfs-tests/include/commands.cfg
tests/zfs-tests/include/libtest.shlib
tests/zfs-tests/tests/functional/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_rm_nested.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send-b.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_006_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get.cfg
tests/zfs-tests/tests/functional/redacted_send/Makefile.am [new file with mode: 0644]
tests/zfs-tests/tests/functional/redacted_send/cleanup.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted.cfg [new file with mode: 0644]
tests/zfs-tests/tests/functional/redacted_send/redacted.kshlib [new file with mode: 0644]
tests/zfs-tests/tests/functional/redacted_send/redacted_compressed.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_contents.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_deleted.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_disabled_feature.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_embedded.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_holes.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_incrementals.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_largeblocks.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_many_clones.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_mixed_recsize.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_mounts.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_negative.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_origin.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_props.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_resume.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_size.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/redacted_volume.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/redacted_send/setup.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/rsend/rsend.kshlib
tests/zfs-tests/tests/functional/rsend/rsend_016_neg.ksh [new file with mode: 0755]