class MOSDAlive : public PaxosServiceMessage {
public:
- epoch_t map_epoch;
+ epoch_t want;
- MOSDAlive(epoch_t e) : PaxosServiceMessage(MSG_OSD_ALIVE, e), map_epoch(e) { }
+ MOSDAlive(epoch_t h, epoch_t w) : PaxosServiceMessage(MSG_OSD_ALIVE, h), want(w) { }
MOSDAlive() : PaxosServiceMessage(MSG_OSD_ALIVE, 0) {}
private:
~MOSDAlive() {}
public:
void encode_payload() {
paxos_encode();
- ::encode(map_epoch, payload);
+ ::encode(want, payload);
}
void decode_payload() {
bufferlist::iterator p = payload.begin();
paxos_decode(p);
- ::decode(map_epoch, p);
+ ::decode(want, p);
}
const char *get_type_name() { return "osd_alive"; }
void print(ostream &out) {
- out << "osd_alive(" << map_epoch << " v" << version << ")";
+ out << "osd_alive(want up_thru " << want << " have " << version << ")";
}
};
if (osdmap.is_up(from) &&
osdmap.get_inst(from) == m->get_orig_source_inst() &&
- osdmap.get_up_thru(from) >= m->map_epoch) {
+ osdmap.get_up_thru(from) >= m->want) {
// yup.
- dout(7) << "preprocess_alive e" << m->map_epoch << " dup from " << m->get_orig_source_inst() << dendl;
- _reply_map(m, m->map_epoch);
+ dout(7) << "preprocess_alive want up_thru " << m->want << " dup from " << m->get_orig_source_inst() << dendl;
+ _reply_map(m, m->version);
return true;
}
- dout(10) << "preprocess_alive e" << m->map_epoch
+ dout(10) << "preprocess_alive want up_thru " << m->want
<< " from " << m->get_orig_source_inst() << dendl;
return false;
mon->clog.debug() << m->get_orig_source_inst() << " alive\n";
}
- dout(7) << "prepare_alive e" << m->map_epoch << " from " << m->get_orig_source_inst() << dendl;
- pending_inc.new_up_thru[from] = m->map_epoch;
- paxos->wait_for_commit(new C_ReplyMap(this, m, m->map_epoch));
+ dout(7) << "prepare_alive want up_thru " << m->want << " have " << m->version
+ << " from " << m->get_orig_source_inst() << dendl;
+ pending_inc.new_up_thru[from] = m->version; // set to the latest map the OSD has
+ paxos->wait_for_commit(new C_ReplyMap(this, m, m->version));
return true;
}
if (up_thru_wanted > up_thru) {
up_thru_pending = up_thru_wanted;
dout(10) << "send_alive want " << up_thru_wanted << dendl;
- monc->send_mon_message(new MOSDAlive(up_thru_wanted));
+ monc->send_mon_message(new MOSDAlive(osdmap->get_epoch(), up_thru_wanted));
}
}