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 <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
This commit is contained in:
Alexander Motin 2025-04-24 19:31:10 -04:00 committed by GitHub
parent 1b4826b9a2
commit 1ef706c4ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -60,14 +60,15 @@ log_must set_tunable32 SPA_ASIZE_INFLATION 4
log_must zfs create $DISKFS
log_must mkfile $FILEDISKSIZE $FILEDISK1
log_must zpool create $NESTEDPOOL $FILEDISK1
log_must zpool create -O primarycache=metadata $NESTEDPOOL $FILEDISK1
log_must zfs create -o compression=lz4 -o recordsize=8k $NESTEDFS0
log_must zfs create $NESTEDFS0
log_must dd if=/dev/urandom of=$NESTEDFS0FILE bs=1M count=700
FILE0INTRO=$(head -c 100 $NESTEDFS0FILE)
log_must zpool checkpoint $NESTEDPOOL
log_must rm $NESTEDFS0FILE
log_must sync_pool $NESTEDPOOL
#
# only for debugging purposes

View File

@ -139,7 +139,8 @@ function setup_nested_pool
log_must truncate -s $DISKSIZE $FILEDISK1
log_must truncate -s $DISKSIZE $FILEDISK2
log_must zpool create -O sync=disabled $NESTEDPOOL $FILEDISKS
log_must zpool create -O primarycache=metadata -O sync=disabled \
$NESTEDPOOL $FILEDISKS
}
function setup_test_pool