]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: Fix object_copies calculation so degraded is accurate
authorDavid Zafman <dzafman@redhat.com>
Fri, 13 Oct 2017 23:04:01 +0000 (16:04 -0700)
committerDavid Zafman <dzafman@redhat.com>
Mon, 16 Oct 2017 15:13:45 +0000 (08:13 -0700)
Fixes: http://tracker.ceph.com/issues/21803
Signed-off-by: David Zafman <dzafman@redhat.com>
src/osd/PG.cc

index da44df854154762a72fd1c53353721a95cc93dae..32405ede32eedbc8329bb8f9a6ef9be414cd80de 100644 (file)
@@ -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