--export-crush <file> write osdmap's crush map to <file>
--import-crush <file> replace osdmap's crush map with <file>
--test-map-pgs [--pool <poolid>] map all pgs
+ --test-map-pgs-dump [--pool <poolid>] 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
--export-crush <file> write osdmap's crush map to <file>
--import-crush <file> replace osdmap's crush map with <file>
--test-map-pgs [--pool <poolid>] map all pgs
+ --test-map-pgs-dump [--pool <poolid>] 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
cout << " --export-crush <file> write osdmap's crush map to <file>" << std::endl;
cout << " --import-crush <file> replace osdmap's crush map with <file>" << std::endl;
cout << " --test-map-pgs [--pool <poolid>] map all pgs" << std::endl;
+ cout << " --test-map-pgs-dump [--pool <poolid>] 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;
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;
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)) {
<< ") 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);
}
size[osds.size()]++;
+ if (test_map_pgs_dump)
+ cout << pgid << "\t" << osds << "\t" << primary << std::endl;
+
for (unsigned i=0; i<osds.size(); i++) {
//cout << " rep " << i << " on " << osds[i] << std::endl;
count[osds[i]]++;
if (!print && !print_json && !tree && !modified &&
export_crush.empty() && import_crush.empty() &&
test_map_pg.empty() && test_map_object.empty() &&
- !test_map_pgs) {
+ !test_map_pgs && !test_map_pgs_dump) {
cerr << me << ": no action specified?" << std::endl;
usage();
}