Skip to content

Commit b14c92d

Browse files
committed
deprecate deduplicated send streams
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 <[email protected]>
1 parent 01243e7 commit b14c92d

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

cmd/zfs/zfs_main.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4328,6 +4328,16 @@ zfs_do_send(int argc, char **argv)
43284328
}
43294329
}
43304330

4331+
if (flags.dedup) {
4332+
(void) fprintf(stderr,
4333+
gettext("WARNING: deduplicated send is "
4334+
"deprecated, and will be removed in a\n"
4335+
"future release. (In the future, the flag will be "
4336+
"accepted, but a\n"
4337+
"regular, non-deduplicated stream will be "
4338+
"generated.)\n\n"));
4339+
}
4340+
43314341
if (flags.parsable && flags.verbosity == 0)
43324342
flags.verbosity = 1;
43334343

lib/libzfs/libzfs_sendrecv.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4699,6 +4699,24 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
46994699
(void) printf("found clone origin %s\n", origin);
47004700
}
47014701

4702+
if (DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &
4703+
DMU_BACKUP_FEATURE_DEDUP) {
4704+
(void) fprintf(stderr,
4705+
gettext("WARNING: This is a deduplicated send stream. "
4706+
"The ability to send and\n"
4707+
"receive deduplicated send streams is deprecated. "
4708+
"In the future, the\n"
4709+
"performance of receiving a deduplicated send stream "
4710+
"will be reduced, the\n"
4711+
"memory required will be increased, and the ability "
4712+
"to receive a\n"
4713+
"deduplicated stream from a pipe will be removed. "
4714+
"(A deduplicated send\n"
4715+
"stream will still be able to be received, as long "
4716+
"as it is located in a\n"
4717+
"seek-able file, rather than provided by a pipe.)\n\n"));
4718+
}
4719+
47024720
boolean_t resuming = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &
47034721
DMU_BACKUP_FEATURE_RESUMING;
47044722
boolean_t raw = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &

man/man8/zfs-receive.8

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ destroyed by using the
105105
.Nm zfs Cm destroy Fl d
106106
command.
107107
.Pp
108+
Deduplicated send streams can be generated by using the
109+
.Nm zfs Cm send Fl D
110+
command.
111+
\fBThe ability to send and receive deduplicated send streams is deprecated.\fR
112+
In the future, the performance of receiving a deduplicated send stream will
113+
be reduced, the memory required will be increased, and the ability to
114+
receive a deduplicated stream from a pipe will be removed.
115+
(A deduplicated send stream will still be able to be received, as long as it
116+
is located in a seek-able file, rather than provided by a pipe.)
117+
.Pp
108118
If
109119
.Fl o Em property Ns = Ns Ar value
110120
or

man/man8/zfs-send.8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ By default, a full stream is generated.
8787
.Bl -tag -width "-D"
8888
.It Fl D, -dedup
8989
Generate a deduplicated stream.
90+
\fBDeduplicated send is deprecated and will be removed in a future release.\fR
91+
(In the future, the flag will be accepted but a regular, non-deduplicated
92+
stream will be generated.)
9093
Blocks which would have been sent multiple times in the send stream will only be
9194
sent once.
9295
The receiving system must also support this feature to receive a deduplicated

0 commit comments

Comments
 (0)