path2.push_dentry(string(f));
req->set_filepath2(path2);
- int r = make_request(req, -1, -1, NULL, rand() % mdsmap->get_num_mds());
+ int r = make_request(req, -1, -1, NULL, rand() % mdsmap->get_num_in_mds());
ldout(cct, 3) << "lookup_hash exit(" << ino << ", #" << dirino << "/" << name << ") = " << r << dendl;
return r;
}
filepath path(ino);
req->set_filepath(path);
- int r = make_request(req, -1, -1, NULL, rand() % mdsmap->get_num_mds());
+ int r = make_request(req, -1, -1, NULL, rand() % mdsmap->get_num_in_mds());
ldout(cct, 3) << "lookup_ino exit(" << ino << ") = " << r << dendl;
return r;
}
//dout(0) << " load is " << load << " have " << mds_load.size() << dendl;
{
- unsigned cluster_size = mds->get_mds_map()->get_num_mds();
+ unsigned cluster_size = mds->get_mds_map()->get_num_in_mds();
if (mds_load.size() == cluster_size) {
// let's go!
//export_empties(); // no!
++i)
my_targets[*i] = 0.0;
} else {
- int cluster_size = mds->get_mds_map()->get_num_mds();
+ int cluster_size = mds->get_mds_map()->get_num_in_mds();
int whoami = mds->get_nodeid();
rebalance_time = ceph_clock_now(g_ceph_context);
dir_pop >= g_conf->mds_bal_replicate_threshold) {
// replicate
float rdp = dir->pop_me.get(META_POP_IRD).get(now, mds->mdcache->decayrate);
- rd_adj = rdp / mds->get_mds_map()->get_num_mds() - rdp;
+ rd_adj = rdp / mds->get_mds_map()->get_num_in_mds() - rdp;
rd_adj /= 2.0; // temper somewhat
dout(0) << "replicating dir " << *dir << " pop " << dir_pop << " .. rdp " << rdp << " adj " << rd_adj << dendl;
inotable->save(new C_NoopContext);
}
- if (mdsmap->get_num_mds() == 1 &&
- mdsmap->get_num_failed() == 0) { // just me!
+ if (mdsmap->get_num_in_mds() == 1 &&
+ mdsmap->get_num_failed_mds() == 0) { // just me!
dout(2) << "i am alone, moving to state reconnect" << dendl;
request_state(MDSMap::STATE_RECONNECT);
} else {
{
dout(2) << "stopping_start" << dendl;
- if (mdsmap->get_num_mds() == 1 && !sessionmap.empty()) {
+ if (mdsmap->get_num_in_mds() == 1 && !sessionmap.empty()) {
// we're the only mds up!
dout(0) << "we are the last MDS, and have mounted clients: we cannot flush our journal. suicide!" << dendl;
suicide();
}
// counts
- unsigned get_num_mds() {
+ unsigned get_num_in_mds() {
return in.size();
}
+ unsigned get_num_up_mds() {
+ return up.size();
+ }
+ int get_num_failed_mds() {
+ return failed.size();
+ }
unsigned get_num_mds(int state) {
unsigned n = 0;
for (map<uint64_t,mds_info_t>::const_iterator p = mds_info.begin();
if (p->second.state == state) ++n;
return n;
}
- int get_num_failed() { return failed.size(); }
// data pools
void add_data_pg_pool(int64_t poolid) {
<< ceph_mds_state_name(mdsmap.get_state(who)) << ")";
} else if ((mdsmap.get_root() == who ||
mdsmap.get_tableserver() == who) &&
- mdsmap.get_num_mds() > 1) {
+ mdsmap.get_num_in_mds() > 1) {
r = -EBUSY;
ss << "can't tell the root (" << mdsmap.get_root() << ") or tableserver (" << mdsmap.get_tableserver()
<< " to stop unless it is the last mds in the cluster";
if (!mon->is_leader()) return;
// expand mds cluster (add new nodes to @in)?
- while (pending_mdsmap.get_num_mds() < pending_mdsmap.get_max_mds() &&
+ while (pending_mdsmap.get_num_in_mds() < pending_mdsmap.get_max_mds() &&
!pending_mdsmap.is_degraded()) {
int mds = 0;
string name;
view_mds_nodes();
ostringstream oss;
- oss << ctx->mdsmap.get_num_mds() << " In, "
- << ctx->mdsmap.get_num_failed() << " Failed, "
+ oss << ctx->mdsmap.get_num_in_mds() << " In, "
+ << ctx->mdsmap.get_num_failed_mds() << " Failed, "
<< ctx->mdsmap.get_num_mds(MDSMap::STATE_STOPPED) << " Stopped, "
<< ctx->mdsmap.get_max_mds() << " Max";
guiMonitorMDSClusterStatsLabel->set_label(oss.str());
ctx->mdsmap.get_max_mds()));
insert_stats("Amount of Up MDSes", str(boost::format("%d") % up_mds.size()));
insert_stats("Amount of In MDSes", str(boost::format("%u") %
- ctx->mdsmap.get_num_mds()));
+ ctx->mdsmap.get_num_in_mds()));
insert_stats("Amount of Failed MDSes", str(boost::format("%d") %
- ctx->mdsmap.get_num_failed()));
+ ctx->mdsmap.get_num_failed_mds()));
insert_stats("Amount of Stopped MDSes", str(boost::format("%d") %
stopped_mds.size()));
}