-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incremental receive silently failing for recursive sends
The problem occurs because dmu_recv_begin pulls in the payload and next header from the input stream in order to use the contents of the begin record's nvlist. However, the change to do that before the other checks in dmu_recv_begin occur caused a regression where an empty send stream in a recursive send could have its END record consumed by this, which broke the logic of recv_skip. A test is also included to protect against this case in the future. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Paul Dagnelie <[email protected]> Closes #12661 Closes #14568
- Loading branch information
1 parent
589f59b
commit da19d91
Showing
5 changed files
with
105 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/ksh -p | ||
|
||
# | ||
# This file and its contents are supplied under the terms of the | ||
# Common Development and Distribution License ("CDDL"), version 1.0. | ||
# You may only use this file in accordance with the terms of version | ||
# 1.0 of the CDDL. | ||
# | ||
# A full copy of the text of the CDDL should have accompanied this | ||
# source. A copy of the CDDL is also available via the Internet at | ||
# http://www.illumos.org/license/CDDL. | ||
# | ||
|
||
# | ||
# Copyright (c) 2023 by Delphix. All rights reserved. | ||
# | ||
|
||
. $STF_SUITE/tests/functional/rsend/rsend.kshlib | ||
|
||
# | ||
# Description: | ||
# Verify recursive incremental sends missing snapshots behave correctly. | ||
# | ||
# Strategy: | ||
# 1. Create snapshots on source filesystem. | ||
# 2. Recursively send snapshots. | ||
# 3. Delete snapshot on source filesystem | ||
# 4. Perform incremental recursive send. | ||
# 5. Verify matching snapshot lists. | ||
# | ||
|
||
verify_runnable "both" | ||
|
||
sendfs=$POOL/sendfs | ||
recvfs=$POOL2/recvfs | ||
|
||
function cleanup { | ||
rm $BACKDIR/stream1 | ||
rm $BACKDIR/stream2 | ||
zfs destroy -r $sendfs | ||
zfs destroy -r $recvfs | ||
} | ||
|
||
log_assert "Verify recursive incremental sends missing snapshots behave correctly." | ||
log_onexit cleanup | ||
|
||
log_must zfs create $sendfs | ||
log_must zfs snapshot $sendfs@A | ||
log_must zfs snapshot $sendfs@B | ||
log_must zfs snapshot $sendfs@C | ||
log_must eval "zfs send -Rpv $sendfs@C > $BACKDIR/stream1" | ||
log_must eval "zfs receive -F $recvfs < $BACKDIR/stream1" | ||
log_must zfs list $sendfs@C | ||
|
||
log_must zfs destroy $sendfs@C | ||
log_must zfs snapshot $sendfs@D | ||
log_must zfs snapshot $sendfs@E | ||
log_must eval "zfs send -Rpv -I $sendfs@A $sendfs@E > $BACKDIR/stream2" | ||
log_must eval "zfs receive -Fv $recvfs < $BACKDIR/stream2" | ||
log_must zfs list $sendfs@D | ||
log_must zfs list $sendfs@E | ||
log_mustnot zfs list $sendfs@C | ||
log_pass "Verify recursive incremental sends missing snapshots behave correctly." |