]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix export cancel notification
authorYan, Zheng <zheng.z.yan@intel.com>
Thu, 14 Mar 2013 04:24:54 +0000 (12:24 +0800)
committerGreg Farnum <greg@inktank.com>
Mon, 1 Apr 2013 16:26:24 +0000 (09:26 -0700)
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 <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/mds/Migrator.cc

index e67c59f7af3afddb4f6a8e6f200e4eeb93f0f353..7706641bdbf0773dfebfc95bc531b3b3c4281349 100644 (file)
@@ -1390,17 +1390,9 @@ void Migrator::export_logged_finish(CDir *dir)
   for (set<int>::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<int,int>(mds->get_nodeid(), dest),
-                                   pair<int,int>(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<int,int>(mds->get_nodeid(), CDIR_AUTH_UNKNOWN),
-                                   pair<int,int>(dest, CDIR_AUTH_UNKNOWN));
+    MExportDirNotify *notify = new MExportDirNotify(dir->dirfrag(), true,
+                                                   pair<int,int>(mds->get_nodeid(), dest),
+                                                   pair<int,int>(dest, CDIR_AUTH_UNKNOWN));
 
     for (set<CDir*>::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<CDir*>& bounds)
   for (set<int>::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<int,int>(mds->get_nodeid(), CDIR_AUTH_UNKNOWN),
+                          pair<int,int>(import_peer[dir->dirfrag()], mds->get_nodeid()),
                           pair<int,int>(import_peer[dir->dirfrag()], CDIR_AUTH_UNKNOWN));
     for (set<CDir*>::iterator i = bounds.begin(); i != bounds.end(); ++i)
       notify->get_bounds().push_back((*i)->dirfrag());