From 2fdb1f8d01b9f55f8270b48edc0e105e40d42f55 Mon Sep 17 00:00:00 2001 From: Li Dongyang Date: Fri, 31 Mar 2023 00:02:33 +1100 Subject: [PATCH] LU-11912 tests: SEQ rollover fixes 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 Change-Id: Ic65111199f042405d6db8acb729b2cddf91138af Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50478 Tested-by: Maloo Tested-by: jenkins Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/ofd/ofd_fs.c | 3 ++- lustre/tests/cfg/local.sh | 2 +- lustre/tests/replay-dual.sh | 2 +- lustre/tests/replay-ost-single.sh | 2 ++ lustre/tests/replay-single-lmv.sh | 2 +- lustre/tests/replay-single.sh | 2 +- lustre/tests/sanity-pfl.sh | 8 +++++--- lustre/tests/sanity.sh | 2 +- lustre/tests/test-framework.sh | 4 +++- 9 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lustre/ofd/ofd_fs.c b/lustre/ofd/ofd_fs.c index 638a3f6..04af82b 100644 --- a/lustre/ofd/ofd_fs.c +++ b/lustre/ofd/ofd_fs.c @@ -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); } diff --git a/lustre/tests/cfg/local.sh b/lustre/tests/cfg/local.sh index 7bf285e..3a966c7 100644 --- a/lustre/tests/cfg/local.sh +++ b/lustre/tests/cfg/local.sh @@ -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:-} diff --git a/lustre/tests/replay-dual.sh b/lustre/tests/replay-dual.sh index 4e7b38e..92ab3bc 100755 --- a/lustre/tests/replay-dual.sh +++ b/lustre/tests/replay-dual.sh @@ -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() { diff --git a/lustre/tests/replay-ost-single.sh b/lustre/tests/replay-ost-single.sh index 05903f5..6d107f3 100755 --- a/lustre/tests/replay-ost-single.sh +++ b/lustre/tests/replay-ost-single.sh @@ -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 diff --git a/lustre/tests/replay-single-lmv.sh b/lustre/tests/replay-single-lmv.sh index 9c8d9bc..d77fd89 100755 --- a/lustre/tests/replay-single-lmv.sh +++ b/lustre/tests/replay-single-lmv.sh @@ -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 diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 50ca21c..58e8899 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -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" diff --git a/lustre/tests/sanity-pfl.sh b/lustre/tests/sanity-pfl.sh index f572624..5000d52 100644 --- a/lustre/tests/sanity-pfl.sh +++ b/lustre/tests/sanity-pfl.sh @@ -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 diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 39a8a7f..62d32ba 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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 diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 8179fc7..ceefa3f 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -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 -- 1.8.3.1