From: Zhi Zhang Date: Wed, 16 Sep 2020 06:46:08 +0000 (+0800) Subject: tools/osdmaptool.cc: fix inaccurate pg map result when simulating osd out X-Git-Tag: v16.1.0~1037^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4a8cf6494490baa01c1347bbe618ce3ee103db26;p=ceph.git tools/osdmaptool.cc: fix inaccurate pg map result when simulating osd out 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 --- diff --git a/src/tools/osdmaptool.cc b/src/tools/osdmaptool.cc index 887086e55eb56..73ad1a535b6f1 100644 --- a/src/tools/osdmaptool.cc +++ b/src/tools/osdmaptool.cc @@ -345,7 +345,6 @@ int main(int argc, const char **argv) for (int i=0; iadjust_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) {