Whamcloud - gitweb
EX-9889 csdc: migrate to another compression level
authorArtem Blagodarenko <ablagodarenko@ddn.com>
Wed, 12 Jun 2024 13:54:18 +0000 (14:54 +0100)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 19 Jun 2024 05:35:57 +0000 (05:35 +0000)
Here is a test there lfs migrate with changed
compression level.

Test-Parameters: trivial env=ONLY=1030 testlist=sanity-compr
Signed-off-by: Artem Blagodarenko <ablagodarenko@ddn.com>
Change-Id: Ia67316a247fed99f6ad002c8b67053a3c2fa0cff
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/55407
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Colin Faber <cfaber@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity-compr.sh

index 17d8d1d..06c6ea0 100644 (file)
@@ -1532,6 +1532,49 @@ test_1021() {
 }
 run_test 1021 "change file compressibiblity"
 
+test_1030() {
+       (( MDS1_VERSION >= $(version_code 2.14.0-ddn153) )) ||
+               skip "Need MDS version at least 2.14.0-ddn153"
+
+       test_mkdir -p $DIR/$tdir
+       local tf=$DIR/$tdir/$tfile
+       local hdf=$LUSTRE/tests/AMSR_E_L3_DailyOcean_V05_20111003.hdf
+       local tmp_hdf=$TMP/$tfile.hdf
+       local size1
+       local size2
+
+       if [[ ! -f $tmp_hdf ]]; then
+               if [[ -f $hdf.bz2 ]] && type -p bzcat >/dev/null; then
+                       bzcat $hdf.bz2 > $tmp_hdf
+               elif [[ -f $hdf.bz2 ]] && type -p bunzip2 >/dev/null; then
+                       cp $hdf.bz2 $tmp_hdf.bz2 || error "cp $tmp_hdf.bz2"
+                       bunzip2 $tmp_hdf.bz2 || error "bunzip2 $tmp_hdf.bz2"
+               else
+                       skip_env "bunzip2 is not installed"
+               fi
+       fi
+
+       stack_trap "rm -f $tf"
+       compression_enabled || skip "compression is disabled ($(uname -a))"
+
+       $LFS setstripe -E-1 -c1 -Z lz4fast:3 --compress-chunk=64 $tf ||
+               error "set a compress component in $tf failed"
+
+       cp $tmp_hdf $tf
+       sync ; sync
+       size1=$(du -sk $tf | awk '{print $1}')
+       echo "compressed size with lz4fast:3: $size1"
+
+       $LFS migrate -E eof -Z lz4:6 $tf || error "migrate failed"
+       sync ; sync
+       size2=$(du -sk $tf | awk '{print $1}')
+       echo "compressed size with lz4:6: $size2"
+
+       (( $size2 < $size1 )) ||
+               error "lz4:6 ($size2) should be less than lz4:3 ($size1)"
+}
+run_test 1030 "Migrate to another compression level"
+
 test_1080() {
        (( MDS1_VERSION >= $(version_code 2.14.0-ddn128) )) ||
                skip "Need MDS version at least 2.14.0-ddn128"