Problem ZFS send / receive 13.1-RELEASE

From: thilo jeremias <thilo_at_nispuk.com>
Date: Mon, 04 Jul 2022 11:53:15 UTC
Hello everyone,

I posted a question on ( https://forums.freebsd.org/threads/zfs-replication-interrupted-and-resumed-missing-snapshots.85666/ )
Which I now think is a bug in zfs send/receive for 13.1-RELEASE


Essentially, an interrupted & restarted receive does not create all snapshots from the stream.

The following:
#Interrupted transfer 
zfs send -R "$D@final" | dd bs=10m count=200 | zfs recv -s "$D"_bad

#Resume transfer
TOKEN="$(zfs get -H receive_resume_token   "$D"_bad  | cut -f 3)"
zfs send -t "$TOKEN" | zfs recv -s "$D"_bad

#Good transfer
zfs send -R "$D@final" | zfs recv -s "$D"_good


Produces:
NAME                          USED  AVAIL     REFER  MOUNTPOINT
Backup/testset_good@initial  85.2K      -      128K  -
Backup/testset_good@add100m  85.2K      -      100M  -
Backup/testset_good@add300m  85.2K      -      400M  -
Backup/testset_good@del100m  85.2K      -      300M  -
Backup/testset_good@del300m     0B      -      128K  -
Backup/testset_good@final       0B      -      128K  -
NAME                         USED  AVAIL     REFER  MOUNTPOINT
Backup/testset_bad@initial  85.2K      -      128K  -
Backup/testset_bad@add100m     0B      -      100M  -

Which is not correct since it misses the snapshots from the original stream (“good”)

Can this be reproduced by anyone else?


Thilo


-------------------------------
Dipl. Ing. Thilo Jeremias
Hauptstraße 11
35466 Rabenau

T: +49 15782492240