Whamcloud - gitweb
LU-6632 mgs: dont remove EXCLUDE records on lctl replace_nids 21/14921/8
authorVladimir Saveliev <c17830@cray.com>
Wed, 7 Mar 2018 12:01:49 +0000 (06:01 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 9 Apr 2018 19:52:09 +0000 (19:52 +0000)
conf-sanity.sh:test_66 is modified to illustrate the problem:
  add EXCLUDE records to config file. lctl replace_nids removes
  those records which leads to mounting problem
fix: Remove records marked as SKIP instead of EXCLUDE ones.

Change-Id: Ica4b23a74870d8ebcb09b240313df4d4c33bbbde
Signed-off-by: Vladimir Saveliev <c17830@cray.com>
Signed-off-by: Alyona Romanenko <alyona.romanenko@seagate.com>
Cray-bug-id: MRP-2105
Cray-bug-id: MRP-2766
Reviewed-by: Sergey Cheremencev <c17829@cray.com>
Reviewed-by: Artem Blagodarenko <c17828@cray.com>
Test-Parameters: trivial envdefinitions=ONLY=66 testlist=conf-sanity
Reviewed-on: https://review.whamcloud.com/14921
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Elena Gryaznova <c17455@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mgs/mgs_llog.c
lustre/tests/conf-sanity.sh

index 9fef86e..2a99e57 100644 (file)
@@ -988,17 +988,17 @@ static int check_markers(struct lustre_cfg *lcfg,
        /* Track markers. Find given device */
        if (lcfg->lcfg_command == LCFG_MARKER) {
                marker = lustre_cfg_buf(lcfg, 1);
        /* Track markers. Find given device */
        if (lcfg->lcfg_command == LCFG_MARKER) {
                marker = lustre_cfg_buf(lcfg, 1);
-               /* Clean llog from records marked as CM_EXCLUDE.
-                  CM_SKIP records are used for "active" command
+               /* Clean llog from records marked as CM_SKIP.
+                  CM_EXCLUDE records are used for "active" command
                   and can be restored if needed */
                   and can be restored if needed */
-               if ((marker->cm_flags & (CM_EXCLUDE | CM_START)) ==
-                   (CM_EXCLUDE | CM_START)) {
+               if ((marker->cm_flags & (CM_SKIP | CM_START)) ==
+                   (CM_SKIP | CM_START)) {
                        mrd->skip_it = 1;
                        return 1;
                }
 
                        mrd->skip_it = 1;
                        return 1;
                }
 
-               if ((marker->cm_flags & (CM_EXCLUDE | CM_END)) ==
-                   (CM_EXCLUDE | CM_END)) {
+               if ((marker->cm_flags & (CM_SKIP | CM_END)) ==
+                   (CM_SKIP | CM_END)) {
                        mrd->skip_it = 0;
                        return 1;
                }
                        mrd->skip_it = 0;
                        return 1;
                }
index 79718b2..9149940 100644 (file)
@@ -4646,6 +4646,13 @@ test_66() {
        local OST1_NID=$(do_facet ost1 $LCTL list_nids | head -1)
        local MDS_NID=$(do_facet $SINGLEMDS $LCTL list_nids | head -1)
 
        local OST1_NID=$(do_facet ost1 $LCTL list_nids | head -1)
        local MDS_NID=$(do_facet $SINGLEMDS $LCTL list_nids | head -1)
 
+       # add EXCLUDE records to config log, they are not to be
+       # removed by lctl replace_nids
+       set_conf_param_and_check mds                                    \
+           "$LCTL get_param -n osc.$FSNAME-OST0000-osc-MDT0000.active" \
+           "$FSNAME-OST0000.osc.active"                                \
+           "0"
+
        echo "replace_nids should fail if MDS, OSTs and clients are UP"
        do_facet mgs $LCTL replace_nids $FSNAME-OST0000 $OST1_NID &&
                error "replace_nids fail"
        echo "replace_nids should fail if MDS, OSTs and clients are UP"
        do_facet mgs $LCTL replace_nids $FSNAME-OST0000 $OST1_NID &&
                error "replace_nids fail"
@@ -4701,7 +4708,14 @@ test_66() {
                stop_mds || error "Unable to stop MDS"
        fi
 
                stop_mds || error "Unable to stop MDS"
        fi
 
-       setup_noconfig
+       start_mgsmds || error "start mgsmds failed"
+       set_conf_param_and_check mds                                    \
+           "$LCTL get_param -n osc.$FSNAME-OST0000-osc-MDT0000.active" \
+           "$FSNAME-OST0000.osc.active"                                \
+           "1"
+       start_ost || error "unable to start OST"
+       mount_client $MOUNT || error "mount client failed"
+
        check_mount || error "error after nid replace"
        cleanup || error "cleanup failed"
        reformat
        check_mount || error "error after nid replace"
        cleanup || error "cleanup failed"
        reformat