From 53dd091d4998601a70aa2348a13f5187df118f25 Mon Sep 17 00:00:00 2001 From: Sergey Cheremencev Date: Sat, 27 Apr 2024 13:22:15 +0300 Subject: [PATCH] EX-8423 csdc: disable gzip Gzip compression periodically causes following assertion on clients: decompress_request()) ASSERTION( dst_size <= chunk_size ) Until this is not fixed: 1. forbid setting gzip layout 2. remove gzip from sanity-compr.sh, sanity.sh, sanity-flr.sh, sanity-lfsck.sh, sanity-pfl.sh 3. remove gzip from ll_compression_scan There is still a backdoor to set gzip for test purposes, if set LFS_SETSTRIPE_COMPR_OK. When set, gzip will be applied in sanity-flr(43c, 43d) and sanity-compr(1a). Signed-off-by: Sergey Cheremencev Signed-off-by: Artem Blagodarenko Change-Id: I5461ba756dcd15e0d705f3a3c51a125a59ec19a5 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54943 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/doc/lfs-setstripe.1 | 8 +++--- lustre/ldlm/ldlm_lib.c | 4 +-- lustre/obdclass/lustre_compr.c | 2 +- lustre/scripts/ll_compression_scan | 8 +++--- lustre/tests/sanity-compr.sh | 32 +++++++++++----------- lustre/tests/sanity-flr.sh | 10 +++++-- lustre/tests/sanity-lfsck.sh | 2 +- lustre/tests/sanity-pfl.sh | 56 ++++++++++++++++---------------------- lustre/tests/sanity.sh | 9 +++--- lustre/utils/liblustreapi_layout.c | 6 +++- 10 files changed, 68 insertions(+), 69 deletions(-) diff --git a/lustre/doc/lfs-setstripe.1 b/lustre/doc/lfs-setstripe.1 index 17b9e29..fcd6652 100644 --- a/lustre/doc/lfs-setstripe.1 +++ b/lustre/doc/lfs-setstripe.1 @@ -210,10 +210,10 @@ Used to specify the compression algorithm \fICOMPR_TYPE\fR and compress \fBlfs getstripe\fR could be not exactly the one input here. .br Currently supported compression types are: -.br -- gzip. This is the deflate/zlib implementation. It takes a compression level -between 1 and 9, with a default of 6. Level 9 gives the highest compression -ratio, but may be significantly slower than lower levels. +.\".br +.\"- gzip. This is the deflate/zlib implementation. It takes a compression level +.\"between 1 and 9, with a default of 6. Level 9 gives the highest compression +.\"ratio, but may be significantly slower than lower levels. .br - lz4. This takes a compression level between 1 and 16, with a default of 1. Higher values improve compression ratio but reduce compression speed. diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index aad14f9..2197ef0 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -532,8 +532,8 @@ int client_obd_setup(struct obd_device *obd, struct lustre_cfg *lcfg) INIT_LIST_HEAD(&cli->cl_chg_dev_linkage); cli->cl_compr_type_fast = LL_COMPR_TYPE_LZ4FAST; - cli->cl_compr_fast_level = 0; - cli->cl_compr_type_best = LL_COMPR_TYPE_GZIP; + cli->cl_compr_fast_level = 1; + cli->cl_compr_type_best = LL_COMPR_TYPE_LZ4HC; cli->cl_compr_best_level = 9; if (connect_op == MDS_CONNECT) { diff --git a/lustre/obdclass/lustre_compr.c b/lustre/obdclass/lustre_compr.c index 72e1ba8..44b0e9d 100644 --- a/lustre/obdclass/lustre_compr.c +++ b/lustre/obdclass/lustre_compr.c @@ -176,7 +176,7 @@ static int __alloc_compr(struct client_obd *cli, const char *obdname, struct crypto_comp **cc, bool decompress) { const char *obd_name; - enum ll_compr_type compr_type_best = LL_COMPR_TYPE_GZIP; + enum ll_compr_type compr_type_best = LL_COMPR_TYPE_LZ4HC; unsigned int compr_best_lvl = 9; enum ll_compr_type compr_type_fast = LL_COMPR_TYPE_LZ4FAST; unsigned int compr_fast_lvl = LL_LZ4FAST_MAX_LEVEL; diff --git a/lustre/scripts/ll_compression_scan b/lustre/scripts/ll_compression_scan index 57833f1..7434b12 100755 --- a/lustre/scripts/ll_compression_scan +++ b/lustre/scripts/ll_compression_scan @@ -21,7 +21,7 @@ # avoid problems with poor estimates for files with headers # which differ from the bulk data in the file. # -# This tool requires the lz4, lzop, and gzip utilities to +# This tool requires the lz4 and lzop utilities to # be installed in order to test those compression types. # (lzop is the command line utility for lzo compression) @@ -33,7 +33,7 @@ sample_count=20 min_files=100 default_path="$(pwd)" percentage=1 -compression_type="gzip -" +compression_type="lz4 -" compression_level=6 compression_margin=5 whole_file="false" @@ -105,7 +105,7 @@ Arguments: -p PERCENTAGE: Fraction of scanned files to process. Default: ${percentage}%. -s SAMPLE_COUNT: Maximum number of chunks to sample per file. Default: $sample_count. -c CHUNK_SIZE: Size of data chunk in kibibytes (64-4096). Default: $((chunk_size / 1024))KiB. - -z COMPRESSION_TYPE: One of gzip, lz4, lz4fast, lzo. Default: ${compression_type/ -*/}. + -z COMPRESSION_TYPE: One of lz4, lz4fast, lzo. Default: ${compression_type/ -*/}. -l COMPRESSION_LEVEL: Compression level to use (1-9). Default: $compression_level. -w Sample whole file (override -s). With '-p 100' for a full but slow estimate. -q Skip printing of usage header. -qq to also skip runtime status update. @@ -154,7 +154,7 @@ while getopts "c:ds:n:p:z:Z:l:m:wqh" opt; do lz4fast*) compression_type="lz4 --fast=" ;; - gzip*|lz4*) + lz4*) compression_type="${OPTARG%:*} -" ;; *) diff --git a/lustre/tests/sanity-compr.sh b/lustre/tests/sanity-compr.sh index 89052b7..aa442ad 100644 --- a/lustre/tests/sanity-compr.sh +++ b/lustre/tests/sanity-compr.sh @@ -45,8 +45,8 @@ test_0a() { stack_trap "do_facet ost1 \ $LCTL set_param obdfilter.*.compress_types='$types_save'" - echo " ** add gzip, delete lzo compression type on OST" - do_facet ost1 $LCTL set_param obdfilter.*.compress_types=+gzip-lzo + echo " ** add lz4fast, delete lzo compression type on OST" + do_facet ost1 $LCTL set_param obdfilter.*.compress_types=+lz4fast-lzo # remount client to get new compression types from OSS umount_client $MOUNT @@ -59,10 +59,10 @@ test_0a() { error "cannot find any compress support on client" } - [[ "$types" =~ "gzip" ]] || { + [[ "$types" =~ "lz4fast" ]] || { do_facet ost1 $LCTL get_param obdfilter.*.compress_types echo $types - error "cannot find gzip compress support on client" + error "cannot find lz4fast compress support on client" } [[ "$types" =~ "lzo" ]] && { @@ -98,8 +98,8 @@ test_0b() { stack_trap "do_facet mds1 \ $LCTL set_param mdt.*.compress_types='$types_save'" - echo " ** add gzip, delete lzo compression type on MDT" - do_facet mds1 $LCTL set_param mdt.*.compress_types=+gzip-lzo + echo " ** add lz4fast, delete lzo compression type on MDT" + do_facet mds1 $LCTL set_param mdt.*.compress_types=+lz4fast-lzo # remount client to get new compression types from MDS umount_client $MOUNT @@ -112,10 +112,10 @@ test_0b() { error "cannot find any compress support on client" } - [[ "$types" =~ "gzip" ]] || { + [[ "$types" =~ "lz4fast" ]] || { do_facet mds1 $LCTL get_param obdfilter.*.compress_types echo $types - error "cannot find gzip compress support on client" + error "cannot find lz4fast compress support on client" } [[ "$types" =~ "lzo" ]] && { @@ -136,14 +136,16 @@ test_1a() { skip "need MDS > 2.14.0-ddn131-15-g3e1dd9d6ae for comp add" local tf=$DIR/$tfile + local compr_type="lz4" stack_trap "rm -f $tf" compression_enabled || skip "compression is disabled ($(uname -a))" + [[ -z "$LFS_SETSTRIPE_COMPR_OK" ]] || compr_type="gzip" $LFS setstripe -E1M $tf || error "setstripe failed" - $LFS setstripe -Eeof --component-add -Z gzip $tf || + $LFS setstripe -Eeof --component-add -Z $compr_type $tf || error "add compression component failed" - $LFS getstripe -I2 --compr-type $tf | grep "gzip" || { + $LFS getstripe -I2 --compr-type $tf | grep $compr_type || { $LFS getstripe -v $tf error "added component should be a compression one" } @@ -960,21 +962,20 @@ test_1007() { (( $OST1_VERSION >= $(version_code 2.14.0-ddn128) )) || skip "Need OST >= 2.14.0-ddn127-9-g6c4c4d7599 for good compr" - # The ll_compression_scan tool requires the lz4, lzop, and gzip + # The ll_compression_scan tool requires the lz4 and lzop # utilities to be installed in order to test those compression types. # (lzop is the command line utility for lzo compression) local -a compr_types local utility local rc - for utility in ll_compression_scan lz4 lzop gzip; do + for utility in ll_compression_scan lz4 lzop; do which $utility &>/dev/null rc=$? case $utility-$rc in lz4-0) compr_types+=(lz4 lz4fast) ;; lzop-0) compr_types+=(lzo) ;; - gzip-0) compr_types+=(gzip) ;; ll_compression_scan-1) error "'$utility' is not installed";; *-1) echo "'$utility' not found"; continue;; esac @@ -1093,21 +1094,20 @@ test_1008() { (( $OST1_VERSION >= $(version_code 2.14.0-ddn128) )) || skip "Need OST >= 2.14.0-ddn127-9-g6c4c4d7599 for good compr" - # The ll_compression_scan tool requires the lz4, lzop, and gzip + # The ll_compression_scan tool requires the lz4 and lzop # utilities to be installed in order to test those compression types. # (lzop is the command line utility for lzo compression) local -a compr_types local utility local rc - for utility in ll_compression_scan lz4 lzop gzip; do + for utility in ll_compression_scan lz4 lzop; do which $utility &>/dev/null rc=$? case $utility-$rc in lz4-0) compr_types+=(lz4 lz4fast) ;; lzop-0) compr_types+=(lzo) ;; - gzip-0) compr_types+=(gzip) ;; ll_compression_scan-1) error "'$utility' is not installed";; *-1) echo "'$utility' not found"; continue;; esac diff --git a/lustre/tests/sanity-flr.sh b/lustre/tests/sanity-flr.sh index 449ed4a3..7762b31 100644 --- a/lustre/tests/sanity-flr.sh +++ b/lustre/tests/sanity-flr.sh @@ -2084,13 +2084,15 @@ test_43c() { local tf=$DIR/$tdir/$tfile local p="$TMP/$TESTSUITE-$TESTNAME.parameters" + local compr_type="lz4" + [[ -z "$LFS_SETSTRIPE_COMPR_OK" ]] || compr_type="gzip" save_lustre_params client "llite.*.enable_compression" > $p stack_trap "rm -rf $DIR/$tdir; restore_lustre_params < $p" EXIT $LCTL set_param llite.*.enable_compression=1 test_mkdir $DIR/$tdir - $LFS setstripe -N -Eeof -Z gzip -N -Eeof -Z none $tf || + $LFS setstripe -N -Eeof -Z $compr_type -N -Eeof -Z none $tf || error "setstripe $tf failed" #define OBD_FAIL_LOV_MIRROR_INIT 0x1425 @@ -2111,7 +2113,9 @@ test_43d() { local tf=$DIR/$tdir/$tfile local flags local p="$TMP/$TESTSUITE-$TESTNAME.parameters" + local compr_type="lz4" + [ $LFS_SETSTRIPE_COMPR_OK ] && compr_type="gzip" save_lustre_params client "llite.*.enable_compression" > $p stack_trap "rm -rf $DIR/$tdir; restore_lustre_params < $p" EXIT $LCTL set_param llite.*.enable_compression=1 @@ -2119,7 +2123,7 @@ test_43d() { test_mkdir $DIR/$tdir ## mirror 0 compressed ## mirror 1 uncompressed - $LFS mirror create -N -Eeof -Z gzip -N -Eeof -Z none $tf || + $LFS mirror create -N -Eeof -Z $compr_type -N -Eeof -Z none $tf || error "create 2 mirrors file $tf failed" dd if=/dev/zero of=$tf bs=1M count=1 || error "failed to write $tf" @@ -2130,7 +2134,7 @@ test_43d() { rm -f $tf ## mirror 0 uncompressed ## mirror 1 compressed - $LFS mirror create -N -Eeof -N -Eeof -Z gzip $tf || + $LFS mirror create -N -Eeof -N -Eeof -Z $compr_type $tf || error "create 2 mirrors file $tf failed" dd if=/dev/zero of=$tf bs=1M count=1 || error "failed to write $tf" diff --git a/lustre/tests/sanity-lfsck.sh b/lustre/tests/sanity-lfsck.sh index 402aa6e..a42f1a0 100755 --- a/lustre/tests/sanity-lfsck.sh +++ b/lustre/tests/sanity-lfsck.sh @@ -3047,7 +3047,7 @@ test_18i() { check_mount_and_prep mkdir -p $DIR/$tdir - $LFS setstripe -Z gzip:5 -E 2M -S 1M -c 1 -E -1 $tfile || + $LFS setstripe -Z lz4:5 -E 2M -S 1M -c 1 -E -1 $tfile || error "(0) Fail to create PFL $tfile" cat $LUSTRE/tests/test-framework.sh > $tfile || diff --git a/lustre/tests/sanity-pfl.sh b/lustre/tests/sanity-pfl.sh index e2571e1..bf67781 100644 --- a/lustre/tests/sanity-pfl.sh +++ b/lustre/tests/sanity-pfl.sh @@ -2581,7 +2581,7 @@ test_100b() { # putting lz4 twice: # - first one will have lvl 1, which corresponds to normal lz4 # - second one will have lvl 3, which corresponds to lz4hc - local type="lz4 gzip lz4 lz4fast" + local type="lz4 lz4fast lz4" # lzo does not grok a compression level, add here other such algs local type_nolvl="lzo" local l1=1 @@ -2678,25 +2678,17 @@ test_100c() { # none compress type test_mkdir $d1 - $LFS setstripe -Eeof -Z gzip $DIR/$tdir/dir-1 || + $LFS setstripe -Eeof -Z lzo $DIR/$tdir/dir-1 || error "failed to set compress dir" touch $d1/$tfile || error "failed to create $d1/$tfile" type=$($LFS getstripe --compr-type $d1/$tfile) - [[ "gzip" == $type ]] || error "file compress type $type is not gzip" + [[ "lzo" == $type ]] || error "file compress type $type is not lzo" $LFS setstripe -Eeof -Z none $d1/$tfile-1 || error "failed to set none compress type for $d1/$tfile-1" type=$($LFS getstripe --compr-type $d1/$tfile-1) [[ -z $type ]] || error "non compress file have compress type $type" # compress level - # gzip max compress level 9 - $LFS setstripe -Eeof -Z gzip:15 $tf || - error "failed setting gzip type, level 15" - lvl=$($LFS getstripe --compr-level $tf) - (( $lvl == 9 )) || { - $LFS getstripe $tf - error "gzip max compress level $lvl != 9" - } # lz4fast max acceleration factor 26 rm -f $tf $LFS setstripe -Eeof -Z lz4fast:27 $tf || @@ -2760,7 +2752,7 @@ test_100d() { # putting lz4 twice: # - first one will have lvl 1, which corresponds to normal lz4 # - second one will have lvl 3, which corresponds to lz4hc - local type="lz4 gzip lz4 lz4fast" + local type="lz4 lz4fast lz4" local type_num=$(wc -w <<< $type) # lzo does not grok a compression level, add here other such algs local type_nolvl="lzo" @@ -2852,30 +2844,30 @@ test_100d() { done # test combination of compr type and compr level - flg_opts="--compr-type=gzip --compr-level=2" + flg_opts="--compr-type=lz4fast --compr-level=2" found=$($LFS find $flg_opts $DIR/$tdir | wc -l) (( $found == 1 )) || - error "found $found compress type gzip level 1 files != 1" - flg_opts="-Z gzip:2" + error "found $found compress type lz4fast level 1 files != 1" + flg_opts="-Z lz4fast:2" found=$($LFS find $flg_opts $DIR/$tdir | wc -l) (( $found == 1 )) || - error "found $found compress type gzip level 1 files != 1" - flg_opts="-Z gzip:+2" + error "found $found compress type lz4fast level 1 files != 1" + flg_opts="-Z lz4fast:+2" found=$($LFS find $flg_opts $DIR/$tdir | wc -l) (( $found == 0 )) || - error "found $found compress type gzip level +1 files != 0" - flg_opts="-Z gzip:-3" + error "found $found compress type lz4fast level +1 files != 0" + flg_opts="-Z lz4fast:-3" found=$($LFS find $flg_opts $DIR/$tdir | wc -l) (( $found == 1 )) || - error "found $found compress type gzip level -2 files != 1" - flg_opts="--compr-type=gzip ! --compr-level=2" + error "found $found compress type lz4fast level -2 files != 1" + flg_opts="--compr-type=lz4fast ! --compr-level=2" found=$($LFS find $flg_opts $DIR/$tdir | wc -l) (( $found == 0 )) || - error "found $found compress type gzip ! level 1 files != 0" - flg_opts="--compr-type=gzip --compr-level=1" + error "found $found compress type lz4fast ! level 1 files != 0" + flg_opts="--compr-type=lz4fast --compr-level=1" found=$($LFS find $flg_opts $DIR/$tdir | wc -l) (( $found == 0 )) || - error "found $found compress type gzip level 2 files != 0" + error "found $found compress type lz4fast level 2 files != 0" cs="64 128 256 512" local i=1 @@ -2937,21 +2929,21 @@ test_100f() { stack_trap "rm -rf $DIR/$tdir" test_mkdir $DIR/$tdir - $LFS setstripe -E1M -Z gzip:1 -E4M -E6M -Z none -Eeof -Z gzip:4 $tf || + $LFS setstripe -E1M -Z lz4:1 -E4M -E6M -Z none -Eeof -Z lz4:4 $tf || error "setstripe $tf failed" z1=$($LFS find -printf %LZ $tf) - [[ $z1 == "gzip:1" ]] || { + [[ $z1 == "lz4:1" ]] || { $LFS getstripe $tf - error "1st component compress info $z1 is not gzip:1" + error "1st component compress info $z1 is not lz4:1" } dd if=/dev/zero of=$tf bs=1M count=2 || error "write $tf failed" z2=$($LFS find -printf %LZ $tf) - [[ $z2 == "gzip:1" ]] || { + [[ $z2 == "lz4:1" ]] || { $LFS getstripe $tf - error "2nd component compress info $z2 is not gzip:1" + error "2nd component compress info $z2 is not lz4:1" } dd if=/dev/zero of=$tf bs=1M count=1 seek=4 || error "write $tf failed" @@ -2963,9 +2955,9 @@ test_100f() { dd if=/dev/zero of=$tf bs=1M count=1 seek=6 || error "write $tf failed" z4=$($LFS find -printf %LZ $tf) - [[ $z4 == "gzip:4" ]] || { + [[ $z4 == "lz4:4" ]] || { $LFS getstripe $tf - error "3rd component compress info $z4 is not gzip:4" + error "3rd component compress info $z4 is not lz4:4" } } run_test 100f "lfs find -printf %LZ support" @@ -3053,7 +3045,7 @@ test_100l() { } $LFS getstripe $tf - $LFS setstripe -E eof -c -1 -Z gzip:4 $tf2 || + $LFS setstripe -E eof -c -1 -Z lz4:4 $tf2 || error "setstripe compressed file $tf2 failed" cp /etc/hosts $tf2 || error "error writing file $tf2" $LFS migrate $tf2|| { diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 1add155..a98e063 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -28578,7 +28578,6 @@ compress_content() { t1="lzo" l1=5 c1="128k" compress_type $1 t1="lz4" l1=1 c1="64k" compress_type $1 t1="lz4" l1=9 c1="64k" compress_type $1 - t1="gzip" l1=5 c1="64k" compress_type $1 } test_460a() { @@ -28655,7 +28654,7 @@ test_460b() { stack_trap "rm -Rf $DIR/$tdir" compression_enabled || skip "compression is disabled ($(uname -a))" - $LFS setstripe -E 512K -Z gzip:5 -E 768K -Z none -E -1 -Z lz4:5 \ + $LFS setstripe -E 512K -Z lzo -E 768K -Z none -E -1 -Z lz4:5 \ --compress-chunk=64 $stored || error "set a compress component in $stored failed" @@ -28691,7 +28690,7 @@ test_460c() { stack_trap "rm -Rf $DIR/$tdir; rm -Rf $TMP/$tdir" compression_enabled || skip "compression is disabled ($(uname -a))" - $LFS setstripe -E 2M -Z gzip:5 -E 10M -Z none -E -1 -Z lz4:5 \ + $LFS setstripe -E 2M -Z lzo -E 10M -Z none -E -1 -Z lz4:5 \ --compress-chunk=64 $stored || error "set a compress component in $stored failed" @@ -28777,7 +28776,7 @@ test_460f() { stack_trap "rm -f $tf" compression_enabled || skip "compression is disabled ($(uname -a))" - $LFS setstripe -E -1 -Z gzip:3 --compress-chunk=64 $tf || + $LFS setstripe -E -1 -Z lz4:3 --compress-chunk=64 $tf || error "set a compress component in $tf failed" dd if=/dev/zero of=$tf bs=32k count=2 || @@ -28809,7 +28808,7 @@ test_460g() { stack_trap "rm -f $tf" compression_enabled || skip "compression is disabled ($(uname -a))" - $LFS setstripe -E -1 -Z gzip:3 --compress-chunk=64 $tf || + $LFS setstripe -E -1 -Z lz4:3 --compress-chunk=64 $tf || error "set a compress component in $tf failed" dd if=/dev/zero of=$tf bs=32k count=2 || error "first dd failed" diff --git a/lustre/utils/liblustreapi_layout.c b/lustre/utils/liblustreapi_layout.c index c770e8a..0264600 100644 --- a/lustre/utils/liblustreapi_layout.c +++ b/lustre/utils/liblustreapi_layout.c @@ -1520,7 +1520,6 @@ static inline int msb_index(__u32 x) * * compress argument examples could be: * -Z lz4 - * -Z gzip:9 * -Z fast * -Z best * @@ -1554,6 +1553,11 @@ int llapi_parse_compress_type(const char *optarg, unsigned int *type, if (compr_type_table[i].ctn_name == NULL) continue; if (strcmp(argbuf, compr_type_table[i].ctn_name) == 0) { + /* Forbid gzip due to EX-8423 */ + if (compr_type_table[i].ctn_compr_type == + LL_COMPR_TYPE_GZIP && + !getenv("LFS_SETSTRIPE_COMPR_OK")) + break; *type = compr_type_table[i].ctn_compr_type; found = true; break; -- 1.8.3.1