Skip to content

Commit fc67004

Browse files
ahrenstonyhutter
authored andcommitted
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. Reviewed-by: Paul Dagnelie <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #7887 Closes #10117
1 parent e1b0704 commit fc67004

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

cmd/zfs/zfs_main.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4144,6 +4144,16 @@ zfs_do_send(int argc, char **argv)
41444144
}
41454145
}
41464146

4147+
if (flags.dedup) {
4148+
(void) fprintf(stderr,
4149+
gettext("WARNING: deduplicated send is "
4150+
"deprecated, and will be removed in a\n"
4151+
"future release. (In the future, the flag will be "
4152+
"accepted, but a\n"
4153+
"regular, non-deduplicated stream will be "
4154+
"generated.)\n\n"));
4155+
}
4156+
41474157
argc -= optind;
41484158
argv += optind;
41494159

include/libzfs_impl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ struct libzfs_handle {
7171
int libzfs_pool_iter;
7272
char libzfs_chassis_id[256];
7373
boolean_t libzfs_prop_debug;
74+
boolean_t libzfs_dedup_warning_printed;
7475
};
7576

7677
#define ZFSSHARE_MISS 0x01 /* Didn't find entry in cache */

lib/libzfs/libzfs_sendrecv.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3984,6 +3984,26 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
39843984
(void) printf("found clone origin %s\n", origin);
39853985
}
39863986

3987+
if (!hdl->libzfs_dedup_warning_printed &&
3988+
(DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &
3989+
DMU_BACKUP_FEATURE_DEDUP)) {
3990+
(void) fprintf(stderr,
3991+
gettext("WARNING: This is a deduplicated send stream. "
3992+
"The ability to send and\n"
3993+
"receive deduplicated send streams is deprecated. "
3994+
"In the future, the\n"
3995+
"ability to receive a deduplicated send stream with "
3996+
"\"zfs receive\" will be\n"
3997+
"removed. However, in the future, a utility will be "
3998+
"provided to convert a\n"
3999+
"deduplicated send stream to a regular "
4000+
"(non-deduplicated) stream. This\n"
4001+
"future utility will require that the send stream be "
4002+
"located in a\n"
4003+
"seek-able file, rather than provided by a pipe.\n\n"));
4004+
hdl->libzfs_dedup_warning_printed = B_TRUE;
4005+
}
4006+
39874007
boolean_t resuming = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &
39884008
DMU_BACKUP_FEATURE_RESUMING;
39894009
boolean_t raw = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &

man/man8/zfs.8

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3461,6 +3461,9 @@ By default, a full stream is generated.
34613461
.Bl -tag -width "-D"
34623462
.It Fl D, -dedup
34633463
Generate a deduplicated stream.
3464+
\fBDeduplicated send is deprecated and will be removed in a future release.\fR
3465+
(In the future, the flag will be accepted but a regular, non-deduplicated
3466+
stream will be generated.)
34643467
Blocks which would have been sent multiple times in the send stream will only be
34653468
sent once.
34663469
The receiving system must also support this feature to receive a deduplicated
@@ -3835,6 +3838,18 @@ destroyed by using the
38353838
.Nm zfs Cm destroy Fl d
38363839
command.
38373840
.Pp
3841+
Deduplicated send streams can be generated by using the
3842+
.Nm zfs Cm send Fl D
3843+
command.
3844+
\fBThe ability to send and receive deduplicated send streams is deprecated.\fR
3845+
In the future, the ability to receive a deduplicated send stream with
3846+
.Nm zfs Cm receive
3847+
will be removed.
3848+
However, in the future, a utility will be provided to convert a
3849+
deduplicated send stream to a regular (non-deduplicated) stream.
3850+
This future utility will require that the send stream be located in a
3851+
seek-able file, rather than provided by a pipe.
3852+
.Pp
38383853
If
38393854
.Fl o Em property Ns = Ns Ar value
38403855
or

0 commit comments

Comments
 (0)