]>
git.proxmox.com Git - mirror_zfs.git/blob - tests/zfs-tests/tests/functional/rsend/send_realloc_dnode_size.ksh
4 # This file and its contents are supplied under the terms of the
5 # Common Development and Distribution License ("CDDL"), version 1.0.
6 # You may only use this file in accordance with the terms of version
9 # A full copy of the text of the CDDL should have accompanied this
10 # source. A copy of the CDDL is also available via the Internet at
11 # http://www.illumos.org/license/CDDL.
15 # Copyright (c) 2017 by Lawrence Livermore National Security, LLC.
18 .
$STF_SUITE/include
/libtest.shlib
19 .
$STF_SUITE/tests
/functional
/rsend
/rsend.kshlib
23 # Verify incremental receive properly handles objects with changed
27 # 1. Populate a dataset with 1k byte dnodes and snapshot
28 # 2. Remove objects, set dnodesize=legacy, and remount dataset so new objects
29 # get recycled numbers and formerly "interior" dnode slots get assigned
31 # 3. Remove objects, set dnodesize=2k, and remount dataset so new objects
32 # overlap with recently recycled and formerly "normal" dnode slots get
33 # assigned to new objects
34 # 4. Generate initial and incremental streams
35 # 5. Verify initial and incremental streams can be received
38 verify_runnable
"both"
40 log_assert
"Verify incremental receive handles objects with changed dnode size"
44 rm -f $BACKDIR/fs-dn-legacy
45 rm -f $BACKDIR/fs-dn-1k
46 rm -f $BACKDIR/fs-dn-2k
48 if datasetexists
$POOL/fs
; then
49 log_must zfs destroy
-rR $POOL/fs
52 if datasetexists
$POOL/newfs
; then
53 log_must zfs destroy
-rR $POOL/newfs
59 # 1. Populate a dataset with 1k byte dnodes and snapshot
60 log_must zfs create
-o dnodesize
=1k
$POOL/fs
61 log_must mk_files
200 262144 0 $POOL/fs
62 log_must zfs snapshot
$POOL/fs@a
64 # 2. Remove objects, set dnodesize=legacy, and remount dataset so new objects
65 # get recycled numbers and formerly "interior" dnode slots get assigned
69 log_must zfs unmount
$POOL/fs
70 log_must zfs
set dnodesize
=legacy
$POOL/fs
71 log_must zfs mount
$POOL/fs
73 log_must mk_files
200 262144 0 $POOL/fs
74 log_must zfs snapshot
$POOL/fs@b
76 # 3. Remove objects, set dnodesize=2k, and remount dataset so new objects
77 # overlap with recently recycled and formerly "normal" dnode slots get
78 # assigned to new objects
81 log_must zfs unmount
$POOL/fs
82 log_must zfs
set dnodesize
=2k
$POOL/fs
83 log_must zfs mount
$POOL/fs
85 mk_files
200 262144 0 $POOL/fs
86 log_must zfs snapshot
$POOL/fs@c
88 # 4. Generate initial and incremental streams
89 log_must
eval "zfs send $POOL/fs@a > $BACKDIR/fs-dn-1k"
90 log_must
eval "zfs send -i $POOL/fs@a $POOL/fs@b > $BACKDIR/fs-dn-legacy"
91 log_must
eval "zfs send -i $POOL/fs@b $POOL/fs@c > $BACKDIR/fs-dn-2k"
93 # 5. Verify initial and incremental streams can be received
94 log_must
eval "zfs recv $POOL/newfs < $BACKDIR/fs-dn-1k"
95 log_must
eval "zfs recv $POOL/newfs < $BACKDIR/fs-dn-legacy"
96 log_must
eval "zfs recv $POOL/newfs < $BACKDIR/fs-dn-2k"
98 log_pass
"Verify incremental receive handles objects with changed dnode size"