Fix "what(): map::at" for unknown osds
parent
b686864dff
commit
9c850613bf
21
main.cpp
21
main.cpp
|
@ -314,13 +314,12 @@ static void _main(int argc, const char *argv[])
|
||||||
auto location = rados_utils.get_osd_location(osd);
|
auto location = rados_utils.get_osd_location(osd);
|
||||||
location["osd"] = std::to_string(osd);
|
location["osd"] = std::to_string(osd);
|
||||||
|
|
||||||
osd2location[osd] = location;
|
|
||||||
|
|
||||||
if (location.find(settings->mode) != location.end())
|
if (location.find(settings->mode) != location.end())
|
||||||
{
|
{
|
||||||
const auto &osd_loc = location.at(settings->mode);
|
const auto &osd_loc = location.at(settings->mode);
|
||||||
if (settings->specific_bench_item.empty() || osd_loc == settings->specific_bench_item)
|
if (settings->specific_bench_item.empty() || osd_loc == settings->specific_bench_item)
|
||||||
{
|
{
|
||||||
|
osd2location[osd] = location;
|
||||||
bench_items.insert(osd_loc);
|
bench_items.insert(osd_loc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -345,16 +344,16 @@ static void _main(int argc, const char *argv[])
|
||||||
|
|
||||||
unsigned int osd = rados_utils.get_obj_acting_primary(name, settings->pool);
|
unsigned int osd = rados_utils.get_obj_acting_primary(name, settings->pool);
|
||||||
|
|
||||||
const auto &location = osd2location.at(osd);
|
if (osd2location.find(osd) != osd2location.end())
|
||||||
const auto &bench_item = location.at(settings->mode);
|
|
||||||
if (!bench_items.count(bench_item))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
auto &names = name2location[bench_item];
|
|
||||||
if (names.size() >= (unsigned)settings->threads * 16)
|
|
||||||
{
|
{
|
||||||
bench_items.erase(bench_item);
|
const auto &location = osd2location.at(osd);
|
||||||
continue;
|
const auto &bench_item = location.at(settings->mode);
|
||||||
|
auto &names = name2location[bench_item];
|
||||||
|
if (names.size() >= (unsigned)settings->threads * 16)
|
||||||
|
{
|
||||||
|
bench_items.erase(bench_item);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
names.push_back(name);
|
names.push_back(name);
|
||||||
|
|
Loading…
Reference in New Issue