]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs: Resend discover when joining from starting state 16631/head
authorDouglas Fuller <dfuller@redhat.com>
Mon, 31 Jul 2017 14:47:29 +0000 (10:47 -0400)
committerDouglas Fuller <dfuller@redhat.com>
Mon, 31 Jul 2017 14:51:38 +0000 (10:51 -0400)
From: Zheng Yan <zyan@redhat.com>

Kick discover messages when transitioning from STATE_STARTING
to STATE_ACTIVE.

Fixes: http://tracker.ceph.com/issues/20799
Signed-off-by: Douglas Fuller <dfuller@redhat.com>
src/mds/MDCache.cc
src/mds/MDSRank.cc

index 9fc11eef93b7c0e858727ae8db74c43fbb0ecf2c..eebbc0d42ee410d24c3320569a642917c9c2abcf 100644 (file)
@@ -9715,7 +9715,7 @@ void MDCache::handle_discover(MDiscover *dis)
 
   if (mds->get_state() <= MDSMap::STATE_REJOIN) {
     if (mds->get_state() < MDSMap::STATE_REJOIN &&
-       mds->get_want_state() != CEPH_MDS_STATE_REJOIN) {
+       mds->get_want_state() < CEPH_MDS_STATE_REJOIN) {
       dis->put();
       return;
     }
index 879568277744462b5865c38c01bde4600baafb7a..0c128a8721637e6a70194b2acdb9912a97eb79a0 100644 (file)
@@ -1666,7 +1666,7 @@ void MDSRankDispatcher::handle_mds_map(
 
   // REJOIN
   // is everybody finally rejoining?
-  if (is_rejoin() || is_clientreplay() || is_active() || is_stopping()) {
+  if (is_starting() || is_rejoin() || is_clientreplay() || is_active() || is_stopping()) {
     // did we start?
     if (!oldmap->is_rejoining() && mdsmap->is_rejoining())
       rejoin_joint_start();
@@ -1676,7 +1676,8 @@ void MDSRankDispatcher::handle_mds_map(
        oldmap->is_rejoining() && !mdsmap->is_rejoining())
       mdcache->dump_cache();      // for DEBUG only
 
-    if (oldstate >= MDSMap::STATE_REJOIN) {
+    if (oldstate >= MDSMap::STATE_REJOIN ||
+       oldstate == MDSMap::STATE_STARTING) {
       // ACTIVE|CLIENTREPLAY|REJOIN => we can discover from them.
       set<mds_rank_t> olddis, dis;
       oldmap->get_mds_set(olddis, MDSMap::STATE_ACTIVE);