~ubuntu-branches/ubuntu/raring/ceph/raring

« back to all changes in this revision

Viewing changes to src/mds/MDSMap.cc

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-08 15:54:37 UTC
  • mfrom: (1.1.8) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20120608155437-gy3j9k6wzv7w4gn9
Tags: 0.44.1-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - d/control: Switch from libcryptopp to libnss as libcryptopp
    is not seeded.
  - d/control,d/rules: Move from python-support to dh_python2.
  - d/patches/manpage_updates*.patch: cherry picked upstream manpage
    updates warning about lack of encryption, per MIR review.
  - d/rules,d/control: Drop radosgw since libfcgi is not in main and
    the code may not be suitable for LTS.
  - d/rules,d/control: Drop tcmalloc since google perftools is not
    in main yet.
  - d/rules,d/control: Drop ceph-fuse entirely per MIR review
    recommendation.
* d/patches/fix-radosgw-tests.patch: Cherry picked patch from upstream
  VCS to fixup tests to conditionally use radosgw if enabled.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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";
206
207
}
207
208
 
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
210
211
{
211
 
  health_status_t ret(HEALTH_OK);
212
 
  std::ostringstream oss;
213
 
 
214
212
  if (!failed.empty()) {
215
 
    oss << " There are failed MDSes: ";
216
 
    string sep("");
217
 
    for (set<int32_t>::const_iterator f = failed.begin();
218
 
         f != failed.end(); ++f) {
219
 
      oss << sep << "rank " << *f;
220
 
      sep = ", ";
 
213
    std::ostringstream oss;
 
214
    oss << "mds rank"
 
215
        << ((failed.size() > 1) ? "s ":" ")
 
216
        << failed
 
217
        << ((failed.size() > 1) ? " have":" has")
 
218
        << " failed";
 
219
    summary.push_back(make_pair(HEALTH_ERR, oss.str()));
 
220
    if (detail) {
 
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()));
 
225
      }
221
226
    }
222
 
    oss << ".";
223
 
    if (ret > HEALTH_ERR)
224
 
      ret = HEALTH_ERR;
225
227
  }
226
228
 
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: ");
 
232
  set<string> laggy;
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 << ")" ;
237
 
      prefix = ", ";
238
 
      if (ret > HEALTH_WARN)
239
 
        ret = HEALTH_WARN;
 
238
      laggy.insert(mds_info.name);
 
239
      if (detail) {
 
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()));
 
243
      }
240
244
    }
241
245
  }
242
 
  ss << oss.str();
243
 
  return ret;
 
246
  if (laggy.size()) {
 
247
    std::ostringstream oss;
 
248
    oss << "mds " << laggy
 
249
        << ((laggy.size() > 1) ? " are":" is")
 
250
        << " laggy";
 
251
    summary.push_back(make_pair(HEALTH_WARN, oss.str()));
 
252
  }
244
253
}