Whamcloud - gitweb
LU-13522 mdt: count mdt_mds_mds_conns upon reconnect 12/38512/3
authorLai Siyao <lai.siyao@whamcloud.com>
Tue, 5 May 2020 01:05:08 +0000 (09:05 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 20 May 2020 08:24:43 +0000 (08:24 +0000)
mdt.mdt_mds_mds_conns is inter-MDT connection count, it should be
increased upon reconnect (MDT stop and start).

Update sanityn 33c.

Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: Ic0dabee10431f39665cb2bc4fa8a014fc78fbd60
Reviewed-on: https://review.whamcloud.com/38512
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdt/mdt_handler.c
lustre/tests/sanityn.sh

index 235cd89..2f069ff 100644 (file)
@@ -5974,6 +5974,18 @@ static int mdt_obd_set_info_async(const struct lu_env *env,
        RETURN(0);
 }
 
        RETURN(0);
 }
 
+static inline void mdt_enable_slc(struct mdt_device *mdt)
+{
+       if (mdt->mdt_lut.lut_sync_lock_cancel == SYNC_LOCK_CANCEL_NEVER)
+               mdt->mdt_lut.lut_sync_lock_cancel = SYNC_LOCK_CANCEL_BLOCKING;
+}
+
+static inline void mdt_disable_slc(struct mdt_device *mdt)
+{
+       if (mdt->mdt_lut.lut_sync_lock_cancel == SYNC_LOCK_CANCEL_BLOCKING)
+               mdt->mdt_lut.lut_sync_lock_cancel = SYNC_LOCK_CANCEL_NEVER;
+}
+
 /**
  * Match client and server connection feature flags.
  *
 /**
  * Match client and server connection feature flags.
  *
@@ -6134,6 +6146,12 @@ static int mdt_connect_internal(const struct lu_env *env,
                       exp->exp_obd->obd_name, obd_export_nid2str(exp));
        }
 
                       exp->exp_obd->obd_name, obd_export_nid2str(exp));
        }
 
+       if ((data->ocd_connect_flags & OBD_CONNECT_MDS_MDS) &&
+           !(data->ocd_connect_flags & OBD_CONNECT_LIGHTWEIGHT)) {
+               atomic_inc(&mdt->mdt_mds_mds_conns);
+               mdt_enable_slc(mdt);
+       }
+
        return 0;
 }
 
        return 0;
 }
 
@@ -6244,18 +6262,6 @@ static int mdt_export_cleanup(struct obd_export *exp)
         RETURN(rc);
 }
 
         RETURN(rc);
 }
 
-static inline void mdt_enable_slc(struct mdt_device *mdt)
-{
-       if (mdt->mdt_lut.lut_sync_lock_cancel == SYNC_LOCK_CANCEL_NEVER)
-               mdt->mdt_lut.lut_sync_lock_cancel = SYNC_LOCK_CANCEL_BLOCKING;
-}
-
-static inline void mdt_disable_slc(struct mdt_device *mdt)
-{
-       if (mdt->mdt_lut.lut_sync_lock_cancel == SYNC_LOCK_CANCEL_BLOCKING)
-               mdt->mdt_lut.lut_sync_lock_cancel = SYNC_LOCK_CANCEL_NEVER;
-}
-
 static int mdt_obd_disconnect(struct obd_export *exp)
 {
        int rc;
 static int mdt_obd_disconnect(struct obd_export *exp)
 {
        int rc;
@@ -6310,12 +6316,6 @@ static int mdt_obd_connect(const struct lu_env *env,
 
        mdt = mdt_dev(obd->obd_lu_dev);
 
 
        mdt = mdt_dev(obd->obd_lu_dev);
 
-       if ((data->ocd_connect_flags & OBD_CONNECT_MDS_MDS) &&
-           !(data->ocd_connect_flags & OBD_CONNECT_LIGHTWEIGHT)) {
-               atomic_inc(&mdt->mdt_mds_mds_conns);
-               mdt_enable_slc(mdt);
-       }
-
        /*
         * first, check whether the stack is ready to handle requests
         * XXX: probably not very appropriate method is used now
        /*
         * first, check whether the stack is ready to handle requests
         * XXX: probably not very appropriate method is used now
index 47216b9..8d2bdef 100755 (executable)
@@ -1084,6 +1084,10 @@ test_33c() {
        [ "$MDS1_VERSION" -lt $(version_code 2.7.63) ] &&
                skip "DNE CoS not supported"
 
        [ "$MDS1_VERSION" -lt $(version_code 2.7.63) ] &&
                skip "DNE CoS not supported"
 
+       # LU-13522
+       stop mds1
+       start mds1 $(mdsdevname 1) $MDS_MOUNT_OPTS || error "start mds1 failed"
+
        local sync_count
 
        mkdir $DIR/$tdir
        local sync_count
 
        mkdir $DIR/$tdir