Skip to content
Permalink
Browse files

capture the stderr of zfs send command in the case of a resumed repli…

…cation where the send size can't be estimated (in which case pv is not working anyway, so we can break the interactivitiy)
  • Loading branch information...
phreaker0 committed Jun 6, 2019
1 parent 22fe41c commit 56f97b5bd28e6ebc372bfe61a10ca4572c6ed823
Showing with 12 additions and 3 deletions.
  1. +12 −3 syncoid
15 syncoid
@@ -526,9 +526,18 @@ sub syncdataset {
if (!$quiet) { print "Resuming interrupted zfs send/receive from $sourcefs to $targetfs (~ $disp_pvsize remaining):\n"; }
if ($debug) { print "DEBUG: $synccmd\n"; }

($stdout, $exit) = tee_stdout {
system("$synccmd")
};
if ($pvsize == 0) {
# we need to capture the error of zfs send, this will render pv useless but in this case
# it doesn't matter because we don't know the estimated send size (probably because
# the initial snapshot used for resumed send doesn't exist anymore)
($stdout, $exit) = tee_stderr {
system("$synccmd")
};
} else {
($stdout, $exit) = tee_stdout {
system("$synccmd")
};
}

$exit == 0 or do {
if ($stdout =~ /\Qused in the initial send no longer exists\E/) {

0 comments on commit 56f97b5

Please sign in to comment.
You can’t perform that action at this time.