dout(7) << "handle_cache_rejoin_ack from " << ack->get_source() << dendl;
int from = ack->get_source().num();
- list<Context*> waiters;
-
// dirs
for (map<dirfrag_t, MMDSCacheRejoin::dirfrag_strong>::iterator p = ack->strong_dirfrags.begin();
p != ack->strong_dirfrags.end();
assert(0); // uh oh.
}
dn->set_replica_nonce(q->second.nonce);
- dn->lock.set_state_rejoin(q->second.lock, waiters);
+ dn->lock.set_state_rejoin(q->second.lock, rejoin_waiters);
dn->state_clear(CDentry::STATE_REJOINING);
dout(10) << " got " << *dn << dendl;
}
if (!in) continue;
in->set_replica_nonce(nonce);
bufferlist::iterator q = lockbl.begin();
- in->_decode_locks_rejoin(q, waiters);
+ in->_decode_locks_rejoin(q, rejoin_waiters);
in->state_clear(CInode::STATE_REJOINING);
dout(10) << " got inode locks " << *in << dendl;
}
if (mds->is_rejoin() &&
rejoin_gather.empty() && // make sure we've gotten our FULL inodes, too.
rejoin_ack_gather.empty()) {
- mds->rejoin_done();
+ // finally, kickstart past snap parent opens
+ open_snap_parents();
} else {
dout(7) << "still need rejoin from (" << rejoin_gather << ")"
<< ", rejoin_ack from (" << rejoin_ack_gather << ")" << dendl;
// did we already get our acks too?
// this happens when the rejoin_gather has to wait on a MISSING/FULL exchange.
if (rejoin_ack_gather.empty()) {
- mds->rejoin_done();
-
// finally, kickstart past snap parent opens
open_snap_parents();
}
}
}
-void MDCache::check_realm_past_parents()
+void MDCache::check_realm_past_parents(SnapRealm *realm)
{
// are this realm's parents fully open?
if (realm->have_past_parents_open()) {
dout(10) << "open_snap_parents - all open" << dendl;
do_delayed_cap_imports();
start_files_to_recover(rejoin_recover_q, rejoin_check_q);
+
+ mds->queue_waiters(rejoin_waiters);
+
+ mds->rejoin_done();
}
}
// inode?
dout(10) << " " << i << ": " << anchortrace[i-1] << dendl;
in = get_inode(anchortrace[i-1].ino);
- if (in) break;
+ if (in)
+ break;
i--;
if (!i) {
in = get_inode(anchortrace[i].dirino);
assert(from != whoami);
- if (mds->get_state() < MDSMap::STATE_ACTIVE) {
- dout(-7) << "discover_reply not yet active, delaying" << dendl;
- mds->wait_for_active(new C_MDS_RetryMessage(mds, dis));
- return;
+ if (mds->get_state() < MDSMap::STATE_CLIENTREPLAY) {
+ int from = dis->get_source().num();
+ if (mds->get_state() < MDSMap::STATE_REJOIN ||
+ rejoin_ack_gather.count(from)) {
+ dout(-7) << "discover_reply not yet active(|still rejoining), delaying" << dendl;
+ mds->wait_for_active(new C_MDS_RetryMessage(mds, dis));
+ return;
+ }
}
set<CInode*> rejoin_potential_updated_scatterlocks;
vector<CInode*> rejoin_recover_q, rejoin_check_q;
+ list<Context*> rejoin_waiters;
void rejoin_walk(CDir *dir, MMDSCacheRejoin *rejoin);
void handle_cache_rejoin(MMDSCacheRejoin *m);
void do_cap_import(Session *session, CInode *in, Capability *cap);
void do_delayed_cap_imports();
- void check_realm_past_parents();
+ void check_realm_past_parents(SnapRealm *realm);
void open_snap_parents();
void reissue_all_caps();