]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: number of degraded objects in EC pool is wrong when there is OSD down(in) 3729/head
authorGuang Yang <yguang@yahoo-inc.com>
Fri, 13 Feb 2015 09:19:30 +0000 (09:19 +0000)
committerGuang Yang <yguang@yahoo-inc.com>
Fri, 13 Feb 2015 23:10:15 +0000 (23:10 +0000)
With EC pool (crush rule choose indep), when there is an OSD down, the size of the 'acting' list does not change (CRUSH_ITEM_NONE is used to replace the down OSD), in this case, 'actingset' should be used to calculate the degraded objects.

Signed-off-by: Guang Yang <yguang@yahoo-inc.com>
src/osd/PG.cc

index 5d0a4fec6e2046b21e6dcba3c1015f24b9d9d4ac..aa9796f27c17924cf79609321731ff16cd7e37c9 100644 (file)
@@ -2300,8 +2300,8 @@ void PG::_update_calc_stats()
     uint64_t degraded = 0;
 
     // if acting is smaller than desired, add in those missing replicas
-    if (acting.size() < target)
-      degraded += (target - acting.size()) * num_objects;
+    if (actingset.size() < target)
+      degraded += (target - actingset.size()) * num_objects;
 
     // missing on primary
     info.stats.stats.sum.num_objects_missing_on_primary =