Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

ZFS send/receive resuming an interrupted transfer

Joined
Apr 19, 2016
Messages
2
The ability to resume an interrupted ZFS send/receive transfer is now part of FreeBSD 10.3, originally having been added to another part of OpenZFS last October, merged across, and appears to be present in the core FreeNAS 9.10 command line tools.

https://www.illumos.org/issues/2605
https://github.com/freebsd/freebsd/commit/c1c5997359a0319d0b6984203c5c3bb10c28274c

Are there any reasonably simple ways of using this functionality in a FreeNAS 9.10 environment? Are there any plans to make it available from the UI at some point in the future?

Thanks.

Part of the zfs man page from FreeNAS 9.10 describes the functionality as

"If the receive is interrupted, save the partially received
state, rather than deleting it. Interruption may be due to
premature termination of the stream (e.g. due to network
failure or failure of the remote system if the stream is
being read over a network connection), a checksum error in
the stream, termination of the zfs receive process, or
unclean shutdown of the system.

The receive can be resumed with a stream generated by zfs
send -t token, where the token is the value of the
receive_resume_token property of the filesystem or volume
which is received into."
 

dlavigne

Storage Engineering
Joined
May 24, 2011
Messages
12,063
I'm pretty sure this is slated for 10 and that no changes to replication are planned for 9.x.
 
Joined
Apr 19, 2016
Messages
2
Thanks for the update. It would be good if this functionality could be included in FreeNAS 10. I'll keep a watch out for the release notes.
 

qqBazz

Newbie
Joined
Nov 5, 2015
Messages
34
Here's something odd, though: the zfs command in 10.3-STABLE appears to lack the flag that enables resuming a transfer, while the zfs in 10.3-RELEASE has it.

Here's a stock freebsd machine on 10.3-RELEASE -- note that -s appears as a listed option to zfs recv.

Code:
urras% zfs recv -s
missing snapshot argument
usage:
	receive|recv [-vnsFu] <filesystem|volume|snapshot>
	receive|recv [-vnsFu] [-o origin=<snapshot>] [-d | -e] <filesystem>
	receive|recv -A <filesystem|volume>

For the property list, run: zfs set|get

For the delegated permission list, run: zfs allow|unallow
urras% uname -a
FreeBSD urras.XXXXXX.XXXX 10.3-RELEASE FreeBSD 10.3-RELEASE #0 r297264: Fri Mar 25 02:10:02 UTC 2016	 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64


And here's the output from a FreeNAS-9.10.2 (a476f16) machine on 10.3-STABLE, which doesn't include -s as an option (and indeed, fails if invoked with zfs recv -s).

Code:
scarecrow# zfs recv
missing snapshot argument
usage:
		receive|recv [-vnFu] [-o <property>] ... [-x <property>] ... [-l <filesystem|volume>] ... <filesystem|volume|snapshot>
		receive|recv [-vnFu] [-d | -e] [-o <property>] ... [-x <property>] ... [-l <filesystem|volume>] ... <filesystem>

For the property list, run: zfs set|get

For the delegated permission list, run: zfs allow|unallow
scarecrow# uname -a
FreeBSD scarecrow.XXXXXX.XXXX 10.3-STABLE FreeBSD 10.3-STABLE #0 r295946+47645f1(9.10.2-STABLE): Mon Dec 19 08:30:01 UTC 2016	 root@gauntlet:/freenas-9.10-releng/_BE/objs/freenas-9.10-releng/_BE/os/sys/FreeNAS.amd64  amd64


I'm surprised that STABLE is missing this, since it's in the man page. A regression bug, maybe?
 
Last edited:

qqBazz

Newbie
Joined
Nov 5, 2015
Messages
34
I forgot to explicitly mention that, but yes, it does:

Code:
scarecrow# zfs send wd4g/jails/plexmediaserver_1@transfer | zfs recv -s -dv first-five
invalid option 's'
usage:
		receive|recv [-vnFu] [-o <property>] ... [-x <property>] ... [-l <filesystem|volume>] ... <filesystem|volume|snapshot>
		receive|recv [-vnFu] [-d | -e] [-o <property>] ... [-x <property>] ... [-l <filesystem|volume>] ... <filesystem>

For the property list, run: zfs set|get

For the delegated permission list, run: zfs allow|unallow
warning: cannot send 'wd4g/jails/plexmediaserver_1@transfer': Broken pipe
 

Dotty

FreeNAS Experienced
Joined
Dec 10, 2016
Messages
125
I forgot to explicitly mention that, but yes, it does:

Code:
scarecrow# zfs send wd4g/jails/plexmediaserver_1@transfer | zfs recv -s -dv first-five
invalid option 's'
usage:
		receive|recv [-vnFu] [-o <property>] ... [-x <property>] ... [-l <filesystem|volume>] ... <filesystem|volume|snapshot>
		receive|recv [-vnFu] [-d | -e] [-o <property>] ... [-x <property>] ... [-l <filesystem|volume>] ... <filesystem>

For the property list, run: zfs set|get

For the delegated permission list, run: zfs allow|unallow
warning: cannot send 'wd4g/jails/plexmediaserver_1@transfer': Broken pipe

Im running 9.10.1-U4 , and the resume works for me,, using the receive_resume_token property.
Via console/ssh or course,, not GUI.
 

PhilipS

FreeNAS Experienced
Joined
May 10, 2016
Messages
179
Resume is not available in 9.10.2 u1 or u2, but it is listed in the man page. Interesting that it was available in 9.10.1.
 

Dotty

FreeNAS Experienced
Joined
Dec 10, 2016
Messages
125
Yes, I just made it work,, twice,
The guys at rsync.net helped me out,, they are superb with their support.
 
Last edited:

PhilipS

FreeNAS Experienced
Joined
May 10, 2016
Messages
179
Joined
May 24, 2017
Messages
1
The bug has been marked as resolved for target 11.0 but is there any chance to see it pushed on the 9.10 branch too? It's quite annoying that zfs send/recv resuming works on 9.10.1 but not 9.10.2. I would rather not upgrade to 11 just yet in production.
 

Stux

FreeNAS Wizard
Joined
Jun 2, 2016
Messages
4,166
Is this going to feature in GUI replications in 11?
 

dlavigne

Storage Engineering
Joined
May 24, 2011
Messages
12,063
The bug has been marked as resolved for target 11.0 but is there any chance to see it pushed on the 9.10 branch too? It's quite annoying that zfs send/recv resuming works on 9.10.1 but not 9.10.2. I would rather not upgrade to 11 just yet in production.
You would have to make a feature request (if you do, post the issue number here). Note that since the dev team is small, it's rare to MFC non-critical changes to an earlier branch. But that does not mean that you can't make a compelling argument for a feature.
 

dlavigne

Storage Engineering
Joined
May 24, 2011
Messages
12,063
Is this going to feature in GUI replications in 11?
I don't recall anyone making a feature request for that yet. Making one now would be a good idea as they are redoing the GUI for the new UI. If you make this feature request, please post the issue number.
 

Stux

FreeNAS Wizard
Joined
Jun 2, 2016
Messages
4,166

Anon93873

FreeNAS Aware
Joined
Dec 28, 2016
Messages
19
I support the inclusion of this feature as soon as possible. I am using two FreeNAS devices, one of which has a particularly sluggish upstream limit and is prone to connection dropping. Inclusion of resumable ZFS send in the next edition of FreeNAS would be especially useful.
 
Top