}
} else {
// done?
- if (rejoin_gather.empty()) {
+ if (rejoin_gather.empty() && rejoin_ack_gather.count(mds->get_nodeid())) {
rejoin_gather_finish();
} else {
dout(7) << "still need rejoin from (" << rejoin_gather << ")" << dendl;
}
}
-class C_MDC_RejoinGatherFinish : public MDCacheContext {
-public:
- explicit C_MDC_RejoinGatherFinish(MDCache *c) : MDCacheContext(c) {}
- void finish(int r) override {
- mdcache->rejoin_gather_finish();
- }
-};
-
/*
* rejoin_scour_survivor_replica - remove source from replica list on unmentioned objects
*
// done?
assert(rejoin_gather.count(from));
rejoin_gather.erase(from);
- if (rejoin_gather.empty()) {
+ if (rejoin_gather.empty() && rejoin_ack_gather.count(mds->get_nodeid())) {
rejoin_gather_finish();
} else {
dout(7) << "still need rejoin from (" << rejoin_gather << ")" << dendl;
{
dout(10) << "rejoin_gather_finish" << dendl;
assert(mds->is_rejoin());
+ assert(rejoin_ack_gather.count(mds->get_nodeid()));
if (open_undef_inodes_dirfrags())
return;
rejoin_send_acks();
// signal completion of fetches, rejoin_gather_finish, etc.
- assert(rejoin_ack_gather.count(mds->get_nodeid()));
rejoin_ack_gather.erase(mds->get_nodeid());
// did we already get our acks too?
if (fetch_queue.empty())
return false;
- MDSGatherBuilder gather(g_ceph_context, new C_MDC_RejoinGatherFinish(this));
+ MDSGatherBuilder gather(g_ceph_context,
+ new MDSInternalContextWrapper(mds,
+ new FunctionContext([this](int r) {
+ if (rejoin_gather.empty())
+ rejoin_gather_finish();
+ })
+ )
+ );
+
for (set<CDir*>::iterator p = fetch_queue.begin();
p != fetch_queue.end();
++p) {