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 <zheng.z.yan@intel.com>
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;