osdmap.get_addr(from) != m->get_orig_source_inst().addr ||
osdmap.is_down(from)) {
dout(5) << "preprocess_failure from dead osd." << from << ", ignoring" << dendl;
- send_incremental(m, m->get_epoch()+1);
+ send_incremental(op, m->get_epoch()+1);
goto didit;
}
}
if (!osdmap.have_inst(badboy)) {
dout(5) << "preprocess_failure dne(/dup?): " << m->get_target() << ", from " << m->get_orig_source_inst() << dendl;
if (m->get_epoch() < osdmap.get_epoch())
- send_incremental(m, m->get_epoch()+1);
+ send_incremental(op, m->get_epoch()+1);
goto didit;
}
if (osdmap.get_inst(badboy) != m->get_target()) {
dout(5) << "preprocess_failure wrong osd: report " << m->get_target() << " != map's " << osdmap.get_inst(badboy)
<< ", from " << m->get_orig_source_inst() << dendl;
if (m->get_epoch() < osdmap.get_epoch())
- send_incremental(m, m->get_epoch()+1);
+ send_incremental(op, m->get_epoch()+1);
goto didit;
}
osdmap.get_up_from(badboy) > m->get_epoch()) {
dout(5) << "preprocess_failure dup/old: " << m->get_target() << ", from " << m->get_orig_source_inst() << dendl;
if (m->get_epoch() < osdmap.get_epoch())
- send_incremental(m, m->get_epoch()+1);
+ send_incremental(op, m->get_epoch()+1);
goto didit;
}
osdmap.get_addr(from) != m->get_target().addr) {
dout(5) << "preprocess_mark_me_down from dead osd."
<< from << ", ignoring" << dendl;
- send_incremental(m, m->get_epoch()+1);
+ send_incremental(op, m->get_epoch()+1);
goto reply;
}
failure_info.erase(p++);
while (!ls.empty()) {
- MOSDFailure *m = ls.front()->get_req<MOSDFailure>();
- send_latest(m, m->get_epoch());
+ MonOpRequestRef o = ls.front();
+ o->mark_event(__func__);
+ MOSDFailure *m = o->get_req<MOSDFailure>();
+ send_latest(o, m->get_epoch());
ls.pop_front();
}
}
if (osdmap.exists(from) &&
osdmap.get_info(from).up_from > m->version) {
dout(7) << "prepare_boot msg from before last up_from, ignoring" << dendl;
- send_latest(m, m->sb.current_epoch+1);
+ send_latest(op, m->sb.current_epoch+1);
return true;
}
// noup?
if (!can_mark_up(from)) {
dout(7) << "preprocess_boot ignoring boot from " << m->get_orig_source_inst() << dendl;
- send_latest(m, m->sb.current_epoch+1);
+ send_latest(op, m->sb.current_epoch+1);
return true;
}
mon->clog->info() << m->get_orig_source_inst() << " boot\n";
}
- send_latest(m, m->sb.current_epoch+1);
+ send_latest(op, m->sb.current_epoch+1);
}
void OSDMonitor::_reply_map(MonOpRequestRef op, epoch_t e)
{
- PaxosServiceMessage *m = static_cast<PaxosServiceMessage*>(op->get_req());
op->mark_osdmon_event(__func__);
dout(7) << "_reply_map " << e
- << " from " << m->get_orig_source_inst()
+ << " from " << op->get_req()->get_orig_source_inst()
<< dendl;
- send_latest(m, e);
+ send_latest(op, e);
}
// -------------
// ---------------
// map helpers
-void OSDMonitor::send_latest(PaxosServiceMessage *m, epoch_t start)
+void OSDMonitor::send_latest(MonOpRequestRef op, epoch_t start)
{
- dout(5) << "send_latest to " << m->get_orig_source_inst()
+ op->mark_osdmon_event(__func__);
+ dout(5) << "send_latest to " << op->get_req()->get_orig_source_inst()
<< " start " << start << dendl;
if (start == 0)
- send_full(m);
+ send_full(op);
else
- send_incremental(m, start);
+ send_incremental(op, start);
}
return m;
}
-void OSDMonitor::send_full(PaxosServiceMessage *m)
+void OSDMonitor::send_full(MonOpRequestRef op)
{
- dout(5) << "send_full to " << m->get_orig_source_inst() << dendl;
- mon->send_reply(m, build_latest_full());
+ op->mark_osdmon_event(__func__);
+ dout(5) << "send_full to " << op->get_req()->get_orig_source_inst() << dendl;
+ mon->send_reply(op, build_latest_full());
}
/* TBH, I'm fairly certain these two functions could somehow be using a single
*
* TODO: create a helper function and get rid of the duplicated code.
*/
-void OSDMonitor::send_incremental(PaxosServiceMessage *req, epoch_t first)
+void OSDMonitor::send_incremental(MonOpRequestRef op, epoch_t first)
{
+ op->mark_osdmon_event(__func__);
dout(5) << "send_incremental [" << first << ".." << osdmap.get_epoch() << "]"
- << " to " << req->get_orig_source_inst()
+ << " to " << op->get_req()->get_orig_source_inst()
<< dendl;
int osd = -1;
- if (req->get_source().is_osd()) {
- osd = req->get_source().num();
+ if (op->get_req()->get_source().is_osd()) {
+ osd = op->get_req()->get_source().num();
map<int,epoch_t>::iterator p = osd_epoch.find(osd);
if (p != osd_epoch.end()) {
if (first <= p->second) {
m->oldest_map = first;
m->newest_map = osdmap.get_epoch();
m->maps[first] = bl;
- mon->send_reply(req, m);
+ mon->send_reply(op, m);
if (osd >= 0)
note_osd_has_epoch(osd, osdmap.get_epoch());
MOSDMap *m = build_incremental(first, last);
m->oldest_map = get_first_committed();
m->newest_map = osdmap.get_epoch();
- mon->send_reply(req, m);
+ mon->send_reply(op, m);
if (osd >= 0)
note_osd_has_epoch(osd, last);
// ...
MOSDMap *build_latest_full();
MOSDMap *build_incremental(epoch_t first, epoch_t last);
- void send_full(PaxosServiceMessage *m);
- void send_incremental(PaxosServiceMessage *m, epoch_t first);
+ void send_full(MonOpRequestRef op);
+ void send_incremental(MonOpRequestRef op, epoch_t first);
void send_incremental(epoch_t first, MonSession *session, bool onetime);
int reweight_by_utilization(int oload, std::string& out_str, bool by_pg,
std::map<int,utime_t> &last_osd_report);
void mark_all_down();
- void send_latest(PaxosServiceMessage *m, epoch_t start=0);
- void send_latest_now_nodelete(PaxosServiceMessage *m, epoch_t start=0) {
- send_incremental(m, start);
+ void send_latest(MonOpRequestRef op, epoch_t start=0);
+ void send_latest_now_nodelete(MonOpRequestRef op, epoch_t start=0) {
+ op->mark_osdmon_event(__func__);
+ send_incremental(op, start);
}
epoch_t blacklist(const entity_addr_t& a, utime_t until);