if (!mdsmap->is_active(mds)) {
dout(10) << "no address for mds" << mds << ", requesting new mdsmap" << dendl;
- int mon = monclient->monmap.pick_mon();
- messenger->send_message(new MMDSGetMap(monclient->monmap.fsid, mdsmap->get_epoch()+1),
- monclient->monmap.get_inst(mon));
+ monclient->send_mon_message(new MMDSGetMap(monclient->get_fsid(), mdsmap->get_epoch()+1));
waiting_for_mdsmap.push_back(&cond);
cond.Wait(client_lock);
ceph_fsid_t fsid;
MMDSGetMap() : PaxosServiceMessage(CEPH_MSG_MDS_GETMAP, 0) {}
- MMDSGetMap(ceph_fsid_t &f, epoch_t have=0) :
+ MMDSGetMap(const ceph_fsid_t &f, epoch_t have=0) :
PaxosServiceMessage(CEPH_MSG_MDS_GETMAP, have),
fsid(f) { }
}
+// ---------
+
+void MonClient::send_mon_message(Message *m, bool newmon)
+{
+ Mutex::Locker l(monc_lock);
+ int mon = monmap.pick_mon(newmon);
+ messenger->send_message(m, monmap.mon_inst[mon]);
+}
+
+
void send_mon_message(Message *m, bool new_mon=false);
+ const ceph_fsid_t& get_fsid() {
+ return monmap.fsid;
+ }
+
entity_addr_t get_mon_addr(unsigned i) {
Mutex::Locker l(monc_lock);
if (i < monmap.size())