From: Hongchao Zhang Date: Thu, 8 Aug 2013 07:58:06 +0000 (+0800) Subject: LU-3929 lwp: don't connect LWP to old MDT X-Git-Tag: 2.4.2-RC1~6 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=1ab8c61ddbcc580b16e36039884f99e63b78afe9;p=fs%2Flustre-release.git LU-3929 lwp: don't connect LWP to old MDT When rolling upgrade Lustre from old version without LWP support (< 2.3.60) to newer version, the OSTs will be upgraded firstly, then LWP will try to connect the old MDT, and old MDT will regard the LWP client as normal client and save client export on disk for recovery, which will break recovery at the end since LWP connection isn't recoverable. Change-Id: Iad6de8f8a59ff9606c30dd8b750e7638b6bc4e9c Signed-off-by: Hongchao Zhang Signed-off-by: Niu Yawei Reviewed-on: http://review.whamcloud.com/8513 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/obdclass/obd_mount_server.c b/lustre/obdclass/obd_mount_server.c index bb04b48..d1bbc0c 100644 --- a/lustre/obdclass/obd_mount_server.c +++ b/lustre/obdclass/obd_mount_server.c @@ -776,6 +776,14 @@ static int client_lwp_config_process(const struct lu_env *env, if (!tgt_is_mdt0(marker->cm_tgtname)) GOTO(out, rc = 0); + /* Don't try to connect old MDT server without LWP support, + * otherwise, the old MDT could regard this LWP client as + * a normal client and save the export on disk for recovery. + * + * This usually happen when rolling upgrade. LU-3929 */ + if (marker->cm_vers < OBD_OCD_VERSION(2, 3, 60, 0)) + GOTO(out, rc = 0); + if (!strncmp(marker->cm_comment, "add mdc", 7) || !strncmp(marker->cm_comment, "add failnid", 11)) { if (marker->cm_flags & CM_START) { @@ -808,8 +816,16 @@ static int client_lwp_config_process(const struct lu_env *env, break; } case LCFG_ADD_CONN: { - if (is_mdc_for_mdt0(lustre_cfg_string(lcfg, 0))) + if (is_mdc_for_mdt0(lustre_cfg_string(lcfg, 0)) && + (clli->cfg_flags & CFG_F_MARKER) != 0) { rc = lustre_lwp_add_conn(lcfg, lsi); + /* When the 'add mdc' record is old (< 2.3.60) but + * 'add failnid' record is new (>= 2.3.60), add + * connection should fail with -ENOENT since LWP + * device wasn't setup, we'd ignore such error. */ + if (rc == -ENOENT && clli->cfg_flags & CFG_F_SKIP) + rc = 0; + } break; } default: