mirror of
https://github.com/ceph/ceph
synced 2025-01-31 07:22:56 +00:00
mon: clean up some mdsmon stuff
last_beacon should include pending_inc mds's, no more, no less. Make the osdmon bcast send to non-in mds's too.
This commit is contained in:
parent
52a9ea6320
commit
dc9042c8fd
@ -188,6 +188,8 @@ public:
|
||||
__u32 get_cas_pg_pool() const { return cas_pg_pool; }
|
||||
__u32 get_metadata_pg_pool() const { return metadata_pg_pool; }
|
||||
|
||||
const map<entity_addr_t,mds_info_t>& get_mds_info() { return mds_info; }
|
||||
|
||||
// counts
|
||||
unsigned get_num_mds() {
|
||||
return in.size();
|
||||
|
@ -568,10 +568,14 @@ void MDSMonitor::tick()
|
||||
cutoff -= g_conf.mds_beacon_grace;
|
||||
|
||||
// make sure last_beacon is fully populated
|
||||
for (map<entity_addr_t,MDSMap::mds_info_t>::iterator p = mdsmap.mds_info.begin();
|
||||
p != mdsmap.mds_info.end();
|
||||
for (map<entity_addr_t,MDSMap::mds_info_t>::iterator p = pending_mdsmap.mds_info.begin();
|
||||
p != pending_mdsmap.mds_info.end();
|
||||
++p)
|
||||
if (last_beacon.count(p->second.addr) == 0) {
|
||||
const MDSMap::mds_info_t& info = p->second;
|
||||
dout(10) << " adding " << p->second.addr << " mds" << info.rank << "." << info.inc
|
||||
<< " " << ceph_mds_state_name(info.state)
|
||||
<< " to last_beacon" << dendl;
|
||||
last_beacon[p->second.addr].stamp = g_clock.now();
|
||||
last_beacon[p->second.addr].seq = 0;
|
||||
}
|
||||
@ -587,6 +591,12 @@ void MDSMonitor::tick()
|
||||
__u64 seq = p->second.seq;
|
||||
p++;
|
||||
|
||||
if (pending_mdsmap.mds_info.count(addr) == 0) {
|
||||
// clean it out
|
||||
last_beacon.erase(addr);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (since >= cutoff)
|
||||
continue;
|
||||
|
||||
|
@ -751,14 +751,10 @@ void OSDMonitor::bcast_latest_mds()
|
||||
epoch_t e = osdmap.get_epoch();
|
||||
dout(1) << "bcast_latest_mds epoch " << e << dendl;
|
||||
|
||||
// tell mds
|
||||
set<int> up;
|
||||
mon->mdsmon()->mdsmap.get_up_mds_set(up);
|
||||
for (set<int>::iterator i = up.begin();
|
||||
i != up.end();
|
||||
i++) {
|
||||
send_incremental(mon->mdsmon()->mdsmap.get_inst(*i), osdmap.get_epoch());
|
||||
}
|
||||
for (map<entity_addr_t,MDSMap::mds_info_t>::const_iterator p = mon->mdsmon()->mdsmap.get_mds_info().begin();
|
||||
p != mon->mdsmon()->mdsmap.get_mds_info().end();
|
||||
p++)
|
||||
send_incremental(p->second.get_inst(), osdmap.get_epoch());
|
||||
}
|
||||
|
||||
void OSDMonitor::bcast_latest_osd()
|
||||
|
Loading…
Reference in New Issue
Block a user