From: Sage Weil Date: Tue, 2 Dec 2014 16:36:41 +0000 (-0800) Subject: osdmaptool: --test-map-pgs-dump X-Git-Tag: v0.80.9~11^2~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4c951e9dc1ca31429119de15755caf3d73f6ffce;p=ceph.git osdmaptool: --test-map-pgs-dump Signed-off-by: Sage Weil (cherry picked from commit 7a99b489909b368bade36d8cc9722ad33d03a2e8) --- diff --git a/src/test/cli/osdmaptool/help.t b/src/test/cli/osdmaptool/help.t index 2c5a41de953..02f56efddff 100644 --- a/src/test/cli/osdmaptool/help.t +++ b/src/test/cli/osdmaptool/help.t @@ -4,6 +4,7 @@ --export-crush write osdmap's crush map to --import-crush replace osdmap's crush map with --test-map-pgs [--pool ] map all pgs + --test-map-pgs-dump [--pool ] map all pgs --mark-up-in mark osds up and in (but do not persist) --clear-temp clear pg_temp and primary_temp --test-random do random placements diff --git a/src/test/cli/osdmaptool/missing-argument.t b/src/test/cli/osdmaptool/missing-argument.t index d0740ab1df6..87ab3eb10d6 100644 --- a/src/test/cli/osdmaptool/missing-argument.t +++ b/src/test/cli/osdmaptool/missing-argument.t @@ -4,6 +4,7 @@ --export-crush write osdmap's crush map to --import-crush replace osdmap's crush map with --test-map-pgs [--pool ] map all pgs + --test-map-pgs-dump [--pool ] map all pgs --mark-up-in mark osds up and in (but do not persist) --clear-temp clear pg_temp and primary_temp --test-random do random placements diff --git a/src/tools/osdmaptool.cc b/src/tools/osdmaptool.cc index 0db39da52cf..bfeae4f46bf 100644 --- a/src/tools/osdmaptool.cc +++ b/src/tools/osdmaptool.cc @@ -35,6 +35,7 @@ void usage() cout << " --export-crush write osdmap's crush map to " << std::endl; cout << " --import-crush replace osdmap's crush map with " << std::endl; cout << " --test-map-pgs [--pool ] map all pgs" << std::endl; + cout << " --test-map-pgs-dump [--pool ] map all pgs" << std::endl; cout << " --mark-up-in mark osds up and in (but do not persist)" << std::endl; cout << " --clear-temp clear pg_temp and primary_temp" << std::endl; cout << " --test-random do random placements" << std::endl; @@ -75,6 +76,7 @@ int main(int argc, const char **argv) bool mark_up_in = false; bool clear_temp = false; bool test_map_pgs = false; + bool test_map_pgs_dump = false; bool test_random = false; std::string val; @@ -104,6 +106,8 @@ int main(int argc, const char **argv) clear_temp = true; } else if (ceph_argparse_flag(args, i, "--test-map-pgs", (char*)NULL)) { test_map_pgs = true; + } else if (ceph_argparse_flag(args, i, "--test-map-pgs-dump", (char*)NULL)) { + test_map_pgs_dump = true; } else if (ceph_argparse_flag(args, i, "--test-random", (char*)NULL)) { test_random = true; } else if (ceph_argparse_flag(args, i, "--clobber", (char*)NULL)) { @@ -313,7 +317,7 @@ int main(int argc, const char **argv) << ") acting (" << acting << ", p" << acting_primary << ")" << std::endl; } - if (test_map_pgs) { + if (test_map_pgs || test_map_pgs_dump) { if (pool != -1 && !osdmap.have_pg_pool(pool)) { cerr << "There is no pool " << pool << std::endl; exit(1); @@ -348,6 +352,9 @@ int main(int argc, const char **argv) } size[osds.size()]++; + if (test_map_pgs_dump) + cout << pgid << "\t" << osds << "\t" << primary << std::endl; + for (unsigned i=0; i