From 5a9fbb6919ba3ea1ce2f631939a538f00710c39c Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 29 Sep 2005 23:43:28 +0000 Subject: [PATCH] Branch b1_4 Description: lconf did not handle in-kernel recovery with LDAP properly Details : lconf/LustreDB get_refs() is searching the wrong namespace b=6163 --- lustre/ChangeLog | 6 ++++++ lustre/utils/Lustre/lustredb.py | 16 +++++++++++----- lustre/utils/lconf | 21 +++++++-------------- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 1dfdbd6..d4ac642 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -152,6 +152,12 @@ Description: unable to set striping with a starting offset beyond OST 160 Details : llapi_create_file() incorrectly limited the starting stripe index to the maximum single-file stripe count. +Severity : minor +Frequency : LDAP users only +Bugzilla : 6163 +Description: lconf did not handle in-kernel recovery with LDAP properly +Details : lconf/LustreDB get_refs() is searching the wrong namespace + ------------------------------------------------------------------------------ 08-26-2005 Cluster File Systems, Inc. diff --git a/lustre/utils/Lustre/lustredb.py b/lustre/utils/Lustre/lustredb.py index dc75e6f..2c9fe6e 100644 --- a/lustre/utils/Lustre/lustredb.py +++ b/lustre/utils/Lustre/lustredb.py @@ -497,21 +497,27 @@ class LustreDB_LDAP(LustreDB): # # [(ref_class, ref_uuid),] def _get_all_refs(self): - list = [] + reflist = [] for k in self._attrs.keys(): if re.search('.*Ref', k): for uuid in self._attrs[k]: ref_class = self.get_ref_type(k) - list.append((ref_class, uuid)) - return list + reflist.append((ref_class, uuid)) + return reflist def _get_refs(self, tag): """ Get all the refs of type TAG. Returns list of uuids. """ - uuids = [] refname = '%sRef' % tag + if self._attrs.has_key(refname): return self._attrs[refname] - return [] + + reflist = [] + for obj in self._lookup_by_class("*"): + if obj._attrs.has_key(refname): + reflist.extend(obj._attrs[refname]) + + return reflist def getName(self): return self._get_val('lustreName') diff --git a/lustre/utils/lconf b/lustre/utils/lconf index 27fd902..878d521 100755 --- a/lustre/utils/lconf +++ b/lustre/utils/lconf @@ -2119,6 +2119,7 @@ class Client(Module): devdb = toplustreDB.lookup(ref_uuid) uuid = devdb.get_first_ref('target') if self.target_uuid == uuid and self.tgt_dev_uuid != ref_uuid: + debug("add backup target", ref_uuid) self.backup_targets.append(ref_uuid) def prepare(self, ignore_connect_failure = 0): @@ -2966,22 +2967,14 @@ def doRecovery(lustreDB, lctl, tgt_uuid, client_uuid, nid_uuid): if not srv_list[0]: raise Lustre.LconfError("Unable to find a connection to:" + new_uuid) + oldsrv = get_server_by_nid_uuid(lustreDB, nid_uuid) + lustreDB.close() + for srv in srv_list: - log("Reconnecting", tgt_uuid, " to ", srv.nid_uuid); - try: - oldsrv = get_server_by_nid_uuid(lustreDB, nid_uuid) - lustreDB.close() - if oldsrv: - lctl.disconnect(oldsrv) - except CommandError, e: - log("recover: disconnect", nid_uuid, "failed: ") - e.dump() + if oldsrv.net_type != srv.net_type: + continue - try: - lctl.connect(srv) - except CommandError, e: - log("recover: connect failed") - e.dump() + log("Reconnecting", tgt_uuid, "to", srv.nid_uuid) lctl.recover(client_uuid, srv.nid_uuid) -- 1.8.3.1