Skip to content

Commit 1ef706c

Browse files
authored
ZTS: Reduce extra caching in pool_checkpoint (#17268)
Those tests are write-mostly at the nested pool. Considering we have 3 more layers of caching underneath, we can hint ZFS how to use the memory better by setting primarycache=metadata. While there, add missing zpool sync after rm in checkpoint_capacity before we could potentially see the freed space, would not there be a pool checkpoint. Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Reviewed-by: Tino Reichardt <[email protected]> Reviewed-by: Tony Hutter <[email protected]>
1 parent 1b4826b commit 1ef706c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_capacity.ksh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,15 @@ log_must set_tunable32 SPA_ASIZE_INFLATION 4
6060
log_must zfs create $DISKFS
6161

6262
log_must mkfile $FILEDISKSIZE $FILEDISK1
63-
log_must zpool create $NESTEDPOOL $FILEDISK1
63+
log_must zpool create -O primarycache=metadata $NESTEDPOOL $FILEDISK1
6464

65-
log_must zfs create -o compression=lz4 -o recordsize=8k $NESTEDFS0
65+
log_must zfs create $NESTEDFS0
6666
log_must dd if=/dev/urandom of=$NESTEDFS0FILE bs=1M count=700
6767
FILE0INTRO=$(head -c 100 $NESTEDFS0FILE)
6868

6969
log_must zpool checkpoint $NESTEDPOOL
7070
log_must rm $NESTEDFS0FILE
71+
log_must sync_pool $NESTEDPOOL
7172

7273
#
7374
# only for debugging purposes

tests/zfs-tests/tests/functional/pool_checkpoint/pool_checkpoint.kshlib

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ function setup_nested_pool
139139
log_must truncate -s $DISKSIZE $FILEDISK1
140140
log_must truncate -s $DISKSIZE $FILEDISK2
141141

142-
log_must zpool create -O sync=disabled $NESTEDPOOL $FILEDISKS
142+
log_must zpool create -O primarycache=metadata -O sync=disabled \
143+
$NESTEDPOOL $FILEDISKS
143144
}
144145

145146
function setup_test_pool

0 commit comments

Comments
 (0)