agent_lock("OSD::agent_lock"),
agent_queue_pos(agent_queue.begin()),
agent_ops(0),
+ agent_active(true),
agent_thread(this),
agent_stop_flag(false),
objecter_lock("OSD::objecter_lock"),
agent_thread.create();
}
+void OSDService::activate_map()
+{
+ // wake/unwake the tiering agent
+ agent_lock.Lock();
+ agent_active = !osdmap->test_flag(CEPH_OSDMAP_NOTIERAGENT);
+ agent_cond.Signal();
+ agent_lock.Unlock();
+}
+
void OSDService::agent_entry()
{
dout(10) << __func__ << " start" << dendl;
<< " pgs " << agent_queue.size()
<< " ops " << agent_ops << "/"
<< g_conf->osd_agent_max_ops
+ << (agent_active ? " active" : " NOT ACTIVE")
<< dendl;
dout(20) << __func__ << " oids " << agent_oids << dendl;
- if (agent_ops >= g_conf->osd_agent_max_ops || agent_queue.empty()) {
+ if (agent_ops >= g_conf->osd_agent_max_ops || agent_queue.empty() ||
+ !agent_active) {
agent_cond.Wait(agent_lock);
continue;
}
}
}
+ service.activate_map();
+
// process waiters
take_waiters(waiting_for_osdmap);
}
Mutex::Locker l(pre_publish_lock);
next_osdmap = map;
}
+
+ void activate_map();
+
ConnectionRef get_con_osd_cluster(int peer, epoch_t from_epoch);
pair<ConnectionRef,ConnectionRef> get_con_osd_hb(int peer, epoch_t from_epoch); // (back, front)
void send_message_osd_cluster(int peer, Message *m, epoch_t from_epoch);
set<PGRef>::iterator agent_queue_pos;
int agent_ops;
set<hobject_t> agent_oids;
+ bool agent_active;
struct AgentThread : public Thread {
OSDService *osd;
AgentThread(OSDService *o) : osd(o) {}