From 7278f644a9c74676730720e418ea715708b165ad Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Thu, 14 Mar 2013 12:24:54 +0800 Subject: [PATCH] mds: fix export cancel notification The comment says that if the importer is dead, bystanders thinks the exporter is the only auth, as per mdcache->handle_mds_failure(). But there is no such code in MDCache::handle_mds_failure(). Signed-off-by: Yan, Zheng Reviewed-by: Greg Farnum --- src/mds/Migrator.cc | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index e67c59f7af3af..7706641bdbf07 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -1390,17 +1390,9 @@ void Migrator::export_logged_finish(CDir *dir) for (set::iterator p = export_notify_ack_waiting[dir].begin(); p != export_notify_ack_waiting[dir].end(); ++p) { - MExportDirNotify *notify; - if (mds->mdsmap->is_clientreplay_or_active_or_stopping(export_peer[dir])) - // dest is still alive. - notify = new MExportDirNotify(dir->dirfrag(), true, - pair(mds->get_nodeid(), dest), - pair(dest, CDIR_AUTH_UNKNOWN)); - else - // dest is dead. bystanders will think i am only auth, as per mdcache->handle_mds_failure() - notify = new MExportDirNotify(dir->dirfrag(), true, - pair(mds->get_nodeid(), CDIR_AUTH_UNKNOWN), - pair(dest, CDIR_AUTH_UNKNOWN)); + MExportDirNotify *notify = new MExportDirNotify(dir->dirfrag(), true, + pair(mds->get_nodeid(), dest), + pair(dest, CDIR_AUTH_UNKNOWN)); for (set::iterator i = bounds.begin(); i != bounds.end(); ++i) notify->get_bounds().push_back((*i)->dirfrag()); @@ -2115,11 +2107,9 @@ void Migrator::import_notify_abort(CDir *dir, set& bounds) for (set::iterator p = import_bystanders[dir].begin(); p != import_bystanders[dir].end(); ++p) { - // NOTE: the bystander will think i am _only_ auth, because they will have seen - // the exporter's failure and updated the subtree auth. see mdcache->handle_mds_failure(). - MExportDirNotify *notify = + MExportDirNotify *notify = new MExportDirNotify(dir->dirfrag(), true, - pair(mds->get_nodeid(), CDIR_AUTH_UNKNOWN), + pair(import_peer[dir->dirfrag()], mds->get_nodeid()), pair(import_peer[dir->dirfrag()], CDIR_AUTH_UNKNOWN)); for (set::iterator i = bounds.begin(); i != bounds.end(); ++i) notify->get_bounds().push_back((*i)->dirfrag()); -- 2.39.5