Closed
Description
System information
Type | Version/Name |
---|---|
Distribution Name | gentoo |
Distribution Version | rolling release |
Linux Kernel | 4.4.6 |
Architecture | amd64 |
ZFS Version | 0.7.1-r0-gentoo |
SPL Version | 0.7.1-r0-gentoo |
Describe the problem you're observing
Trying to replicate a zfs dataset with send -R fails for datasets with many snapshots.
I created a list snapshots.home of all snapshots and used binary search to find out how many snapshots I can send. Turns out, the break point is 2^16:
zfs send -vR $( awk 'FNR==65536' snapshots.home ) >/dev/null 2>send.log
fails with an internal error. Here is the tail of send.log:
...
send from @2016-11-27_21-10-01 to backup/home@2016-11-27_21-15-01 estimated size is 1.44M
send from @2016-11-27_21-15-01 to backup/home@2016-11-27_21-20-01 estimated size is 9.77M
total estimated size is 846G
cannot hold: operation not applicable to datasets of this type
internal error: Invalid argument
The command
zfs send -vR $( awk 'FNR==65535' snapshots.home ) >/dev/null 2>send.log
completes just fine.
I conjecture that this is caused by using an unsigned short in the avl data structure:
struct avl_node {
struct avl_node *avl_child[2]; /* left/right children */
struct avl_node *avl_parent; /* this node's parent */
unsigned short avl_child_index; /* my index in parent's avl_child[] */
short avl_balance; /* balance value: -1, 0, +1 */
};