if (pending_inc.fullmap.length())
return true;
+ if (pending_inc.new_flags & CEPH_OSDMAP_FULL) { //get that info out there!
+ delay = 0.0;
+ return true;
+ }
+
// adjust osd weights?
if (osd_weight.size() == (unsigned)osdmap.get_max_osd()) {
dout(0) << " adjusting osd weights based on " << osd_weight << dendl;
}
}
+ //if map is set to full, get that info out there!
+ if (pending_inc.new_flags & CEPH_OSDMAP_FULL)
+ do_propose = true;
// ---------------
#define SWAP_PRIMARIES_AT_START 0
void check_subs();
void check_sub(Subscription *sub);
+ void add_flag(int flag) {
+ if (pending_inc.new_flags < 0)
+ pending_inc.new_flags = osdmap.flags;
+ pending_inc.new_flags |= flag;
+ }
};
#endif
// safely use mon->osdmon->osdmap
}
*/
+
}
void PGMonitor::create_initial(bufferlist& bl)
else
dout(10) << " got osd " << from << " " << stats->osd_stat << " (first report)" << dendl;
+ //Check how full the OSD is; set OSDMap to full/near-full if needed
+ float ratio = ((float)stats->osd_stat.kb_used) / (float) stats->osd_stat.kb;
+ if ( ratio > CEPH_OSD_FULL_RATIO ) {
+ dout(5) << "osd" << from << " has ratio " << ratio
+ << "which is beyond CEPH_OSD_FULL_RATIO "
+ << CEPH_OSD_FULL_RATIO << dendl;
+ mon->osdmon()->add_flag(CEPH_OSDMAP_FULL);
+ } else if ( ratio > CEPH_OSD_NEARFULL_RATIO ) {
+ dout(10) << "osd" << from << " has ratio " << ratio
+ << "which is beyond CEPH_OSD_NEARFULL_RATIO "
+ << CEPH_OSD_NEARFULL_RATIO << dendl;
+ mon->osdmon()->add_flag(CEPH_OSDMAP_NEARFULL);
+ }
+
// apply to live map too (screw consistency)
/*
actually, no, don't. that screws up our "latest" stash. and can