From: David Zafman Date: Fri, 13 Oct 2017 23:04:01 +0000 (-0700) Subject: osd: Fix object_copies calculation so degraded is accurate X-Git-Tag: v13.0.1~436^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8a8e088c139a10e30bd6b93151341bf1c30a54e9;p=ceph.git osd: Fix object_copies calculation so degraded is accurate Fixes: http://tracker.ceph.com/issues/21803 Signed-off-by: David Zafman --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index da44df85415..32405ede32e 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2656,7 +2656,11 @@ void PG::_update_calc_stats() } else { assert(peer_missing.count(p)); osd_missing = peer_missing[p].num_missing(); - object_copies += peer_info[p].stats.stats.sum.num_objects; + // During recovery peer_info[p].stats.stats.sum.num_objects + // doesn't reflect the object count, but num_missing + // does reflect the missing and decreases as recovery progresses + // so use primary's object count. + object_copies += num_objects; } missing += osd_missing; // Count non-missing objects not in up as misplaced