From 4a8cf6494490baa01c1347bbe618ce3ee103db26 Mon Sep 17 00:00:00 2001 From: Zhi Zhang Date: Wed, 16 Sep 2020 14:46:08 +0800 Subject: [PATCH] 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 --- src/tools/osdmaptool.cc | 2 -- 1 file changed, 2 deletions(-) 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) { -- 2.47.3