Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Mar 2021 21:38:56 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 254530] ZFS (base) receive fails to receive dataset if dataset already exist
Message-ID:  <bug-254530-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D254530

            Bug ID: 254530
           Summary: ZFS (base) receive fails to receive dataset if dataset
                    already exist
           Product: Base System
           Version: 12.2-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: patrik@hildingsson.se

This error was found while using zxfer(8) to send a zvol dataset from one
dataset to another dataset on the same pool. The dataset did not exist on t=
he
destination prior to running zxfer.

Running the below chunk replicates the issue, at least on 12.2-RELEASE-p4
zfs create zroot/test
zfs create -o volmode=3Ddev -V 50M zroot/test/disk0
dd if=3D/dev/random of=3D/dev/zvol/zroot/test/disk0
zfs snapshot zroot/test/disk0@test-now_ok
dd if=3D/dev/random of=3D/dev/zvol/zroot/test/disk0
zfs snapshot zroot/test/disk0@test-now_ok-2
dd if=3D/dev/random of=3D/dev/zvol/zroot/test/disk0
zfs create -V 52428800 -o 'reservation=3Dnone' -o 'volblocksize=3D8192' -o
'checksum=3Don' -o 'compression=3Dlz4' -o 'readonly=3Doff' -o 'copies=3D1' =
-o
'logbias=3Dthroughput' -o 'dedup=3Doff' -o 'sync=3Dstandard' -o 'volmode=3D=
dev' -o
'snapshot_limit=3Dnone' -o 'redundant_metadata=3Dmost' zroot/test/disk1
zfs send zroot/test/disk0@test-now_ok | zfs receive -F zroot/test/disk1


At your convenience I have copy/pasted the above commands and the resulting
error:
# zfs create zroot/test
# zfs create -o volmode=3Ddev -V 50M zroot/test/disk0
# dd if=3D/dev/random of=3D/dev/zvol/zroot/test/disk0
dd: /dev/zvol/zroot/test/disk0: end of device
102401+0 records in
102400+0 records out
52428800 bytes transferred in 0.552508 secs (94892325 bytes/sec)
# zfs snapshot zroot/test/disk0@test-now_ok
# dd if=3D/dev/random of=3D/dev/zvol/zroot/test/disk0
dd: /dev/zvol/zroot/test/disk0: end of device
102401+0 records in
102400+0 records out
52428800 bytes transferred in 0.507651 secs (103277323 bytes/sec)
# zfs snapshot zroot/test/disk0@test-now_ok-2
# dd if=3D/dev/random of=3D/dev/zvol/zroot/test/disk0
dd: /dev/zvol/zroot/test/disk0: end of device
102401+0 records in
102400+0 records out
52428800 bytes transferred in 0.515789 secs (101647735 bytes/sec)
# zfs create -V 52428800 -o 'reservation=3Dnone' -o 'volblocksize=3D8192' -o
'checksum=3Don' -o 'compression=3Dlz4' -o 'readonly=3Doff' -o 'copies=3D1' =
-o
'logbias=3Dthroughput' -o 'dedup=3Doff' -o 'sync=3Dstandard' -o 'volmode=3D=
dev' -o
'snapshot_limit=3Dnone' -o 'redundant_metadata=3Dmost' zroot/test/disk1
root@lrrr:~ # zfs send zroot/test/disk0@test-now_ok | zfs receive -F
zroot/test/disk1
cannot open 'zroot/test/disk1/': trailing slash in name
warning: cannot send 'zroot/test/disk0@test-now_ok': signal received


# zfs send zroot/test/disk0@test-now_ok | zstreamdump
BEGIN record
        hdrtype =3D 1
        features =3D 0
        magic =3D 2f5bacbac
        creation_time =3D 605ba746
        type =3D 3
        flags =3D 0x4
        toguid =3D f1d16456c4cc9f82
        fromguid =3D 0
        toname =3D zroot/test/disk0@test-now_ok
END checksum =3D
64c114cf9127fc/5e00770266493cb3/7fb09ad1733d83d9/9fc28d91b9886732
SUMMARY:
        Total DRR_BEGIN records =3D 1
        Total DRR_END records =3D 1
        Total DRR_OBJECT records =3D 2
        Total DRR_FREEOBJECTS records =3D 4
        Total DRR_WRITE records =3D 6401
        Total DRR_WRITE_BYREF records =3D 0
        Total DRR_WRITE_EMBEDDED records =3D 0
        Total DRR_FREE records =3D 4
        Total DRR_SPILL records =3D 0
        Total records =3D 6413
        Total write size =3D 52429312 (0x3200200)
        Total stream length =3D 54430168 (0x33e89d8)

However the error never appears if zfs receive is run without in advance
creating the dataset on the destination, as can be seen below:

# zfs create zroot/test
# zfs create -o volmode=3Ddev -V 50M zroot/test/disk0
# dd if=3D/dev/random of=3D/dev/zvol/zroot/test/disk0
dd: /dev/zvol/zroot/test/disk0: end of device
102401+0 records in
102400+0 records out
52428800 bytes transferred in 1.084470 secs (48345071 bytes/sec)
# zfs snapshot zroot/test/disk0@test-now_ok
# dd if=3D/dev/random of=3D/dev/zvol/zroot/test/disk0
dd: /dev/zvol/zroot/test/disk0: end of device
102401+0 records in
102400+0 records out
52428800 bytes transferred in 0.627445 secs (83559234 bytes/sec)
# zfs snapshot zroot/test/disk0@test-now_ok-2
# dd if=3D/dev/random of=3D/dev/zvol/zroot/test/disk0
dd: /dev/zvol/zroot/test/disk0: end of device
102401+0 records in
102400+0 records out
52428800 bytes transferred in 0.512001 secs (102399789 bytes/sec)
# zfs send zroot/test/disk0@test-now_ok | zfs receive -F zroot/test/disk1
# echo $?
0

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-254530-227>