From 75346d8f3d6486c97e2b70d376090e8f6c754e53 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Thu, 14 Mar 2013 15:06:45 +0800 Subject: [PATCH] mds: send cache rejoin messages after gathering all resolves Signed-off-by: Yan, Zheng Reviewed-by: Greg Farnum --- src/mds/MDCache.cc | 10 ++++++++++ src/mds/MDCache.h | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index b35a987b58a98..9156e5bb0e0d5 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 41cd6e7d8d8c0..99420429f2303 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(); -- 2.39.5