mon: share random osd map from update_from_paxos, not committed()

This will let us remove committed() entirely.

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2011-11-18 09:56:10 -08:00 committed by Sage Weil
parent 9920a168c5
commit becfce356c
2 changed files with 13 additions and 9 deletions

View File

@ -142,7 +142,9 @@ bool OSDMonitor::update_from_paxos()
send_to_waiting();
check_subs();
share_map_with_random_osd();
return true;
}
@ -295,16 +297,17 @@ void OSDMonitor::encode_pending(bufferlist &bl)
void OSDMonitor::committed()
{
}
void OSDMonitor::share_map_with_random_osd()
{
// tell any osd
int r = osdmap.get_any_up_osd();
if (r >= 0) {
MonSession *s = mon->session_map.get_random_osd_session();
if (s) {
dout(10) << "committed, telling random " << s->inst << " all about it" << dendl;
MOSDMap *m = build_incremental(osdmap.get_epoch() - 1, osdmap.get_epoch()); // whatev, they'll request more if they need it
mon->messenger->send_message(m, s->inst);
}
MonSession *s = mon->session_map.get_random_osd_session();
if (s) {
dout(10) << "committed, telling random " << s->inst << " all about it" << dendl;
MOSDMap *m = build_incremental(osdmap.get_epoch() - 1, osdmap.get_epoch()); // whatev, they'll request more if they need it
mon->messenger->send_message(m, s->inst);
}
}

View File

@ -58,6 +58,7 @@ private:
void encode_pending(bufferlist &bl);
void committed();
void share_map_with_random_osd();
void handle_query(PaxosServiceMessage *m);
bool preprocess_query(PaxosServiceMessage *m); // true if processed.