From: Yan, Zheng Date: Sun, 27 Jan 2013 07:14:55 +0000 (+0800) Subject: mds: fix 'discover' handling in the rejoin stage X-Git-Tag: v0.57~88^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e69e7e5d0eae6581049d22c07ea3cda773c80f13;p=ceph.git mds: fix 'discover' handling in the rejoin stage If the MDS is the resolve stage, current MDCache::handle_discover() only handles 'discover' from MDS that it has already gotten rejoin acknowledgement. This can cause circular wait because MDCache::rejoin_gather_finish() fetches reconnected inodes before send rejoin acknowledgements, and fetching reconnected inode may triggers 'discover'. The fix is not delay handling 'discover' from MDS that are also in the rejoin stage. Signed-off-by: Yan, Zheng --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 84502b0918aa..545ffdca2e15 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -8873,10 +8873,12 @@ void MDCache::handle_discover(MDiscover *dis) assert(from != whoami); - if (mds->get_state() < MDSMap::STATE_CLIENTREPLAY) { + if (mds->get_state() <= MDSMap::STATE_REJOIN) { int from = dis->get_source().num(); + // proceed if requester is in the REJOIN stage, the request is from parallel_fetch(). + // delay processing request from survivor because we may not yet choose lock states. if (mds->get_state() < MDSMap::STATE_REJOIN || - rejoin_ack_gather.count(from)) { + !mds->mdsmap->is_rejoin(from)) { dout(0) << "discover_reply not yet active(|still rejoining), delaying" << dendl; mds->wait_for_active(new C_MDS_RetryMessage(mds, dis)); return;