]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: check MDS peer's state through mdsmap
authorYan, Zheng <zheng.z.yan@intel.com>
Thu, 14 Mar 2013 03:23:48 +0000 (11:23 +0800)
committerGreg Farnum <greg@inktank.com>
Mon, 1 Apr 2013 16:26:23 +0000 (09:26 -0700)
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/mds/Migrator.cc

index cf95d6ebb29482e2cb477122e912b1135fb4a033..e1cb08f1da0a8ff17cc175f055242f989f51e205 100644 (file)
@@ -238,7 +238,7 @@ void Migrator::handle_mds_failure_or_stop(int who)
        export_unlock(dir);
        export_locks.erase(dir);
        dir->state_clear(CDir::STATE_EXPORTING);
-       if (export_peer[dir] != who) // tell them.
+       if (mds->mdsmap->is_clientreplay_or_active_or_stopping(export_peer[dir])) // tell them.
          mds->send_message_mds(new MExportDirCancel(dir->dirfrag()), export_peer[dir]);
        break;
        
@@ -247,7 +247,7 @@ void Migrator::handle_mds_failure_or_stop(int who)
        dir->unfreeze_tree();  // cancel the freeze
        export_state.erase(dir); // clean up
        dir->state_clear(CDir::STATE_EXPORTING);
-       if (export_peer[dir] != who) // tell them.
+       if (mds->mdsmap->is_clientreplay_or_active_or_stopping(export_peer[dir])) // tell them.
          mds->send_message_mds(new MExportDirCancel(dir->dirfrag()), export_peer[dir]);
        break;
 
@@ -278,7 +278,7 @@ void Migrator::handle_mds_failure_or_stop(int who)
        export_unlock(dir);
        export_locks.erase(dir);
        dir->state_clear(CDir::STATE_EXPORTING);
-       if (export_peer[dir] != who) // tell them.
+       if (mds->mdsmap->is_clientreplay_or_active_or_stopping(export_peer[dir])) // tell them.
          mds->send_message_mds(new MExportDirCancel(dir->dirfrag()), export_peer[dir]);
        break;