From 333d20ae852b2a4c74833206f4343e83183d824b Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 11 Dec 2008 15:02:05 +0000 Subject: [PATCH] Branch HEAD b=16522 i=adilger i=wangdi enable OBD_CONNECT_MDT flag when connecting from the MDS so that the OSTs know that the MDS "UUID" can be reused for the same export from a different NID, so we do not need to wait for the export to be evicted. --- lustre/ChangeLog | 8 ++++++++ lustre/include/lustre/lustre_idl.h | 3 ++- lustre/ldlm/ldlm_lib.c | 27 +++++++++++++++++++-------- lustre/mds/mds_lov.c | 3 ++- 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 7976edb..843e919 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -1887,6 +1887,14 @@ Details : With AT enabled, the recovery window can be excessively long (6000+ INITIAL_CONNECT_TIMEOUT now) and clients report the old service time via pb_service_time. +Severity : normal +Bugzilla : 16522 +Description: Watchdog triggered on MDS failover +Details : enable OBD_CONNECT_MDT flag when connecting from the MDS so that + the OSTs know that the MDS "UUID" can be reused for the same export + from a different NID, so we do not need to wait for the export to be + evicted + -------------------------------------------------------------------------------- 2007-08-10 Cluster File Systems, Inc. diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index eb9cdca..8cac1e6 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -667,6 +667,7 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb); /* Connect flags */ #define OBD_CONNECT_RDONLY 0x00000001ULL /* client allowed read-only access */ #define OBD_CONNECT_INDEX 0x00000002ULL /* connect to specific LOV idx */ +#define OBD_CONNECT_MDS 0x00000004ULL /* connect from MDT to OST */ #define OBD_CONNECT_GRANT 0x00000008ULL /* OSC acquires grant at connect */ #define OBD_CONNECT_SRVLOCK 0x00000010ULL /* server takes locks for client */ #define OBD_CONNECT_VERSION 0x00000020ULL /* Server supports versions in ocd */ @@ -723,7 +724,7 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb); OBD_CONNECT_CKSUM | LRU_RESIZE_CONNECT_FLAG | \ OBD_CONNECT_AT | OBD_CONNECT_CHANGE_QS | \ OBD_CONNECT_RMT_CLIENT | \ - OBD_CONNECT_RMT_CLIENT_FORCE) + OBD_CONNECT_RMT_CLIENT_FORCE | OBD_CONNECT_MDS) #define ECHO_CONNECT_SUPPORTED (0) #define MGS_CONNECT_SUPPORTED (OBD_CONNECT_VERSION | OBD_CONNECT_AT) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 0976241..a71aa3d 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -737,14 +737,25 @@ int target_handle_connect(struct ptlrpc_request *req) req->rq_peer.nid != export->exp_connection->c_peer.nid) { /* make darn sure this is coming from the same peer * if the UUIDs matched */ - CWARN("%s: cookie %s seen on new NID %s when " - "existing NID %s is already connected\n", - target->obd_name, cluuid.uuid, - libcfs_nid2str(req->rq_peer.nid), - libcfs_nid2str(export->exp_connection->c_peer.nid)); - class_export_put(export); - export = NULL; - rc = -EALREADY; + if (data && data->ocd_connect_flags & OBD_CONNECT_MDS) { + /* the MDS UUID can be reused, don't need to wait + * for the export to be evicted */ + CWARN("%s: received MDS connection from a new NID %s," + " removing former export from NID %s\n", + target->obd_name, + libcfs_nid2str(req->rq_peer.nid), + libcfs_nid2str(export->exp_connection->c_peer.nid)); + class_fail_export(export); + } else { + CWARN("%s: cookie %s seen on new NID %s when " + "existing NID %s is already connected\n", + target->obd_name, cluuid.uuid, + libcfs_nid2str(req->rq_peer.nid), + libcfs_nid2str(export->exp_connection->c_peer.nid)); + rc = -EALREADY; + } + class_export_put(export); + export = NULL; } else if (export != NULL) { spin_lock(&export->exp_lock); export->exp_connecting = 1; diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 7886c1c..95d10a4 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -643,7 +643,8 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name) OBD_CONNECT_REQPORTAL | OBD_CONNECT_QUOTA64 | OBD_CONNECT_OSS_CAPA | OBD_CONNECT_FID | OBD_CONNECT_BRW_SIZE | OBD_CONNECT_CKSUM | - OBD_CONNECT_AT | OBD_CONNECT_CHANGE_QS; + OBD_CONNECT_CHANGE_QS | OBD_CONNECT_AT | + OBD_CONNECT_MDS; #ifdef HAVE_LRU_RESIZE_SUPPORT data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE; #endif -- 1.8.3.1