Skip to content

Commit

Permalink
deprecate deduplicated send streams
Browse files Browse the repository at this point in the history
Dedup send can only deduplicate over the set of blocks in the send
command being invoked, and it does not take advantage of the dedup table
to do so. This is a very common misconception among not only users, but
developers, and makes the feature seem more useful than it is. As a
result, many users are using the feature but not getting any benefit
from it.

Dedup send requires a nontrivial expenditure of memory and CPU to
operate, especially if the dataset(s) being sent is (are) not already
using a dedup-strength checksum.

Dedup send adds developer burden. It expands the test matrix when
developing new features, causing bugs in released code, and delaying
development efforts by forcing more testing to be done.

As a result, we are deprecating the use of `zfs send -D` and receiving
of such streams.  This change adds a warning to the man page, and also
prints the warning whenever dedup send or receive are used.

In a future release, we plan to:
1. remove the kernel code for generating deduplicated streams
2. make `zfs send -D` generate regular, non-deduplicated streams
3. remove the kernel code for receiving deduplicated streams
4. make `zfs receive` of deduplicated streams process them in userland
   to "re-duplicate" them, so that they can still be received.

Closes #7887
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
  • Loading branch information
ahrens committed Mar 11, 2020
1 parent 01243e7 commit b14c92d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/zfs/zfs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4328,6 +4328,16 @@ zfs_do_send(int argc, char **argv)
}
}

if (flags.dedup) {
(void) fprintf(stderr,
gettext("WARNING: deduplicated send is "
"deprecated, and will be removed in a\n"
"future release. (In the future, the flag will be "
"accepted, but a\n"
"regular, non-deduplicated stream will be "
"generated.)\n\n"));
}

if (flags.parsable && flags.verbosity == 0)
flags.verbosity = 1;

Expand Down
18 changes: 18 additions & 0 deletions lib/libzfs/libzfs_sendrecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -4699,6 +4699,24 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
(void) printf("found clone origin %s\n", origin);
}

if (DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &
DMU_BACKUP_FEATURE_DEDUP) {
(void) fprintf(stderr,
gettext("WARNING: This is a deduplicated send stream. "
"The ability to send and\n"
"receive deduplicated send streams is deprecated. "
"In the future, the\n"
"performance of receiving a deduplicated send stream "
"will be reduced, the\n"
"memory required will be increased, and the ability "
"to receive a\n"
"deduplicated stream from a pipe will be removed. "
"(A deduplicated send\n"
"stream will still be able to be received, as long "
"as it is located in a\n"
"seek-able file, rather than provided by a pipe.)\n\n"));
}

boolean_t resuming = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &
DMU_BACKUP_FEATURE_RESUMING;
boolean_t raw = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &
Expand Down
10 changes: 10 additions & 0 deletions man/man8/zfs-receive.8
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ destroyed by using the
.Nm zfs Cm destroy Fl d
command.
.Pp
Deduplicated send streams can be generated by using the
.Nm zfs Cm send Fl D
command.
\fBThe ability to send and receive deduplicated send streams is deprecated.\fR
In the future, the performance of receiving a deduplicated send stream will
be reduced, the memory required will be increased, and the ability to
receive a deduplicated stream from a pipe will be removed.
(A deduplicated send stream will still be able to be received, as long as it
is located in a seek-able file, rather than provided by a pipe.)
.Pp
If
.Fl o Em property Ns = Ns Ar value
or
Expand Down
3 changes: 3 additions & 0 deletions man/man8/zfs-send.8
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ By default, a full stream is generated.
.Bl -tag -width "-D"
.It Fl D, -dedup
Generate a deduplicated stream.
\fBDeduplicated send is deprecated and will be removed in a future release.\fR
(In the future, the flag will be accepted but a regular, non-deduplicated
stream will be generated.)
Blocks which would have been sent multiple times in the send stream will only be
sent once.
The receiving system must also support this feature to receive a deduplicated
Expand Down

0 comments on commit b14c92d

Please sign in to comment.