Whamcloud - gitweb
LU-11912 tests: SEQ rollover fixes 78/50478/10
authorLi Dongyang <dongyangli@ddn.com>
Thu, 30 Mar 2023 13:02:33 +0000 (00:02 +1100)
committerOleg Drokin <green@whamcloud.com>
Sat, 22 Apr 2023 18:04:20 +0000 (18:04 +0000)
To avoid changeing SEQ after replay_barrier, we
use force_new_seq when starting the test suites heavily
using replay_barrier, e.g. replay-single.
However when there are fewer OSTs, the default 16384
SEQ width could not last the entire test suite, SEQ
rollover could still happen randomly after replay_barrier.

To overcome this, change the default OSTSEQWIDTH to
65536, and divide by number of OSTs, so the SEQ width is
larger with fewer OSTs. For 8 OSTs, the SEQ width is 16384,
and make sure we don't go under it.

Use force_new_seq_all for the test suites using replay_barrier
on MDTs other than mds1.

Add force_new_seq_all for replay-ost-single, which is using
replay_barrier on OST. If SEQ rollover happens after that,
the SEQ range update on ofd is lost due to replay_barrier,
the next time when we try to allocate a new SEQ will end up
with an old one.

Use force_new_seq_all for the test cases(namely sanity-pfl/0b
0c 1c 16b sanity/27Cd) checking for number of stripes created
with overstriping, to make sure we have enough objects
in the precreate pool.

Test-Parameters: trivial ostcount=4 testlist=replay-single
Test-Parameters: ostcount=2 testlist=replay-single
Test-Parameters: mdtcount=2 testlist=conf-sanity env=ONLY=122a,ONLY_REPEAT=10
Test-Parameters: testlist=sanity,sanity-pfl
Test-Parameters: testlist=sanity-scrub,replay-single,obdfilter-survey,replay-ost-single,large-scale
Fixes: 0ecb2a167c ("LU-11912 ofd: reduce LUSTRE_DATA_SEQ_MAX_WIDTH")
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Change-Id: Ic65111199f042405d6db8acb729b2cddf91138af
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50478
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ofd/ofd_fs.c
lustre/tests/cfg/local.sh
lustre/tests/replay-dual.sh
lustre/tests/replay-ost-single.sh
lustre/tests/replay-single-lmv.sh
lustre/tests/replay-single.sh
lustre/tests/sanity-pfl.sh
lustre/tests/sanity.sh
lustre/tests/test-framework.sh

index 638a3f6..04af82b 100644 (file)
@@ -426,7 +426,8 @@ struct ofd_seq *ofd_seq_load(const struct lu_env *env, struct ofd_device *ofd,
                                min(OBIF_MAX_OID, client_seq->lcs_width) :
                                min(IDIF_MAX_OID, client_seq->lcs_width);
 
-                       ofd_seq_last_oid_set(oseq, seq_width & ~0xffULL);
+                       ofd_seq_last_oid_set(oseq, seq_width > 255 ?
+                                               seq_width - 255 : seq_width);
                } else {
                        ofd_seq_last_oid_set(oseq, OFD_INIT_OBJID);
                }
index 7bf285e..3a966c7 100644 (file)
@@ -48,7 +48,7 @@ OSTCOUNT=${OSTCOUNT:-2}
 OSTDEVBASE=${OSTDEVBASE:-$TMP/${FSNAME}-ost}
 OSTSIZE=${OSTSIZE:-400000}
 OSTOPT=${OSTOPT:-}
-OSTSEQWIDTH=${OSTSEQWIDTH:-0x3fff}
+OSTSEQWIDTH=${OSTSEQWIDTH:-0x20000}
 OST_FS_MKFS_OPTS=${OST_FS_MKFS_OPTS:-}
 OST_MOUNT_OPTS=${OST_MOUNT_OPTS:-}
 OST_MOUNT_FS_OPTS=${OST_MOUNT_FS_OPTS:-}
index 4e7b38e..92ab3bc 100755 (executable)
@@ -53,7 +53,7 @@ if [ $LINUX_VERSION_CODE -lt $(version_code 2.6.33) ]; then
        do_facet $SINGLEMDS "sync; sleep 10; sync; sleep 10; sync"
 fi
 
-force_new_seq mds1
+force_new_seq_all
 
 LU482_FAILED=$(mktemp -u $TMP/$TESTSUITE.lu482.XXXXXX)
 test_0a() {
index 05903f5..6d107f3 100755 (executable)
@@ -33,6 +33,8 @@ mkdir_on_mdt0 $TDIR
 $LFS setstripe $TDIR -i 0 -c 1
 $LFS getstripe $TDIR
 
+force_new_seq_all
+
 test_0a() {
        zconf_umount $(hostname) $MOUNT -f
        # needs to run during initial client->OST connection
index 9c8d9bc..d77fd89 100755 (executable)
@@ -38,7 +38,7 @@ if [ $LINUX_VERSION_CODE -lt $(version_code 2.6.33) ]; then
     do_facet $SINGLEMDS sync
 fi
 
-force_new_seq mds1
+force_new_seq_all
 
 test_0() {
     replay_barrier mds1
index 50ca21c..58e8899 100755 (executable)
@@ -43,7 +43,7 @@ if [ $LINUX_VERSION_CODE -lt $(version_code 2.6.33) ]; then
     do_facet $SINGLEMDS sync
 fi
 
-force_new_seq mds1
+force_new_seq_all
 
 test_0a() {    # was test_0
        mkdir_on_mdt0 $DIR/$tdir || error "mkdir $DIR/$tdir failed"
index f572624..5000d52 100644 (file)
@@ -74,7 +74,7 @@ test_0b() {
                skip "server does not support overstriping"
        large_xattr_enabled || skip_env "no large xattr support"
 
-       ost_set_temp_seq_width_all $DATA_SEQ_MAX_WIDTH
+       force_new_seq_all
 
        local comp_file=$DIR/$tdir/$tfile
 
@@ -119,7 +119,7 @@ test_0c() {
 
        large_xattr_enabled || skip_env "no large xattr support"
 
-       ost_set_temp_seq_width_all $DATA_SEQ_MAX_WIDTH
+       force_new_seq_all
 
        local comp_file=$DIR/$tdir/$tfile
 
@@ -259,7 +259,7 @@ test_1c() {
                skip "server does not support overstriping"
        large_xattr_enabled || skip_env "no large xattr support"
 
-       ost_set_temp_seq_width_all $DATA_SEQ_MAX_WIDTH
+       force_new_seq_all
 
        local comp_file=$DIR/$tdir/$tfile
        local rw_len=$((3 * 1024 * 1024))       # 3M
@@ -945,6 +945,8 @@ test_16b() {
                skip_env "too many osts, skipping"
        large_xattr_enabled || skip_env "ea_inode feature disabled"
 
+       force_new_seq_all
+
        local file=$DIR/$tdir/$tfile
        local dir=$DIR/$tdir/dir
        local temp=$DIR/$tdir/template
index 39a8a7f..62d32ba 100755 (executable)
@@ -2517,7 +2517,7 @@ test_27Cd() {
        [[ $OSTCOUNT -lt 2 ]] && skip_env "need > 1 OST"
        large_xattr_enabled || skip_env "ea_inode feature disabled"
 
-       ost_set_temp_seq_width_all $DATA_SEQ_MAX_WIDTH
+       force_new_seq_all
 
        test_mkdir -p $DIR/$tdir
        local setcount=$LOV_MAX_STRIPE_COUNT
index 8179fc7..ceefa3f 100755 (executable)
@@ -2145,12 +2145,14 @@ mount_facet() {
        if [ -f $TMP/test-lu482-trigger ]; then
                RC=2
        else
+               local seq_width=$(($OSTSEQWIDTH / $OSTCOUNT))
+               (( $seq_width >= 16384 )) || seq_width=16384
                do_facet ${facet} \
                        "mkdir -p $mntpt; $MOUNT_CMD $opts $dm_dev $mntpt"
                RC=${PIPESTATUS[0]}
                if [[ ${facet} =~ ost ]]; then
                        do_facet ${facet} "$LCTL set_param \
-                               seq.cli-$(devicelabel $facet $dm_dev)-super.width=$OSTSEQWIDTH"
+                               seq.cli-$(devicelabel $facet $dm_dev)-super.width=$seq_width"
                fi
        fi