From: Yan, Zheng Date: Thu, 14 Mar 2013 07:06:45 +0000 (+0800) Subject: mds: send cache rejoin messages after gathering all resolves X-Git-Tag: v0.62~120^2~25 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=75346d8f3d6486c97e2b70d376090e8f6c754e53;p=ceph.git mds: send cache rejoin messages after gathering all resolves Signed-off-by: Yan, Zheng Reviewed-by: Greg Farnum --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index b35a987b58a9..9156e5bb0e0d 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -2918,6 +2918,8 @@ void MDCache::maybe_resolve_finish() recalc_auth_bits(); trim_non_auth(); mds->resolve_done(); + } else { + maybe_send_pending_rejoins(); } } } @@ -3402,6 +3404,13 @@ void MDCache::rejoin_send_rejoins() { dout(10) << "rejoin_send_rejoins with recovery_set " << recovery_set << dendl; + if (!resolve_gather.empty()) { + dout(7) << "rejoin_send_rejoins still waiting for resolves (" + << resolve_gather << ")" << dendl; + rejoins_pending = true; + return; + } + map rejoins; // encode cap list once. @@ -3575,6 +3584,7 @@ void MDCache::rejoin_send_rejoins() mds->send_message_mds(p->second, p->first); } rejoin_ack_gather.insert(mds->whoami); // we need to complete rejoin_gather_finish, too + rejoins_pending = false; // nothing? if (mds->is_rejoin() && rejoins.empty()) { diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index 41cd6e7d8d8c..99420429f230 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -383,6 +383,7 @@ public: protected: // [rejoin] + bool rejoins_pending; set rejoin_gather; // nodes from whom i need a rejoin set rejoin_sent; // nodes i sent a rejoin to set rejoin_ack_gather; // nodes from whom i need a rejoin ack @@ -417,6 +418,10 @@ protected: void handle_cache_rejoin_full(MMDSCacheRejoin *m); void rejoin_send_acks(); void rejoin_trim_undef_inodes(); + void maybe_send_pending_rejoins() { + if (rejoins_pending) + rejoin_send_rejoins(); + } public: void rejoin_gather_finish(); void rejoin_send_rejoins();