list<MDSInternalContextBase*> ls;
ls.swap(p->second);
waiting_for_mdsmap.erase(p++);
- finish_contexts(g_ceph_context, ls);
+ queue_waiters(ls);
}
}
finished_queue.splice( finished_queue.end(), ls );
progress_thread.signal();
}
+ void queue_waiters_front(std::list<MDSInternalContextBase*>& ls) {
+ finished_queue.splice(finished_queue.begin(), ls);
+ progress_thread.signal();
+ }
MDSRank(
mds_rank_t whoami_,
}
}
+class C_MDC_QueueContexts : public MigratorContext {
+public:
+ list<MDSInternalContextBase*> contexts;
+ C_MDC_QueueContexts(Migrator *m) : MigratorContext(m) {}
+ void finish(int r) override {
+ // execute contexts immediately after 'this' context
+ get_mds()->queue_waiters_front(contexts);
+ }
+};
/*
* note: this does teh full work of reversing and import and cleaning up
cache->adjust_subtree_auth(dir, stat.peer);
- C_ContextsBase<MDSInternalContextBase, MDSInternalContextGather> *fin = new C_ContextsBase<MDSInternalContextBase, MDSInternalContextGather>(g_ceph_context);
+ auto fin = new C_MDC_QueueContexts(this);
if (!dir->get_inode()->is_auth() &&
!dir->get_inode()->has_subtree_root_dirfrag(mds->get_nodeid())) {
dir->get_inode()->clear_scatter_dirty();
}
MDSGatherBuilder gather(g_ceph_context);
+ int num_opening_dirfrags = 0;
for (auto dir : fetch_queue) {
if (dir->state_test(CDir::STATE_REJOINUNDEF))
assert(dir->get_inode()->dirfragtree.is_leaf(dir->get_frag()));
dir->fetch(gather.new_sub());
+
+ if (!(++num_opening_dirfrags % 1000))
+ mds->heartbeat_reset();
}
auto finish_func = [this](int r) {
num_opening_inodes++;
mdcache->open_ino(it.first, pool, new C_OFT_OpenInoFinish(this, it.first), false);
+
+ if (!(num_opening_inodes % 1000))
+ mds->heartbeat_reset();
}
_open_ino_finish(inodeno_t(0), 0);