From 7af5e10a972fd57252a4fdf78b60588790bc9116 Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 11 Dec 2008 14:38:05 +0000 Subject: [PATCH] Branch b_release_1_8_0 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 | 4 +++- lustre/ldlm/ldlm_lib.c | 23 +++++++++++++++++------ lustre/mds/mds_lov.c | 2 +- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 093c60c..870d041 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -760,6 +760,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 + ------------------------------------------------------------------------------- 2008-05-26 Sun Microsystems, Inc. diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index 682a719..8e5af17 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -316,6 +316,7 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb, int msgsize); /* Connect flags */ #define OBD_CONNECT_RDONLY 0x1ULL /*client allowed read-only access*/ #define OBD_CONNECT_INDEX 0x2ULL /*connect to specific LOV idx */ +#define OBD_CONNECT_MDS 0x4ULL /*connect from MDT to OST */ #define OBD_CONNECT_GRANT 0x8ULL /*OSC acquires grant at connect */ #define OBD_CONNECT_SRVLOCK 0x10ULL /*server takes locks for client */ #define OBD_CONNECT_VERSION 0x20ULL /*Lustre versions in ocd */ @@ -368,7 +369,8 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb, int msgsize); OBD_CONNECT_BRW_SIZE | OBD_CONNECT_QUOTA64 | \ OBD_CONNECT_CANCELSET | OBD_CONNECT_AT | \ LRU_RESIZE_CONNECT_FLAG | OBD_CONNECT_CKSUM | \ - OBD_CONNECT_VBR | OBD_CONNECT_CHANGE_QS) + OBD_CONNECT_VBR | OBD_CONNECT_CHANGE_QS | \ + 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 15b2916..cb742e0 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -744,14 +744,25 @@ int target_handle_connect(struct ptlrpc_request *req, svc_handler_t handler) 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)); + 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; - rc = -EALREADY; } else if (export != NULL && export->exp_failed) { /* bug 11327 */ CDEBUG(D_HA, "%s: exp %p evict in progress - new cookie needed " "for connect\n", export->exp_obd->obd_name, export); diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index e2d9875..7c8262d 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -678,7 +678,7 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name) RETURN(-ENOMEM); data->ocd_connect_flags = OBD_CONNECT_VERSION | OBD_CONNECT_INDEX | OBD_CONNECT_REQPORTAL | OBD_CONNECT_QUOTA64 | OBD_CONNECT_AT | - OBD_CONNECT_CHANGE_QS; + OBD_CONNECT_CHANGE_QS | OBD_CONNECT_MDS; #ifdef HAVE_LRU_RESIZE_SUPPORT data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE; #endif -- 1.8.3.1