Skip to content

Commit

Permalink
OSD: update heartbeat peers if unable to statfs
Browse files Browse the repository at this point in the history
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
  • Loading branch information
xiexingguo committed Feb 23, 2016
1 parent 506ba6b commit 27ba6ff
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/osd/OSD.cc
Expand Up @@ -668,11 +668,18 @@ void OSDService::update_osd_stat(vector<int>& hb_peers)
{
Mutex::Locker lock(stat_lock);

osd_stat.hb_in.swap(hb_peers);
osd_stat.hb_out.clear();

osd->op_tracker.get_age_ms_histogram(&osd_stat.op_queue_age_hist);

// fill in osd stats too
struct statfs stbuf;
int r = osd->store->statfs(&stbuf);
if (r < 0) {
derr << "statfs() failed: " << cpp_strerror(r) << dendl;
osd_stat.hb_in.swap(hb_peers);
osd_stat.hb_out.clear();
return;
}

Expand All @@ -688,13 +695,8 @@ void OSDService::update_osd_stat(vector<int>& hb_peers)
osd->logger->set(l_osd_stat_bytes_used, used);
osd->logger->set(l_osd_stat_bytes_avail, avail);

osd_stat.hb_in.swap(hb_peers);
osd_stat.hb_out.clear();

check_nearfull_warning(osd_stat);

osd->op_tracker.get_age_ms_histogram(&osd_stat.op_queue_age_hist);

dout(20) << "update_osd_stat " << osd_stat << dendl;
}

Expand Down

0 comments on commit 27ba6ff

Please sign in to comment.