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
+ update_up_thru(from, m->version); // set to the latest map the OSD has
wait_for_finished_proposal(new C_ReplyMap(this, m, m->version));
return true;
}
return true;
}
+void OSDMonitor::update_up_thru(int from, epoch_t up_thru)
+{
+ epoch_t old_up_thru = osdmap.get_up_thru(from);
+ map<int32_t,epoch_t>::iterator ut = pending_inc.new_up_thru.find(from);
+ if (ut != pending_inc.new_up_thru.end()) {
+ old_up_thru = ut->second;
+ }
+ if (up_thru > old_up_thru) {
+ // set up_thru too, so the osd doesn't have to ask again
+ pending_inc.new_up_thru[from] = up_thru;
+ }
+}
+
bool OSDMonitor::prepare_pgtemp(MOSDPGTemp *m)
{
int from = m->get_orig_source().num();
pending_inc.new_primary_temp.count(p->first))
pending_inc.new_primary_temp[p->first] = -1;
}
- pending_inc.new_up_thru[from] = m->map_epoch; // set up_thru too, so the osd doesn't have to ask again
+
+ // set up_thru too, so the osd doesn't have to ask again
+ update_up_thru(from, m->map_epoch);
+
wait_for_finished_proposal(new C_ReplyMap(this, m, m->map_epoch));
return true;
}
bool prepare_boot(class MOSDBoot *m);
void _booted(MOSDBoot *m, bool logit);
+ void update_up_thru(int from, epoch_t up_thru);
bool preprocess_alive(class MOSDAlive *m);
bool prepare_alive(class MOSDAlive *m);
void _reply_map(PaxosServiceMessage *m, epoch_t e);