Default to ON for compression

A simple change, but so many tests break with it,
and those are the majority of this.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #13078
This commit is contained in:
Rich Ercolani 2022-03-03 13:43:38 -05:00 committed by GitHub
parent 29a0ffe795
commit 56fa4aa96e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 124 additions and 43 deletions

View File

@ -4132,7 +4132,8 @@ class _TempPool(object):
cachefile = 'none'
self._zpool_create = [
'zpool', 'create', '-o', 'cachefile=' + cachefile,
'-O', 'mountpoint=legacy', self._pool_name, self._pool_file_path]
'-O', 'mountpoint=legacy', '-O', 'compression=off',
self._pool_name, self._pool_file_path]
try:
os.ftruncate(fd, size)
os.close(fd)

View File

@ -125,7 +125,7 @@ enum zio_checksum {
#define ZIO_COMPRESS_LEGACY_ON_VALUE ZIO_COMPRESS_LZJB
#define ZIO_COMPRESS_LZ4_ON_VALUE ZIO_COMPRESS_LZ4
#define ZIO_COMPRESS_DEFAULT ZIO_COMPRESS_OFF
#define ZIO_COMPRESS_DEFAULT ZIO_COMPRESS_ON
#define BOOTFS_COMPRESS_VALID(compress) \
((compress) == ZIO_COMPRESS_LZJB || \

View File

@ -784,9 +784,9 @@ Changing this property affects only newly-written data.
.Xc
Controls the compression algorithm used for this dataset.
.Pp
Setting compression to
When set to
.Sy on
indicates that the current default compression algorithm should be used.
(the default), indicates that the current default compression algorithm should be used.
The default balances compression and decompression speed, with compression ratio
and is expected to work well on a wide variety of workloads.
Unlike all other settings for this property,

View File

@ -448,7 +448,7 @@ function create_recv_clone
datasetexists $recvfs && log_fail "Recv filesystem must not exist."
datasetexists $sendfs && log_fail "Send filesystem must not exist."
log_must zfs create -o mountpoint="$mountpoint" $sendfs
log_must zfs create -o compression=off -o mountpoint="$mountpoint" $sendfs
log_must zfs snapshot $snap
log_must eval "zfs send $snap | zfs recv -u $recvfs"
log_must mkfile 1m "$mountpoint/data"
@ -3567,17 +3567,19 @@ function wait_replacing #pool
done
}
#
# Wait for a pool to be scrubbed
#
# $1 pool name
# $2 timeout
#
function wait_scrubbed
function wait_scrubbed #pool timeout
{
typeset pool=${1:-$TESTPOOL}
while ! is_pool_scrubbed $pool ; do
sleep 1
done
typeset timeout=${2:-300}
typeset pool=${1:-$TESTPOOL}
for (( timer = 0; timer < $timeout; timer++ )); do
is_pool_scrubbed $pool && break;
sleep 1;
done
}
# Backup the zed.rc in our test directory so that we can edit it for our test.
@ -3671,6 +3673,21 @@ function zed_cleanup
rmdir $ZEDLET_DIR
}
#
# Check if ZED is currently running; if so, returns PIDs
#
function zed_check
{
if ! is_linux; then
return
fi
zedpids="$(pgrep -x zed)"
# ret1=$?
zedpids2="$(pgrep -x lt-zed)"
# ret2=$?
echo ${zedpids} ${zedpids2}
}
#
# Check if ZED is currently running, if not start ZED.
#
@ -3686,9 +3703,14 @@ function zed_start
fi
# Verify the ZED is not already running.
pgrep -x zed > /dev/null
if (($? == 0)); then
log_note "ZED already running"
zedpids=$(zed_check)
if [ -n "$zedpids" ]; then
# We never, ever, really want it to just keep going if zed
# is already running - usually this implies our test cases
# will break very strangely because whatever we wanted to
# configure zed for won't be listening to our changes in the
# tmpdir
log_fail "ZED already running - ${zedpids}"
else
log_note "Starting ZED"
# run ZED in the background and redirect foreground logging
@ -3707,13 +3729,13 @@ function zed_start
function zed_stop
{
if ! is_linux; then
return
return ""
fi
log_note "Stopping ZED"
while true; do
zedpids="$(pgrep -x zed)"
[ "$?" -ne 0 ] && break
zedpids=$(zed_check)
[ ! -n "$zedpids" ] && break
log_must kill $zedpids
sleep 1

View File

@ -59,7 +59,7 @@ log_assert "Verify that the space used by multiple copies is charged correctly."
log_onexit cleanup
for val in 1 2 3; do
log_must zfs create -o copies=$val $TESTPOOL/fs_$val
log_must zfs create -o compression=off -o copies=$val $TESTPOOL/fs_$val
log_must mkfile $FILESIZE /$TESTPOOL/fs_$val/$FILE
done

View File

@ -30,3 +30,4 @@
DISK=${DISKS%% *}
default_setup $DISK
zfs set compression=off $TESTPOOL/$TESTFS

View File

@ -39,6 +39,7 @@ function cleanup
set_tunable64 LIVELIST_MAX_ENTRIES $ORIGINAL_MAX
# reset the minimum percent shared to 75
set_tunable32 LIVELIST_MIN_PERCENT_SHARED $ORIGINAL_MIN
log_must zfs inherit compression $TESTPOOL
}
function check_ll_len
@ -116,6 +117,11 @@ ORIGINAL_MAX=$(get_tunable LIVELIST_MAX_ENTRIES)
ORIGINAL_MIN=$(get_tunable LIVELIST_MIN_PERCENT_SHARED)
log_onexit cleanup
# You might think that setting compression=off for $TESTFS1 would be
# sufficient. You would be mistaken.
# You need compression=off for whatever the parent of $TESTFS1 is,
# and $TESTFS1.
log_must zfs set compression=off $TESTPOOL
log_must zfs create $TESTPOOL/$TESTFS1
log_must mkfile 5m /$TESTPOOL/$TESTFS1/atestfile
log_must zfs snapshot $TESTPOOL/$TESTFS1@snap

View File

@ -42,6 +42,7 @@ function cleanup
# reset the condense tests to 0
set_tunable32 LIVELIST_CONDENSE_ZTHR_PAUSE 0
set_tunable32 LIVELIST_CONDENSE_SYNC_PAUSE 0
log_must zfs inherit compression $TESTPOOL
}
function delete_race
@ -93,6 +94,11 @@ ORIGINAL_MAX=$(get_tunable LIVELIST_MAX_ENTRIES)
log_onexit cleanup
# You might think that setting compression=off for $TESTFS1 would be
# sufficient. You would be mistaken.
# You need compression=off for whatever the parent of $TESTFS1 is,
# and $TESTFS1.
log_must zfs set compression=off $TESTPOOL
log_must zfs create $TESTPOOL/$TESTFS1
log_must mkfile 100m /$TESTPOOL/$TESTFS1/atestfile
sync_pool $TESTPOOL

View File

@ -80,9 +80,16 @@ function test_dedup
ORIGINAL_MIN_SHARED=$(get_tunable LIVELIST_MIN_PERCENT_SHARED)
log_onexit cleanup
# You might think that setting compression=off for $TESTFS1 would be
# sufficient. You would be mistaken.
# You need compression=off for whatever the parent of $TESTFS1 is,
# and $TESTFS1.
log_must zfs set compression=off $TESTPOOL
log_must zfs create $TESTPOOL/$TESTFS1
log_must mkfile 5m /$TESTPOOL/$TESTFS1/atestfile
log_must zfs snapshot $TESTPOOL/$TESTFS1@snap
test_dedup
log_must zfs inherit compression $TESTPOOL
log_pass "Clone's livelist processes dedup blocks as expected."

View File

@ -42,6 +42,7 @@ function cleanup
datasetexists $TESTPOOL/$TESTFS1 && destroy_dataset $TESTPOOL/$TESTFS1 -R
# reset the livelist sublist size to its original value
set_tunable64 LIVELIST_MAX_ENTRIES $ORIGINAL_MAX
log_must zfs inherit compression $TESTPOOL
}
function clone_write_file
@ -146,6 +147,11 @@ function test_clone_clone_promote
ORIGINAL_MAX=$(get_tunable LIVELIST_MAX_ENTRIES)
log_onexit cleanup
# You might think that setting compression=off for $TESTFS1 would be
# sufficient. You would be mistaken.
# You need compression=off for whatever the parent of $TESTFS1 is,
# and $TESTFS1.
log_must zfs set compression=off $TESTPOOL
log_must zfs create $TESTPOOL/$TESTFS1
log_must mkfile 20m /$TESTPOOL/$TESTFS1/atestfile
log_must zfs snapshot $TESTPOOL/$TESTFS1@snap

View File

@ -53,7 +53,7 @@ VIRTUAL_DISK2=$TEST_BASE_DIR/disk2
log_must truncate -s $(($MINVDEVSIZE * 8)) $VIRTUAL_DISK1
log_must truncate -s $(($MINVDEVSIZE * 16)) $VIRTUAL_DISK2
log_must zpool create $TESTPOOL2 $VIRTUAL_DISK1
log_must zpool create -O compression=off $TESTPOOL2 $VIRTUAL_DISK1
log_must poolexists $TESTPOOL2
log_must zfs create $TESTPOOL2/$TESTFS

View File

@ -129,7 +129,7 @@ log_must eval "check_prop_inherit $destsub copies $dest"
log_must eval "check_prop_inherit $destsub atime $dest"
log_must eval "check_prop_inherit $destsub checksum $dest"
log_must eval "check_prop_source $destsub quota 0 default"
log_must eval "check_prop_source $destsub compression off default"
log_must eval "check_prop_source $destsub compression on default"
# Cleanup
log_must zfs destroy -r -f $orig
log_must zfs destroy -r -f $dest

View File

@ -135,7 +135,7 @@ log_must eval "check_prop_inherit $destsub atime $dest"
log_must eval "check_prop_inherit $destsub checksum $dest"
log_must eval "check_prop_inherit $destsub '$userprop:dest2' $dest"
log_must eval "check_prop_source $destsub quota 0 default"
log_must eval "check_prop_source $destsub compression off default"
log_must eval "check_prop_source $destsub compression on default"
log_must eval "check_prop_missing $dest '$userprop:orig'"
log_must eval "check_prop_missing $destsub '$userprop:orig'"
log_must eval "check_prop_source " \

View File

@ -42,7 +42,8 @@ if [[ -d $TESTDIR2 ]]; then
log_unresolved Could not remove $TESTDIR2
fi
fi
log_must zfs create $TESTPOOL/$DATAFS
log_must zfs set compression=off $TESTPOOL/$TESTFS
log_must zfs create -o compression=off $TESTPOOL/$DATAFS
log_must zfs set mountpoint=$TESTDIR2 $TESTPOOL/$DATAFS
log_must eval "dd if=$IF of=$OF bs=$BS count=$CNT >/dev/null 2>&1"

View File

@ -64,7 +64,7 @@ log_must set_tunable64 TRIM_EXTENT_BYTES_MIN 4096
log_must mkdir "$TESTDIR"
log_must truncate -s $LARGESIZE "$LARGEFILE"
log_must zpool create $TESTPOOL "$LARGEFILE"
log_must zpool create -O compression=off $TESTPOOL "$LARGEFILE"
log_must mkfile $(( floor(LARGESIZE * 0.80) )) /$TESTPOOL/file
sync_all_pools

View File

@ -28,4 +28,6 @@
zed_cleanup all-debug.sh all-syslog.sh all-dumpfds
zed_stop
default_cleanup

View File

@ -62,7 +62,7 @@ log_must truncate -s $MINVDEVSIZE $VDEV1 $VDEV2
# 1. Create a pool and generate some events.
log_must truncate -s 0 $ZED_DEBUG_LOG
log_must zpool events -c
log_must zpool create $MPOOL mirror $VDEV1 $VDEV2
log_must zpool create -O compression=off $MPOOL mirror $VDEV1 $VDEV2
# 2. Start the ZED and verify it handles missed events.
log_must zed_start

View File

@ -47,8 +47,14 @@ log_onexit cleanup
logdir="$(mktemp -d)"
log_must ln -s "$logdir" /tmp/zts-zed_fd_spill-logdir
self="$(readlink -f "$0")"
log_must ln -s "${self%/*}/zed_fd_spill-zedlet" "${ZEDLET_DIR}/all-dumpfds"
zedlet="${self%/*}/zed_fd_spill-zedlet"
log_must ln -s $zedlet "${ZEDLET_DIR}/all-dumpfds"
# zed will cry foul and refuse to run it if this isn't true
sudo chown root $zedlet
sudo chmod 700 $zedlet
log_must zpool events -c
log_must zed_stop

View File

@ -40,6 +40,7 @@ function cleanup
log_onexit cleanup
default_mirror_setup_noexit $DISK1 $DISK2
log_must zfs set compression=off $TESTPOOL
log_must eval "echo 'password' | zfs create -o encryption=on \
-o keyformat=passphrase -o keylocation=prompt $TESTPOOL/fs"
mntpt=$(get_prop mountpoint $TESTPOOL/fs)

View File

@ -388,12 +388,12 @@ set -A prop "checksum" "" \
# above must have a corresponding entry in the two arrays below.
#
set -A def_val "on" "off" "on" \
set -A def_val "on" "on" "on" \
"off" "" \
"hidden" \
"off"
set -A local_val "off" "on" "off" \
set -A local_val "off" "off" "off" \
"on" "" \
"visible" \
"off"

View File

@ -53,4 +53,6 @@ fi
DISK=${DISKS%% *}
default_setup_noexit $DISK
zfs set compression=off $TESTPOOL
log_pass

View File

@ -33,4 +33,6 @@
DISK=${DISKS%% *}
default_container_setup $DISK
default_setup_noexit $DISK "true"
log_must zfs set compression=off $TESTPOOL
log_pass

View File

@ -139,7 +139,7 @@ function setup_test_env
log_must truncate -s $MINVDEVSIZE $vdevs
log_must zpool create -f -m $TESTDIR $pool $keyword $vdevs
log_must zpool create -O compression=off -f -m $TESTDIR $pool $keyword $vdevs
log_note "Filling up the filesystem ..."
typeset -i ret=0

View File

@ -219,7 +219,7 @@ for nparity in 1 2 3; do
raid=draid$nparity
dir=$TEST_BASE_DIR
log_must zpool create -f -o cachefile=none $TESTPOOL $raid ${disks[@]}
log_must zpool create -O compression=off -f -o cachefile=none $TESTPOOL $raid ${disks[@]}
log_must zfs set primarycache=metadata $TESTPOOL
log_must zfs create $TESTPOOL/fs

View File

@ -85,7 +85,9 @@ function test_sequential_resilver # <pool> <parity> <dir>
for (( i=0; i<$nparity; i=i+1 )); do
spare=draid${nparity}-0-$i
log_must zpool replace -fsw $pool $dir/dev-$i $spare
zpool status $pool
zpool replace -fsw $pool $dir/dev-$i $spare
zpool status $pool
done
log_must zpool scrub -w $pool
@ -128,7 +130,7 @@ for nparity in 1 2 3; do
raid=draid${nparity}:${nparity}s
dir=$TEST_BASE_DIR
log_must zpool create -f -o cachefile=none $TESTPOOL $raid ${disks[@]}
log_must zpool create -O compression=off -f -o cachefile=none $TESTPOOL $raid ${disks[@]}
log_must zfs set primarycache=metadata $TESTPOOL
log_must zfs create $TESTPOOL/fs

View File

@ -219,7 +219,7 @@ for nparity in 1 2 3; do
raid=raidz$nparity
dir=$TEST_BASE_DIR
log_must zpool create -f -o cachefile=none $TESTPOOL $raid ${disks[@]}
log_must zpool create -O compression=off -f -o cachefile=none $TESTPOOL $raid ${disks[@]}
log_must zfs set primarycache=metadata $TESTPOOL
log_must zfs create $TESTPOOL/fs

View File

@ -33,4 +33,6 @@
verify_runnable "both"
DISK=${DISKS%% *}
default_setup $DISK
default_setup_noexit $DISK
log_must zfs set compression=off $TESTPOOL
log_pass

View File

@ -98,7 +98,7 @@ for parity in 1 2 3; do
continue
fi
log_must zpool create "$TESTPOOL" "$raid" "${disks[@]}"
log_must zpool create -O compression=off "$TESTPOOL" "$raid" "${disks[@]}"
for bits in "${allshifts[@]}"; do
vbs=$((1 << bits))

View File

@ -33,4 +33,6 @@
verify_runnable "both"
DISK=${DISKS%% *}
default_setup $DISK
default_setup_noexit $DISK
log_must zfs set compression=off $TESTPOOL
log_pass

View File

@ -78,6 +78,7 @@ function wait_for_removing_cancel
default_setup_noexit "mirror $DISK0 $DISK1 mirror $DISK2 $DISK3"
log_onexit cleanup
log_must zfs set compression=off $TESTPOOL
FILE_CONTENTS="Leeloo Dallas mul-ti-pass."

View File

@ -22,6 +22,7 @@
. $STF_SUITE/tests/functional/removal/removal.kshlib
default_setup_noexit "$DISKS"
log_must zfs set compression=off $TESTPOOL
log_onexit default_cleanup_noexit
function callback

View File

@ -32,4 +32,5 @@
. $STF_SUITE/include/libtest.shlib
default_setup_noexit ${DISKS%% *}
zfs set compression=off $TESTPOOL
log_pass

View File

@ -60,8 +60,8 @@ log_onexit cleanup
log_must mkfile $MINVDEVSIZE $TESTDIR/bfile
log_must mkfile $SPA_MINDEVSIZE $TESTDIR/sfile
log_must zpool create bpool $TESTDIR/bfile
log_must zpool create spool $TESTDIR/sfile
log_must zpool create -O compression=off bpool $TESTDIR/bfile
log_must zpool create -O compression=off spool $TESTDIR/sfile
#
# Test out of space on sub-filesystem

View File

@ -46,7 +46,7 @@ function cleanup
}
log_onexit cleanup
log_must zfs create $POOL/testfs2
log_must zfs create -o compression=off $POOL/testfs2
log_must zfs create $POOL/stream
mntpnt=$(get_prop mountpoint $POOL/testfs2)

View File

@ -56,11 +56,14 @@ function cleanup
datasetexists $TESTPOOL/$TESTCTR/$TESTFS1 && \
log_must zfs set quota=none $TESTPOOL/$TESTCTR/$TESTFS1
zfs inherit compression $TESTPOOL
}
log_assert "Verify creating/destroying snapshots do things clean"
log_onexit cleanup
log_must zfs set compression=off $TESTPOOL
log_must zfs set quota=$FSQUOTA $TESTPOOL/$TESTCTR/$TESTFS1
log_must mkfile $FILESIZE $TESTDIR1/$TESTFILE

View File

@ -53,4 +53,6 @@ if [ $? -ne 0 ]; then
fi
DISK=${DISKS%% *}
default_setup $DISK
default_setup_noexit $DISK
log_must zfs set compression=off $TESTPOOL
log_pass

View File

@ -52,7 +52,7 @@ log_assert "Sending raw encrypted datasets back to the source dataset succeeds."
# Setup pool and create source
truncate -s 200m $FILEDEV
log_must zpool create -o feature@encryption=enabled $POOLNAME \
log_must zpool create -O compression=off -o feature@encryption=enabled $POOLNAME \
$FILEDEV
log_must eval "echo 'password' | zfs create -o encryption=on" \
"-o keyformat=passphrase -o keylocation=prompt " \

View File

@ -35,4 +35,6 @@ verify_runnable "global"
DISK=$TEST_BASE_DIR/disk0
truncate -s 2G $DISK
default_setup $DISK
default_setup_noexit $DISK
log_must zfs set compression=off $TESTPOOL
log_pass

View File

@ -52,4 +52,6 @@ echo $ZFS_USER > $TEST_BASE_DIR/zfs-xattr-test-user.txt
echo $USES_NIS > $TEST_BASE_DIR/zfs-xattr-test-nis.txt
DISK=${DISKS%% *}
default_setup $DISK
default_setup_noexit $DISK
log_must zfs set compression=off $TESTPOOL
log_pass "Setup complete"