]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/osdmaptool.cc: fix inaccurate pg map result when simulating osd out 37185/head
authorZhi Zhang <willzzhang@tencent.com>
Wed, 16 Sep 2020 06:46:08 +0000 (14:46 +0800)
committerZhi Zhang <willzzhang@tencent.com>
Wed, 16 Sep 2020 06:46:08 +0000 (14:46 +0800)
When simulating osd out, it will always adjust this osd's crush weight
to 1.0. Hence the pg map result is not same as the real cluster or simulated
by crushtool.

Fixes: https://tracker.ceph.com/issues/47492
Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
src/tools/osdmaptool.cc

index 887086e55eb562b59006540702476299b20e52d9..73ad1a535b6f1863ee29e48cc2a27c7a4defab38 100644 (file)
@@ -345,7 +345,6 @@ int main(int argc, const char **argv)
     for (int i=0; i<n; i++) {
       osdmap.set_state(i, osdmap.get_state(i) | CEPH_OSD_UP);
       osdmap.set_weight(i, CEPH_OSD_IN);
-      osdmap.crush->adjust_item_weightf(g_ceph_context, i, 1.0);
     }
   }
 
@@ -354,7 +353,6 @@ int main(int argc, const char **argv)
     int id = marked_out;
     osdmap.set_state(id, osdmap.get_state(id) | CEPH_OSD_UP);
     osdmap.set_weight(id, CEPH_OSD_OUT);
-    osdmap.crush->adjust_item_weightf(g_ceph_context, id, 1.0);
   }
 
   if (clear_temp) {