From: Vladimir Saveliev Date: Wed, 7 Mar 2018 12:01:49 +0000 (-0600) Subject: LU-6632 mgs: dont remove EXCLUDE records on lctl replace_nids X-Git-Tag: 2.11.51~25 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=00c89bf0148a105cb7145475194136dc672d1623 LU-6632 mgs: dont remove EXCLUDE records on lctl replace_nids 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 Signed-off-by: Alyona Romanenko Cray-bug-id: MRP-2105 Cray-bug-id: MRP-2766 Reviewed-by: Sergey Cheremencev Reviewed-by: Artem Blagodarenko Test-Parameters: trivial envdefinitions=ONLY=66 testlist=conf-sanity Reviewed-on: https://review.whamcloud.com/14921 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Elena Gryaznova Reviewed-by: Oleg Drokin --- diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index 9fef86e..2a99e57 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -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); - /* 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 */ - 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; } - 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; } diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 79718b2..9149940 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -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) + # 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" @@ -4701,7 +4708,14 @@ test_66() { 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