if ((int)s->caps.check_privileges(PAXOS_OSDMAP, MON_CAP_R)) {
osdmon()->check_sub(s->sub_map["osdmap"]);
}
+ } else if (p->first == "osd_pg_creates") {
+ if ((int)s->caps.check_privileges(PAXOS_OSDMAP, MON_CAP_W)) {
+ pgmon()->check_sub(s->sub_map["osd_pg_creates"]);
+ }
} else if (p->first == "monmap") {
check_sub(s->sub_map["monmap"]);
} else if (logmon()->sub_name_to_id(p->first) >= 0) {
int nrep = mon->osdmon()->osdmap.pg_to_acting_osds(on, acting);
if (s.acting.size())
- pg_map.creating_pgs_by_osd[acting[0]].erase(pgid);
+ pg_map.creating_pgs_by_osd[s.acting[0]].erase(pgid);
s.acting = acting;
// don't send creates for localized pgs
now - g_conf->mon_pg_create_interval < last_sent_pg_create[osd])
continue;
- send_pg_creates(osd, NULL);
+ if (mon->osdmon()->osdmap.is_up(osd))
+ send_pg_creates(osd, NULL);
}
}
pg_map.pg_stat[*q].parent_split_bits);
}
- if (con)
+ if (con) {
mon->messenger->send_message(m, con);
- else
+ } else {
+ assert(mon->osdmon()->osdmap.is_up(osd));
mon->messenger->send_message(m, mon->osdmon()->osdmap.get_inst(osd));
+ }
last_sent_pg_create[osd] = ceph_clock_now(g_ceph_context);
}
ss << "ok";
return 0;
}
+
+void PGMonitor::check_sub(Subscription *sub)
+{
+ if (sub->type == "osd_pg_creates") {
+ send_pg_creates(sub->session->inst.name.num(),
+ sub->session->con);
+ }
+}
list<pair<health_status_t,string> > *detail,
const set<int>& s, const char *desc, health_status_t sev) const;
+ void check_sub(Subscription *sub);
+
private:
// no copying allowed
PGMonitor(const PGMonitor &rhs);
service.send_pg_temp();
send_failures();
send_pg_stats(ceph_clock_now(g_ceph_context));
+
+ monc->sub_want("osd_pg_creates", 0, CEPH_SUBSCRIBE_ONETIME);
+ monc->renew_subs();
}
}
}