74
74
f->dump_int("root", root);
75
75
f->dump_int("session_timeout", session_timeout);
76
76
f->dump_int("session_autoclose", session_autoclose);
77
f->dump_int("max_file_size", max_file_size);
77
78
f->dump_int("last_failure", last_failure);
78
79
f->dump_int("last_failure_osd_epoch", last_failure_osd_epoch);
79
80
f->open_object_section("compat");
205
206
//out << ", " << stopped.size() << " stopped";
208
enum health_status_t MDSMap::
209
get_health(std::ostream &ss) const
209
void MDSMap::get_health(list<pair<health_status_t,string> >& summary,
210
list<pair<health_status_t,string> > *detail) const
211
health_status_t ret(HEALTH_OK);
212
std::ostringstream oss;
214
212
if (!failed.empty()) {
215
oss << " There are failed MDSes: ";
217
for (set<int32_t>::const_iterator f = failed.begin();
218
f != failed.end(); ++f) {
219
oss << sep << "rank " << *f;
213
std::ostringstream oss;
215
<< ((failed.size() > 1) ? "s ":" ")
217
<< ((failed.size() > 1) ? " have":" has")
219
summary.push_back(make_pair(HEALTH_ERR, oss.str()));
221
for (set<int>::iterator p = failed.begin(); p != failed.end(); ++p) {
222
std::ostringstream oss;
223
oss << "mds." << *p << " has failed";
224
detail->push_back(make_pair(HEALTH_ERR, oss.str()));
223
if (ret > HEALTH_ERR)
227
229
map<int32_t,uint64_t>::const_iterator u = up.begin();
228
230
map<int32_t,uint64_t>::const_iterator u_end = up.end();
229
231
map<uint64_t,mds_info_t>::const_iterator m_end = mds_info.end();
230
string prefix(" There are lagging MDSes: ");
231
233
for (; u != u_end; ++u) {
232
234
map<uint64_t,mds_info_t>::const_iterator m = mds_info.find(u->second);
233
235
assert(m != m_end);
234
236
const mds_info_t &mds_info(m->second);
235
237
if (mds_info.laggy()) {
236
oss << prefix << mds_info.name << "(rank " << mds_info.rank << ")" ;
238
if (ret > HEALTH_WARN)
238
laggy.insert(mds_info.name);
240
std::ostringstream oss;
241
oss << "mds." << mds_info.name << " at " << mds_info.addr << " is laggy/unresponsive";
242
detail->push_back(make_pair(HEALTH_WARN, oss.str()));
247
std::ostringstream oss;
248
oss << "mds " << laggy
249
<< ((laggy.size() > 1) ? " are":" is")
251
summary.push_back(make_pair(HEALTH_WARN, oss.str()));