]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: change the conditional in _update_calc_stats 13383/head
authorZhiqiang Wang <zhiqiang@xsky.com>
Mon, 13 Feb 2017 04:36:07 +0000 (12:36 +0800)
committerZhiqiang Wang <zhiqiang@xsky.com>
Mon, 13 Feb 2017 05:52:21 +0000 (13:52 +0800)
'in_up' and 'in_acting' exposes the internal logic of choose_acting.
The code to calculate missing/misplaced objects needs to be changed
as well when there is a change in choosing acting. Change to use
'is_backfill_targets' to avoid this.

Signed-off-by: Zhiqiang Wang <zhiqiang@xsky.com>
src/osd/PG.cc

index 3efe4df4115c8f533a6ba48944264d65fe5f66fe..3836f409e35ae7285b7e2d0f4aaec25fcc8c51e3 100644 (file)
@@ -2510,15 +2510,12 @@ void PG::_update_calc_stats()
         i != actingbackfill.end();
         ++i) {
       const pg_shard_t &p = *i;
-
       bool in_up = (upset.find(p) != upset.end());
-      bool in_acting = (actingset.find(p) != actingset.end());
-      assert(in_up || in_acting);
 
-      // in acting                  Compute total objects excluding num_missing
-      // in acting and not in up    Compute misplaced objects excluding num_missing
-      // in up and not in acting    Compute total objects already backfilled
-      if (in_acting) {
+      // recovery       Compute total objects excluding num_missing
+      //   - not in up  Compute misplaced objects excluding num_missing
+      // backfill       Compute total objects already backfilled
+      if (!is_backfill_targets(p)) {
         unsigned osd_missing;
         // primary handling
         if (p == pg_whoami) {
@@ -2536,8 +2533,6 @@ void PG::_update_calc_stats()
         if (!in_up && num_objects > osd_missing)
          misplaced += num_objects - osd_missing;
       } else {
-        assert(in_up && !in_acting);
-
         // If this peer has more objects then it should, ignore them
         backfilled += MIN(num_objects, peer_info[p].stats.stats.sum.num_objects);
       }